Relative path for compileroptions in .NET
I want to use the compileroptions tag in the web.config to version my DLL files. Is it possible to use a relative path? If not, are t开发者_Go百科here any options for using a relative path? I am using CruiseControl.
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp"
extension=".cs"
warningLevel="4"
compilerOptions="NEED_ARELATIVE_PATH\Properties\AssemblyInfo.cs"
type="Microsoft.CSharp.CSharpCodeProvider,System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion"
value="v4.0"/>
<providerOption name="WarnAsError"
value="false"/>
</compiler>
</compilers>
</system.codedom>
If you are talking about a precompiled web application, the source is copied to the obj subdirectory of the precompiled root, so you can use
compilerOptions="obj\Release\Source\Properties\AssemblyInfo.cs"
(You have to include the active configuration (e.g., Release
) in the string, but at least it's a relative path.)
精彩评论