Been searching for ages, can't find anything helpful. Here is the exception I'm getting:
一直在寻找,找不到任何有用的东西。这是我得到的一个例外:
Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Exception Details: System.IO.FileLoadException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Stack Trace:
[FileLoadException: Could not load file or assembly 'System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)]
StructureMap.Graph.PluginGraph..ctor() in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\Graph\PluginGraph.cs:41
StructureMap.PluginGraphBuilder..ctor() in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\PluginGraphBuilder.cs:22
StructureMap.InitializationExpression..ctor() in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\InitializationExpression.cs:22
StructureMap.ObjectFactory.Initialize(Action`1 action) in c:\BuildAgent\work\996e173a8ceccdca\src\StructureMap\ObjectFactory.cs:47
...
This applications works fine on the test server but is throwing this exception on the production server. As you can see, the StructureMap code is what is causing the exception.
这个应用程序在测试服务器上运行良好,但是在生产服务器上抛出这个异常。如您所见,结构映射代码是导致异常的原因。
I had to convert this app to .NET 4 from 4.5 because 4.5 wasn't installed on the production server. After the conversion, the app still works fine on my local machine and the test server.
我不得不将这个应用程序转换成。net 4,因为4.5没有安装在生产服务器上。在转换之后,应用程序仍然可以在本地机器和测试服务器上正常工作。
I have already set the Copy Local to True for the System assembly, but since the referenced version is 4.0.0.0 and not 2.0.5.0, I this made no difference.
我已经为系统程序集设置了Copy Local,但是由于引用的版本是4.0.0.0,而不是2.0.5.0,所以这没有什么区别。
Let me know if any more info is needed. Any help you may be able to provide is appreciated.
如果需要更多信息,请告诉我。感谢您提供的任何帮助。
5 个解决方案
#1
38
Make sure your .NET framework is patched. Microsoft released patches to .NET to allow Portable Class Libraries to properly find the appropriate runtime (KB2468871). If you are seeing the above exception (or something like it), it means you're missing the latest .NET framework patches.
确保你的。net框架被修补了。微软向。net发布补丁,允许可移植的类库适当地找到合适的运行时(KB2468871)。如果您看到上述异常(或类似的情况),则意味着您错过了最新的. net框架补丁。
#2
1
Edit the web.config file to remove the reference, which is not required for normal operation:
编辑网页。配置文件删除引用,不需要正常操作:
1 - Open the web.config file in the root of your site
1 -打开网络。配置文件在您的站点的根目录。
2 - Find the following line and comment it out():xxxxx-is your assembly name.
找到下面的行并注释掉它():xxxxx是您的程序集名称。
<add assembly="xxxxx", Version=2.0.5.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
3 - Save and close the web.config file and try again
3 -保存并关闭网络。配置文件并重试。
#3
0
I just want to share another solution from here that solved the problem on my development machine: installing Silverlight 5 SDK (only 11.2MB at the time of writing this post) was enough to make everything working.
我只是想从这里共享另一个解决方案,解决了我的开发机器上的问题:安装Silverlight 5 SDK(在撰写本文时只有11.2MB)足以让一切正常工作。
#4
0
I found that it was the "await" and "async" that where giving me trouble.
我发现它是“等待”和“异步”,给我带来麻烦。
I had Windows XP SP3 with only .NET 4.0, but had to update it to .NET 4.0.3 using KB2600211 - this wasn't updated automatically through Windows Update when .NET 4.0.3 came out because the computer is off-grid.
我使用的是Windows XP SP3,只有。net 4.0,但不得不使用KB2600211更新到。net 4.0.3——当。net 4.0.3出现时,这不是自动更新的,因为电脑是离线的。
This is the link to the update:
这是更新的链接:
https://www.microsoft.com/en-us/download/details.aspx?id=29053
https://www.microsoft.com/en-us/download/details.aspx?id=29053
#5
-1
Install Microsoft® Silverlight® 5 SDK from the following link. It resolves and works fine for me.
从以下链接安装微软的Silverlight 5 SDK。它解决了我的问题。
SDK下载
#1
38
Make sure your .NET framework is patched. Microsoft released patches to .NET to allow Portable Class Libraries to properly find the appropriate runtime (KB2468871). If you are seeing the above exception (or something like it), it means you're missing the latest .NET framework patches.
确保你的。net框架被修补了。微软向。net发布补丁,允许可移植的类库适当地找到合适的运行时(KB2468871)。如果您看到上述异常(或类似的情况),则意味着您错过了最新的. net框架补丁。
#2
1
Edit the web.config file to remove the reference, which is not required for normal operation:
编辑网页。配置文件删除引用,不需要正常操作:
1 - Open the web.config file in the root of your site
1 -打开网络。配置文件在您的站点的根目录。
2 - Find the following line and comment it out():xxxxx-is your assembly name.
找到下面的行并注释掉它():xxxxx是您的程序集名称。
<add assembly="xxxxx", Version=2.0.5.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
3 - Save and close the web.config file and try again
3 -保存并关闭网络。配置文件并重试。
#3
0
I just want to share another solution from here that solved the problem on my development machine: installing Silverlight 5 SDK (only 11.2MB at the time of writing this post) was enough to make everything working.
我只是想从这里共享另一个解决方案,解决了我的开发机器上的问题:安装Silverlight 5 SDK(在撰写本文时只有11.2MB)足以让一切正常工作。
#4
0
I found that it was the "await" and "async" that where giving me trouble.
我发现它是“等待”和“异步”,给我带来麻烦。
I had Windows XP SP3 with only .NET 4.0, but had to update it to .NET 4.0.3 using KB2600211 - this wasn't updated automatically through Windows Update when .NET 4.0.3 came out because the computer is off-grid.
我使用的是Windows XP SP3,只有。net 4.0,但不得不使用KB2600211更新到。net 4.0.3——当。net 4.0.3出现时,这不是自动更新的,因为电脑是离线的。
This is the link to the update:
这是更新的链接:
https://www.microsoft.com/en-us/download/details.aspx?id=29053
https://www.microsoft.com/en-us/download/details.aspx?id=29053
#5
-1
Install Microsoft® Silverlight® 5 SDK from the following link. It resolves and works fine for me.
从以下链接安装微软的Silverlight 5 SDK。它解决了我的问题。
SDK下载