Currently developing an ASP.NET WebApplication with VS2008. I stopped development for a few weeks, and when I came back, my project is exhibiting the following problem:
The whole project compiles fine (all targeted to Framework3.5SP1). However, when I launch it (with ASP.NET Development Server), I get a message (from the browser) that there was a compilation error ‘Compiler Error Message: CS0234: The type or namespace name ‘DirectoryServices’ does not exist in the namespace ‘System’ (are you missing an assembly reference?)’
At the bottom of the error page, the version information: Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
The server is using .NET Framework Version 2? But all my projects are targetted to 3.5
Is there a simple way to prevent this from happening?
I should add:
re-installed .net framework version 3.5 + sp1, still same issue. important to note here is that i’m not using full blown IIS, just the ‘Asp.net development server’ supplied with VS2008. (CTRL + F5/Launch)
The reason being .NET 3.5 is not a stand alone framework like v2.0 or v1.1 . It is just an extension of the 2.0 framework. The extension provides developers with new language features like Anonymous Types, Extension Methods, Lambda Expressions and of course LINQ …. and AJAX is now integrated. Therefore you just use 2.0 in IIS.
You should try to install .NET Framework 3.5 on that server, the IIS server will automatically use the correct version.