Search code examples
compilation.net-4.5dotnetnuke

Compilation Error (Website Not Recognizing .NET 4.5)


I am trying to get a website to recognize a new version of .Net (4.5) so that I can upgrade to the final version of DNN (7.2). I have .Net 4.5 installed but when I go into the IIS settings, switch the framework to 4.5 (it actually says 4.0 bc the version is technically 4.03), and then refresh local host I get the error:

"Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1703: An assembly with the same identity 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' has already been imported. Try removing one of the duplicate references.

[No relevant source lines]"

Haven't found anything useful thus far on the web regarding this. Please Help!

Update: the version referenced in the web.config does say 3.5.0.0 Is this the issue?


Solution

  • Your website only needs to be configured to use .Net 4.0
    .Net 4.5 is an extension of the version 4.0.
    Depending on the method you use to switch from .Net 2.0 to .Net 4.0, you would have to replace references to version 3.5 by references to version 4.0 in your web.config.