Reputation: 21
I newly converted my solution to .NET Framework 4.0 After it I got very wired error. Each first load after building my app I get filenotfound exception. here it is:
Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 9:
Line 10:
Line 11:
Line 12:
Line 13:
Upvotes: 2
Views: 1643
Reputation: 430
Change in your web.config file
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<customErrors mode="Off"/>
<authentication mode="None"/>
</system.web>
Upvotes: 2
Reputation: 1992
Since you said you've recently converted your app to .NET 4.0, please check the .NET version of your app's Application Pool in IIS. If it's 2.0 change to 4.0. Also check if you have properly referenced all your assemblies in your server.
Upvotes: 0
Reputation: 8067
It happened to me something similar. I had a reference to an assembly in the web.config file and I was missing the ddl file in the project references folder. Try reference this assembly (System.Windows). Also you can check if the referenced version of the ddl has matching version with the one specified in the web.config (Version=2.0.5.0).
Upvotes: 0
Reputation: 66641
Check if every mdule that you use on web.config is version 4. I think that you have miss a version 2.0 of the System.Windows, or a similar.
Especial Check this entries.
<compilation targetFramework="4.0">
<assemblies>
Upvotes: 0