Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

I upgraded a .NET 3.5 Solution written in VS2008 to VS2012. (Simply by opening the solution in VS2012)

Everything went fine, the code can be compiled.
When running the code the IDE presents me the following Errormessage:
Location:<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.Daimler.Sisam.UI.SBE.FormSBE
End Sub
 
Error: An error occurred creating the form. See Exception.InnerException for details. The error is: Could not load file or assembly 'System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

It seems that the System cannot find the System.Drawing.dll 4.0. For this should be installed (Framework 4.0 and 4.5 are present) I don't understand why the System is looking for it. Every reference is set to the Drawing 2 dll.
I want to stick to framework 3.5 and the contained Drawing 2 dll. I don't want any reference to a higher framework because it will not be present on the PCs where the software will be installed.

Do you know why this happens and what I can do?

Thank you very much

Best regards

Jens

additional information copied from non-solution below
Thanks for your answers,
These settings were the First I checked and they all were 3.5
....
Any other ideas?
Posted
Updated 29-Nov-13 6:47am
v4
Comments
Ganesh KP 29-Nov-13 9:59am    
Did u tried of setting the target platform to dotNET 3.5 instead of 4.0 or 4.5 from the project properties section? To do that Right click on your project and Click on Properties and in the left side pane, select Application and set the Target Platform to 3.5 and try. I hope this will work and if it doesn't work then post it again what error u got latest.
Maciej Los 29-Nov-13 11:06am    
Right direction!
immes 29-Nov-13 14:22pm    
Thanks for your answers,

These settings were the First I checked and they all were 3.5
....

Any other ideas?

Best regards

Jens
Sergey Alexandrovich Kryukov 29-Nov-13 15:46pm    
No, they are not, otherwise nothing would require v.4. Check again, this time, for all assemblies/projects.
—SA
Sergey Alexandrovich Kryukov 29-Nov-13 15:45pm    
That is the solution. Will you post it as the answer.
The advice should be: either get all assemblies of required version or set the target to .NET v.3.5.
—SA

1 solution

Hello,

it's been a while but for I found the solution I thought I post it here in case anybody has the same problem.

So what helped me was to compile the Project with .NET 4.5 as target. Then set it back to 3.5 and compile again.

Best Regards


Jens
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900