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?
In the Create a new project window, select C# from the Language list. Next, select Windows from the platform list, and Web from the project types list. After you apply the language, platform, and project type filters, select the ASP.NET Core Web App template, and then select Next.
The compilation tool provides two general forms of compilation: in-place precompilation and precompilation for deployment. With in-place precompilation you run the aspnet_compiler.exe tool from the command-line and specify the path to the virtual directory or physical path of a website that resides on your computer.
The DifferenceC# is actually a language used in conjunction with ASP.NET. ASP.NET is more comparable to Django or Ruby on Rails . And so, basically, the difference is that ASP.NET is a framework for websites, and C# is a programming language used on this framework.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With