WPF编辑器无法加载用户控件,提示找不到类型错误的解决方法
2011-06-27 12:27
609 查看
使用工程内自定义用户控件的窗口无法加载到WPF编辑器中,报错:
Error 402 Cannot find type 'your.Control'. The assembly used when compiling might be different than that used when loading and the type is missing. Error at object 'System.Windows.ResourceDictionary', Line 6 Position 4.
这个问题已经困扰我2个星期了,一直都找不到问题所在。刚才终于找到原因了,是因为别人把工程AssemblyInfo.cs的AssemblyVersion修改了:
[assembly: AssemblyVersion("1.0.*")]
应该改回:
[assembly: AssemblyVersion("1.0.0.0")]
另外还有两种可能会引起找不到类型错误:
The solutions that are mentioned there
1. Ensure assembly version isn't using the 1.0.* syntax, wasn't valid for me, since the assembly version was already set to 1.0.0.0
2. Add a reference to the WpfControlLibrary.dll in Tester.exe, didn't make sense since we would be using this Tester.exe to launch any external WPF application. We can't go about adding references to all such assemblies.
3. Another option was to just copy the WpfControlLibrary.dll to the path where the Tester.exe was running from. This was something I could do, but then isn't an elegant solution.
详情参见:http://www.infosysblogs.com/microsoft/2008/08/wpf_appdomain_cannot_find_type.html
Error 402 Cannot find type 'your.Control'. The assembly used when compiling might be different than that used when loading and the type is missing. Error at object 'System.Windows.ResourceDictionary', Line 6 Position 4.
这个问题已经困扰我2个星期了,一直都找不到问题所在。刚才终于找到原因了,是因为别人把工程AssemblyInfo.cs的AssemblyVersion修改了:
[assembly: AssemblyVersion("1.0.*")]
应该改回:
[assembly: AssemblyVersion("1.0.0.0")]
另外还有两种可能会引起找不到类型错误:
The solutions that are mentioned there
1. Ensure assembly version isn't using the 1.0.* syntax, wasn't valid for me, since the assembly version was already set to 1.0.0.0
2. Add a reference to the WpfControlLibrary.dll in Tester.exe, didn't make sense since we would be using this Tester.exe to launch any external WPF application. We can't go about adding references to all such assemblies.
3. Another option was to just copy the WpfControlLibrary.dll to the path where the Tester.exe was running from. This was something I could do, but then isn't an elegant solution.
详情参见:http://www.infosysblogs.com/microsoft/2008/08/wpf_appdomain_cannot_find_type.html
相关文章推荐
- mac 下 使用 java运行 class 文件 总是提示 “错误: 找不到或无法加载主类”的解决方法
- java提示: “错误 找不到或无法加载主类解决方法
- cmd命令行执行java程序的编译和执行的方法及可能出现找不到或无法加载主类的错误的解决
- maven project中,在main方法上右键Run as Java Application时,提示错误:找不到或无法加载主类XXX.XXXX.XXX
- VS2015 C++编译失败,提示link1171,无法加载mspdb140.dll错误解决方法!
- maven project中,在main方法上右键Run as Java Application时,提示错误:找不到或无法加载主类XXX.XXXX.XXX
- C# 001 --- 正确的删除一个控件的事件函数 --- 解决错误: “A”不包含“B”的定义,并且找不到可接受类型为“A”的第一个参数的扩展方法“B”(是否缺少 using 指令或程序集引用?)
- 用VS2010自带的Library Package Manager安装EFCodeFirst出现“无法加载一个或多个请求的类型”错误的解决方法
- 用VS2010自带的Library Package Manager安装EFCodeFirst出现“无法加载一个或多个请求的类型”错误的解决方法
- “错误:java找不到或无法加载主类(主方法)***”解决方法
- Java 提示“找不到或无法加载主类” 解决方法
- VB源程序总是提示加载错误,或者不能加载OCX控件解决方法
- myeclipse 使用中 遇到错误 无法加载到tomcat下 提示如下 时 的 解决方法
- Eclipse 错误: 找不到或无法加载主类 解决方法
- 在命令行下编译通过,运行时提示错误:找不到或无法加载主类的原因分析与解决方式
- ”找不到或无法加载主类 “错误的解决方法
- VS2010在加载项目时,提示无法打开项目文件, 此安装不支持该项目类型的解决方法
- javac 不是内部或外部命令 和 错误 找不到或无法加载主类 的解决方法
- 用VS2010自带的Library Package Manager安装EFCodeFirst出现“无法加载一个或多个请求的类型”错误的解决方法
- 在配置windows2003域控时出现“未授予用户在此计算机上的请求登录类型”错误提示的解决方法