Ondrejovic
asked on
VS compile problem after moving solution to 2010
I switched recently our asp.net 3.5 solution from VS 2008 to VS 2010 while still wanting it to be in .net 3.5 (as the deployment server runs on 3.5 only)
The libraries are migrated ok - no problems, but the web site is causing problems. The error message I get on every aspx page is like this:
D:\WebSites\.....aspx: ASP.NET runtime error: Could not load type 'Microsoft.Build.Framework .ITaskItem 2' from assembly 'Microsoft.Build.Framework , Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d 50a3a'.
I found out that the interface the compiler is looking for (ITaskItem2) is only available in .net 4.0, but it keeps looking for it in 3.5 assembly which is obviously wrong.
I was trying to locate where this discrepancy is originating, but with no luck.
It hinders my work significantly, because when the page is not compiled, the intellisense is not working for asp components, also debugging of the web pages is not working.
But even when this error occurs in VS, the pages are working correctly when displaying them in browser (using IIS), so this is VS-only problem.
If you have any idea, what could be wrong here, please let me know.
Thanks
The libraries are migrated ok - no problems, but the web site is causing problems. The error message I get on every aspx page is like this:
D:\WebSites\.....aspx: ASP.NET runtime error: Could not load type 'Microsoft.Build.Framework
I found out that the interface the compiler is looking for (ITaskItem2) is only available in .net 4.0, but it keeps looking for it in 3.5 assembly which is obviously wrong.
I was trying to locate where this discrepancy is originating, but with no luck.
It hinders my work significantly, because when the page is not compiled, the intellisense is not working for asp components, also debugging of the web pages is not working.
But even when this error occurs in VS, the pages are working correctly when displaying them in browser (using IIS), so this is VS-only problem.
If you have any idea, what could be wrong here, please let me know.
Thanks
ASKER
Hi,
thanks for proposal. I did this and it solved the mentioned error. However it produced load of new problems mostly with referenced libraries. :(
Example: Reference required to assembly 'System.Data.DataSetExtens ions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c56193 4e089' containing the base class 'System.Data.TypedTableBas e`1'. Add one to your project.
Which was not there before.
I need to keep the whole project in 3.5 as this is the latest version available on production server.
thanks for proposal. I did this and it solved the mentioned error. However it produced load of new problems mostly with referenced libraries. :(
Example: Reference required to assembly 'System.Data.DataSetExtens
Which was not there before.
I need to keep the whole project in 3.5 as this is the latest version available on production server.
Hi,
If there is no key added for this in web.config, add it.
<compilation debug="true">
<assemblies>
<add assembly="System.Data.Data SetExtensi ons, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C56193 4E089"/>
</assemblies>
</compilation>
If there is no key added for this in web.config, add it.
<compilation debug="true">
<assemblies>
<add assembly="System.Data.Data
</assemblies>
</compilation>
ASKER
Yup,
but I would rather solve this problem without switching the website to 4.0 (as 3.5 is running on prod server)
but I would rather solve this problem without switching the website to 4.0 (as 3.5 is running on prod server)
Hi,
Have you tried explicit loading System.Data.DataSetExtensi ons.dll to the project?
Try replacing: using System.Data.DataSetExtensi ons; with using System.Data;
Have you tried explicit loading System.Data.DataSetExtensi
Try replacing: using System.Data.DataSetExtensi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I found the solution by myself..
Check if the project is still using .net framework 3.5? Go to project properties and change the .net version to 4.0 if not and compile.