6

I have an ASP.NET Website project that I have converted to a Web Application. I converted the App_Code which has sub directories for vb and cs it renamed to the folder to Old_App_Code. Now the C# code will not compile, none of the syntax is recognized and several hundred errors show in the error list.

I know its possible to have both languages in a website project but how do I compile both in a web app project? or do I have to convert all the C# to VB?

1
  • What happens if you take the Old_App_Code out of your project somewhere else? Commented Mar 29, 2013 at 21:53

1 Answer 1

7

To run C# and VB together you can do some changes in web.config such as;

<system.codedom>
<compilers>
        <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <providerOption name="CompilerVersion" value="%ASSEMBLY_VERSION%"/>
        </compiler>
        <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <providerOption name="CompilerVersion" value="%ASSEMBLY_VERSION%"/>
        </compiler>
    </compilers>

and

<compilation debug="true" defaultLanguage="VB">
<codeSubDirectories>
                <add directoryName="CS_Code"/>
            </codeSubDirectories>
        </compilation>

for the rest you you use this walktrough

https://stackoverflow.com/a/735062/929902

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.