views:

59

answers:

3

Hello,

I'm working on Visual Studio Profesionnal 2010.

In my solution I've got 2 projects The first is a web site with targeted .net runtime 2.0 the second is a dll with targeted .net runtime 2.0 I add the output of the second as assembly of the first.

I build and rebuild and clean my solution result : Build succeeded

But when I launch the projet in my web-browser ( in debug or release ). I've got the Server Error :

This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded

Is there someone who had already the problem?

I think it can be a bug from Visual Studio 2010 but the hotline is very expensive 300€ the phone call.

More Information : I opended my dll with reflector and saw that mscorlib is referenced 2 times the first time Version = 2.0 and the second time version = 4.0

+1  A: 

I am pretty sure that this means that you built with asp.net framework 3.5x, but your server only has 3.0x. Update the runtime on the server.

Replete
I know but both of my project are targeted 2.0 (my projet > Right click > properties > Build > Targeted Framework 2.0) in the app.config and web.config too
Christophe Debove
I 've updated my server my nothing changes
Christophe Debove
Did you see my above comment? If you're using IIS you might have to change the site configuration there.
Shadow Wizard
Ok it's cool but I won't run my projects under v4 or v3.5 runtime.Cause I've not the hand on my prod server so I couldn't do that and I edit my question to underline a piece of the probleme : mscorlib 4.0 and 2.0 are both load and referenced why visual studio build my dll and reference mscorlib 4.0 into.
Christophe Debove
A: 

Your server can only support 3.0, Updating the server will resolve the issue..

PirosB3
I 've updated my server my nothing changes
Christophe Debove
@PirosB3 The question is not "What is the version I need to make my app running". The question is "How can I make my .net 2.0 assembly work in my dev environement".
remi bourgarel
+1  A: 

Open the .csproj file with text editor (e.g. Notepad) and see the references in there.

If there are references to frameworks higher than 2.0 remove them or change to 2.0 if possible, save and reload the project.

Shadow Wizard
You are right in the csproj I found reference to 3.5 instead of 2.0 so I create a new project and migrate all my file and reference, It work fine. I think visual studio had done something wrong when conversing my project VS2008 to VS2010. Thanks you for all
Christophe Debove