A personal repository of technical notes. - CSC

Missing System.Web.Extensions Reference in Windows 7 x64 VS2010

Problem

Unable to compile an ASP.NET 2.0 project in Visual Studio 2010 on Windows 7 x64 that references System.Web.Extensions (ASP.NET AJAX 1.0). The following errors were thrown:

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3268: The primary reference "MyClass, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "MyClass, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

c:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1360,9): warning MSB3267: The primary reference "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v2.0". To resolve this problem, either remove the reference "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" or retarget your application to a framework version which contains "System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL".


Solution

1) Installed ASP.NET AJAX 1.0:

Download Details - Microsoft Download Center - ASP.NET AJAX 1.0
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=883

However, could not add a reference to System.Web.Extensions even though it was installed:


2) Had to manually add the following registry entry:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v2.0.50727\AssemblyFoldersEx\ASP.NET AJAX Extensions]
@="C:\\Program Files (x86)\\Microsoft ASP.NET\\ASP.NET 2.0 AJAX Extensions\\v1.0.61025\\"


Could then add a reference to System.Web.Extensions:



References

"MSBUILD 4.0 Fails on AJAX Extensions." Visual Studio 2010 - MSBUILD 4.0 Fails on AJAX Extensions - Stack Overflow. 3 June 2010. Web. 26 July 2011.
<http://stackoverflow.com/questions/2966769/msbuild-4-0-fails-on-ajax-extensions>.

1 comment:

Anonymous said...

Perfect! Solved my problem!!

Post a Comment