Question : Server Error in '/' Application-Migrated from VS2008 - VS2010.

I have been using VS2008/.net 3.5  on Vista with a number of 3rd party components (including Telerik controls) and successfully upgraded all of these to VS2010/.net 4.0.

The applications run fine on the development machine. Trouble starts when i test on the production server. This is Windows Server 2003 sp2. X64.

 So far on Win2003:
- I have downloaded and installed .NET framework 4.0 X64.
- I have uploaded new VS010 files which run fine on the dev server.
-Changed IIS properties for the apps on the  to use ASPNET4.0 for the test apps.
-Tried to register ASPNET4.0 application pool using regis_iis.exe -ir . Don't know if this worked because  aspnet 4.0 is not available as a selection in the application pool.

I have also looked at the web.config file to ensure no reference is made to the older assemblies for the newer application. this is what happens.  When I have

<compilation debug="true" targetFramework="4.0"/>

I get

-----------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
---------------------------------

I have attached the full web.config file (minus the <apps settings> tag containing passwords)So I have changed this to
    <compilation debug="true"/>

That's when I get :

------
Could not load file or assembly 'eWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
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.BadImageFormatException: Could not load file or assembly 'eWeb' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
-------------------

I have struggled with this for hours. (including google! - so I am hoping for more than web links)

Please Help!!!!

 
 
web.config
 

Answer : Server Error in '/' Application-Migrated from VS2008 - VS2010.

Hi Guys,

I have been able to resolve this issue in two steps.

1. The settings I changed (use ASP.NET4.0 instead of 2.0) on the virtual directory for the test apps was fine but i had neglected to do the dame on the actual default website folder as well. This immediately cleared the  <compilation debug="true" targetFramework="4.0"/> part of the problem.
2. I then found that after installing .Net framework 4.0 the Web Service Extensions of for ASP.NET 4.0 is set to prohibited by default in IIS. I therefore enabled this.

Both the older .NET 3.5 apps and new .NET 4.0 apps work fine alongside each other on the same server.

PS: There were numerous solutions relating to errors on line <compilation debug="true" targetFramework="4.0"/> . Those did not work for me and the above did. Conversely, this may not work for you and google may dig up something that does for you.

Thanks

J
Random Solutions  
 
programming4us programming4us