System.IO.IOException:“找不到资源“views.buttonstylepage.xaml”。”
初学作为记录(事发场景):
WPFDemo的程序集中,定义了一个Views文件夹,该文件夹放一些页面Page、UI层面的东西。用Frame空间做导航的时候,始终报一个错误 // System.IO.IOException:“找不到资源“views.buttonstylepage.xaml”。”
代码:
private void Page1_Click(object sender, RoutedEventArgs e)
{
if(((Button)sender).Name == "Page1")
{
MyFrame.Navigate(new Uri("Page1.xaml", UriKind.Relative)); // 为程序集中,文件夹之外的页面,可以找得到
}
else if(((Button)sender).Name == "Page2")
{
MyFrame.Navigate(new Uri("Views.ButtonStylePage.xaml", UriKind.Relative)); // 为文件夹内的页面,找不到
}
}
原因:
就是文件夹访问页面,用的是 . 不是/,才导致出的错 "Views.ButtonStylePage.xaml"
结果:
将代码改为: MyFrame.Navigate(new Uri("Views/ButtonStylePage.xaml", UriKind.Relative));
System.IO.IOException:“找不到资源“views.buttonstylepage.xaml”。”的更多相关文章
- System.IO.IOException:“找不到资源“window1.xaml”。” 解决方法
报错:找不到资源"window1.xaml 原因:在编译时使用的是en-US选项进行编译并生成了en-US为名的文件夹,里面包含了可本地化的内容:但是你的本地系统使用的是zh-CN,在你运行 ...
- Fiddler的一些坑: !SecureClientPipeDirect failed: System.IO.IOException
手机的请求Fiddler可以捕捉,但是手机一直无法上网,在logs中看到的日志如下: !SecureClientPipeDirect failed: System.IO.IOException 由于远 ...
- HttpClient exception:ExceptionType:System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System.IO.IOException: Unable to read data from the transport connection: Operation ca
error msg: System.Threading.Tasks.TaskCanceledException: The operation was canceled. ---> System. ...
- .Net WebApi开发SharePoint出现System.IO.FileNotFoundException: 找不到位于的 Web 应用程序
System.IO.FileNotFoundException: 找不到位于 http://xxx/sites/xxxx 的 Web 应用程序.请确认正确键入了此 URL.如果此 URL 需要提供现有 ...
- System.IO.IOException: The handle is invalid.
System.IO.IOException: The handle is invalid. 00022846 11:39:49.098 AM [892] 00022847 11:39:49.098 A ...
- VSCode 出现错误 System.IO.IOException: The configured user limit (128) on the number of inotify instances has been reached.
方案一: sudo vim /etc/sysctl.conf 增加下面内容(环境变量) fs.inotify.max_user_watches = 1638400 fs.inotify.max_use ...
- System.IO.Directory.Delete目录删除
在程序运行的时候,如果直接获取一个目录路径,然后执行删除(包括子目录及文件): System.IO.Directory.Delete(path,true); 或者 System.IO.Director ...
- Jenkins报错Caused: java.io.IOException: Cannot run program "sh" (in directory "D:\Jenkins\Jenkins_home\workspace\jmeter_test"): CreateProcess error=2, 系统找不到指定的文件。
想在本地执行我的python文件,我本地搭建了一个Jenkins,使用了execute shell来运行我的脚本,发现报错 [jmeter_test] $ sh -xe D:\tomcat\apach ...
- 服务 在初始化安装时发生异常:System.IO.FileNotFoundException: "file:///D:\testService"未能加载文件或程序集。系统找不到指定文件。
@echo.@if exist "%windir%\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe" goto INSTALL ...
- 解决java.io.IOException: Cannot run program "cygpath": CreateProcess error=2, 系统找不到指定的文件 的错误
一.外部环境: 系统环境:Windows 8 磁盘分区:只有C盘 开发环境:IntelliJ IDEA Community Edition 2016.1.3(64) 执行代码:rdd.saveAsTe ...
随机推荐
- Qt事件处理的几种方式
Qt提供了5种事件处理和事件过滤的方法: 1.重写事件处理器函数 这是大部分情况最常用的一种,如重写 paintEvent().mousePressEvent().keyPressEvent() 等事 ...
- Python标准库模块之heapq
创建堆 heapq有两种方式创建堆, 一种是使用一个空列表,然后使用heapq.heappush()函数把值加入堆中,另外一种就是使用heap.heapify(list)转换列表成为堆结构 #创建堆方 ...
- js循环中删除数组中的某个元素
(1)使用js中的splice方法循环删除数组中某个值 eg: var arr=new Array(); arr.push(1); arr.push(2); arr.push(3); arr.push ...
- vue中v-if与v-show区别
vue中显隐方法常用两种,v-show和v-if,但这两种是有区别的. v-if v-if 控制元素显示或隐藏是把dom元素整个的渲染或者删除,如果删除,也就是页面中不存在这个dom元素,以此达到隐藏 ...
- express的安装,使用,请求,自动更新,静态资源托管(一)
1.打开编辑器vscode 2.安装express npm install express@4.17.1 3.创建文件index.js 4.导入express const express = ...
- Vue CLI创建Vue2项目
1.安装Node.js * Node.js中包含了npm工具 安装后查看版本: node -v npm -v 2.设置npm的源为国内源 npm config set registry https:/ ...
- css - contenteditable
css - contenteditable contenteditable属性 contenteditable 属性是 HTML5 中的新属性.规定是否可编辑元素的内容. 让contenteditab ...
- git rebase之abort,continue,skip
git rebase --abort 会放弃合并,回到rebase操作之前的状态,之前的提交的不会丢 git rebase --skip 会将引起冲突的commit丢弃掉 git rebase --c ...
- 如何在超星下载非资料页面的ppt
首先打开迅雷(没有就复制到网页下载) 点击f12 点击网络,筛查出输入flag,在响应模块中找到ppt,复制网址并下载
- 升级adb
adb 是没有自动升级的命令的,如果想要更新adb的版本,需要在网上找到自己想要的版本进行更新. 为什么要更新呢? 肯定是在使用中遇到了什么问题必须升级版本才能解决,如果不影响使用,那都无所谓.这里提 ...