Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 981683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:34:53+00:00 2026-05-16T04:34:53+00:00

I have a test website with VS 2008 that just uses code behind files,

  • 0

I have a test website with VS 2008 that just uses code behind files, such as Foo.aspx.cs. Thus, the web server compiles them on the fly. The problem I’m running into is I can’t use any C# 3.0 features. If I do:

var x = 1;

or

public class Foo
{
public int x {get;set;}
}

or

Foo x = new Foo() {x = 5};

Then VS will work fine (everything gets highlighted and Intellisensed), but when I run the site it just throws up compiler errors..

Is there a way to fix this, or do you have to compile a DLL to target the 3.0 runtime? If so that’s insanely lame..

Mike

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T04:34:53+00:00Added an answer on May 16, 2026 at 4:34 am

    Oh sweet, I got it figured out! I had to put this in the web.config..

       <system.codedom>
          <compilers>
             <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
                       type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
             </compiler>
             <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
                       type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="OptionInfer" value="true"/>
                <providerOption name="WarnAsError" value="false"/>
             </compiler>
          </compilers>
       </system.codedom>
    

    I think this is because my web.config was borrowed from a very old project..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a test website that contains a single ASP.net index.aspx file that
I am writing code to performance test a web site. I have the following
I am trying to set up a mono asp.net 4.0 test website that uses
I have a web application that I wrote in Visual Studio 2008 that targets
I have a Test Class, that test the access of all page with different
I have a test project, with an App.config that sets up default values for
I have a test where I'm mocking 2 service calls that get called in
I'm trying to use HtmlUnit to test that my GWT website loads properly. Unfortunately,
I have a legacy web-site that I am maintaining (built mostly in classic ASP
I'm working at a web site search which uses Sql server 2008 express edition.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.