问题
i can add a define
to a WinForms project through the Project Properties:
How do i add a define
to an ASP.net solution?
Update: Here's what Visual Studio 2010 looks like when working in an ASP.net solution:
回答1:
Solution Explorer > WebApplicationProject (Name of your Web Application) > Properties > Build:
回答2:
Have you tried using the compilerOptions
attribute of the compiler
v element in web.config
? Like so:
<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"
compilerOptions="/define:TRACE">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
....
Should do the trick I think...
来源:https://stackoverflow.com/questions/11397158/how-to-add-a-define-to-an-asp-net-solution