转换有C#和VB到Web应用程序的ASP.NET网站 [英] Converting an ASP.NET Website that has C# and VB to a Web Application
问题描述
我有我已经转换到Web应用程序的ASP.NET网站项目。我转换有子目录为VB和CS其重命名为文件夹Old_App_Code在App_Code。现在的C#代码将无法编译,没有语法是公认几百错误显示错误列表。
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.
我知道它可能有两种语言的网站项目,但我怎么在Web应用程序项目编译两者兼而有之?或者我有所有的C#转换成VB?
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?
推荐答案
要运行C#和VB一起,你可以做一些的修改web.config中如;
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>
和
<compilation debug="true" defaultLanguage="VB">
<codeSubDirectories>
<add directoryName="CS_Code"/>
</codeSubDirectories>
</compilation>
有关您在使用本walktrough
for the rest you you use this walktrough
http://stackoverflow.com/a/735062/929902
这篇关于转换有C#和VB到Web应用程序的ASP.NET网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!