Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Target Framework and/or compiler version with ASP.NET dynamic compilation

Target Framework and/or compiler version with ASP.NET dynamic compilation

Scheduled Pinned Locked Moved ASP.NET
csharptutorialasp-netdotnetvisual-studio
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dojohansen
    wrote on last edited by
    #1

    Hi, To avoid any helpful but irrelevant answers: I'm not talking about deployment here, only of my dev environment! I am using VS-2008 and wish to target Framework 3.5 and use the v3.5 C# compiler. (It is of course possible to use Framework 2.0 libraries with new compiler features such as type inference or anonymous types.) But for some reason this project (the only one of 19 in the solution!) apparently gets built for 2.0 or using a v2.0 C# compiler. The web project appears in solution explorer as "http://localhost/dev/" (I call this the "web project" but there is no project file and I believe this is what MS calls the "web site" model, as opposed to the "web application" model). I can't find any compiler options. If I right-click the web site in solution explorer and choose "property pages", then go to "build", the Target Framework option is ".NET Framework 3.5". But if I right-click the site and choose "build web site", the project will not build if any using directives referring to Linq namespaces are included, nor if any code in the site uses C# features newer than C# 2.0, such as

    var x = 5;

    (While this code itself is stupid it's a good example because this clearly only depends on the compiler and not on the framework version.) If I fire up the browser and point it at my site, the dynamic compilation process gets underway and produces a build error ("CS0246: The type or namespace 'var' cannot be resolved", loosely translated from French as I unfortunately have to work in the French locale). At the bottom of this standard asp.net error page it says Version Information: Version Microsoft .NET Framework :2.0.50727.3082; Version ASP.NET :2.0.50727.3082 Any idea how to correct this and use Framework 3.5 and the v3.5 C# compiler? I've searched MSDN and found nothing helpful; it always points me to the property pages where it already says this project is targeting 3.5!

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups