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 ...
随机推荐
- Java流程控制之用户交互Scanner
Scanner对象 java.util.Scanner是Java5的新特征,可以通过Scanner类来获取用户的输入 #基本语法# Scanner s = new Scanner(System.in) ...
- linux离线安装gcc 和g++
1.先到有网的机器上下载依赖包 sudo yum install --downloadonly --downloaddir=/home/mjb/soft/gcc gcc sudo yum instal ...
- linux搭建FastDFS文件服务器,安装nginx
本文主要介绍在linux服务器如何搭建FastDFS文件服务器.大概分为9个步骤,由于内容较为繁琐.下面带你入坑! 首先简单介绍一下FastDFS是淘宝资深架构师余庆老师主导开源的一个分布式文件系统, ...
- 完整的javaweb文档
1.index.jsp <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8&qu ...
- 043_关于Salesforce集中权限的解释
1.创建Object的时候,一定要选中Deploy,避免在All Tabs 中找不到 2.在Profile里,选择 Standart tab Setting.Custom tab setting,有三 ...
- memoのMac折腾记录
memoのMac折腾记录 纯粹是一些零散的学习记录.有错误欢迎指出. 我就是一鼠标党,不会Linux. zsh加载 惭愧,最近才知道bash和zsh是两个不同的终端... 之前看一些mac设置系统环境 ...
- ssh scp 相关
1. 设置ssh 的免密登录 1> 将 ~/.ssh/id_rsa.pub文件中的内容拷贝到 远程host的 ~/.ssh/authorized_keys文件中 2> ssh-copy-i ...
- SpringBatch生成的DB表SQL
SQL: -- Autogenerated: do not edit this file DROP TABLE IF EXISTS BATCH_STEP_EXECUTION_CONTEXT; DROP ...
- VirtualBox_Ubuntu22.10_Terminal无法打开
https://blog.csdn.net/weixin_43959807/article/details/128872860
- Ubuntu22.04 KubeSphere 安装K8S集群
Ubuntu22.04 KubeSphere 安装K8S集群_Ri0n的博客-CSDN博客 一.系统环境系统:Ubuntu 22.04集群IP分布hostname 角色 IP地址master mast ...