Web site with multiple languages can't use VB.NET classes in C# code

前端 未结 2 1568
情书的邮戳
情书的邮戳 2021-01-23 08:49

I\'m developing a new functionality for web site project with VB.NET default language in VS 2008. As my preferred language is C# I create subfolder for C# code in the App_

2条回答
  •  再見小時候
    2021-01-23 09:02

    From the documentation for codeSubDirectories:

    The build order is inferred from the top-down order of the codeSubDirectories collection. The App_Code directory is built last.

    Which implies that when your C# code is being compiled, the VB code hasn't been compiled at that point. You might try and separate base classes, etc, and put them in an earlier subdirectory or into a compiled class library, but I'd probably recommend just writing your code in VB - it's not that tricky to write in one when you're used to the other - the framework is still the framework.

提交回复
热议问题