引用多级DLL时,Visualstudio IDE中的Filenotfoundexception [英] Filenotfoundexception in visualstudio IDE when multilevel DLL's are referenced
问题描述
您好,
我的环境是:
- Windows 7,VS 2010 SP1,FW .NET 4.0。
问题是:
- 我有一个DLL .NET(没有StrongName的dll1.dll版本1.0.0.0),它包含一个简单的类,可以执行任何操作;
- 我有第二个DLL .NET(没有StrongName的dll2.dll版本1.0.0.0),它包含一个WinForms UserControl,带有一个简单的Button控件;还引用了dll1,将SpecificVersion属性设置为false;
- 我有一个WinForms应用程序,它只包含一个Form。 dll1和dll2在SpecificVersion属性设置为false的情况下引用,在VS IDE中,我在ToolBox中添加UserControl,然后在表单上拖放一个UserControl实例;
此时,应用程序编译(x86)和运行时都可以。
然后:
- 我修改了一下在dll1中的位代码,我将dll1的版本从1.0.0.0修改为1.1.0.0,我重新编译dll1;
- 但我不想重新编译dll2因为他的代码没有变化;
- 在WinForms应用程序中,对dll1的引用升级到1.1.0.0,对dll2的引用仍然是1.0.0.0。
结果:
- 编译仍然可以;
- 运行时仍然可以,因为没有StrongName;
- 但是当我尝试在IDE中显示表单时,VS会抛出一个FileNotFoundException,因为它找不到dll1 version 1.0.0.0。
我不明白为什么,在设计n时间,VS会抛出这个在运行时没有抛出的异常。
我希望我的解释清晰而详细。
谢谢你的帮助
克里斯
我的尝试: < br $> b $ b
使用VisualStudio 2013,同样的问题。
Hello,
my environment is :
- Windows 7, VS 2010 SP1, FW .NET 4.0.
The issue is :
- I have a DLL .NET (dll1.dll version 1.0.0.0 without StrongName) who contains a simple class that does anythis ;
- I have a second DLL .NET (dll2.dll version 1.0.0.0 without StrongName) who contains a WinForms UserControl, with one simple Button control ; dll1 is also referenced, with SpecificVersion property set to false ;
- I have a WinForms application, who contains just one Form. dll1 and dll2 are referenced with SpecificVersion property set to false, and in the VS IDE, I add the UserControl in the ToolBox, then I drag and drop one instance of UserControl on the Form ;
At this point, application compilation (x86) and runtime are OK.
Then :
- I modify a little bit code in dll1, I modify the version of dll1 from 1.0.0.0 to 1.1.0.0, and I recompile dll1 ;
- BUT I DON'T WANT to recompile dll2 because his code has no changes ;
- In the WinForms application, reference to dll1 is upgraded to 1.1.0.0, and reference to dll2 is still to 1.0.0.0.
Results :
- compilation is still OK ;
- runtime is still OK, because there is no StrongName ;
- BUT when I try to display the Form in the IDE, VS throws a FileNotFoundException because it cannot found "dll1 version 1.0.0.0".
I don't understand why, at design time, VS throws this exception that is not thrown at runtime.
I hope that my explanations are clear and detailed enough.
Thank you for your help
Chris
What I have tried:
With VisualStudio 2013, same issue.
推荐答案
很可能VS编辑器嵌入了版本的dll某处。
尝试从表单和工具箱中删除控件,然后重新添加;应该摆脱错误。
It is likely the VS editor has embedded the version of the dll somewhere.
Try deleting the control from the form and from the toolbox, and add it again; that should get rid of the error.
你好,
我有这个但是我得到了同样的错误。
这是导致异常的dll2和dll1之间的链接,而不是应用程序和dll2之间的链接。
Chris
Hello,
I have trid that but I get the same error.
This is the link between dll2 and dll1 that causes the exception, and not the link between application and dll2.
Chris
这篇关于引用多级DLL时,Visualstudio IDE中的Filenotfoundexception的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!