.net - Change name of output dll based on configuration -


It seems that it should be very simple, but for the original library, I have two configurations i a normal .NET 4.0 The configuration is, the second is configured to register for COM interop, and also defines a compilation symbol, so I can work around some COM-related quirks with pre-processor instructions.

The problem is that when these are applied, these two DLLs should be in the same folder for the calling application (according to their design, can not do much about it). Works great when compiling each configuration in its related bin / subfolder, which includes both configurations with different strong-name keys, such as GAC, two separate assemblies , Even with the name and version

but to put them in the same folder it is necessary to rename one, and that's where this problem is.

What would be awesome If I could set the assets of the assembly name in the conditional application tab in Visual Studio, but it seems that this tab is Project-Scod, config- Is not scoped less than that, is there a way to specify a different filename, which will not cause run-time problems, will not the developer discreetly mention the problems? My goal here is to be able to provide facilities to NIT clients who do not support COM, while there is still compatibility with COM. I would not copy and paste everything that is in another project which is just a separate assembly name ...

Text ">

You can do this by editing your .csproj file. & lt; Assembly name & gt; element is the main & lt; PropertyGroup & gt; and place it in the respective configuration-specific property groups:

  & lt; Property group status = "'$ (configuration) | $ (platform)' == 'debug | sccpu'" & gt; & Lt; AssemblyName & gt; StackOverflow26265487.Debug & lt; / AssemblyName & gt; & Lt ;! - ... - & gt; & Lt; / PropertyGroup & gt; & Lt; Property group status = "'$ (configuration) | $ (platform)' == 'release | sccpu'" & gt; & Lt; AssemblyName & gt; StackOverflow26265487.Release & lt; / AssemblyName & gt; & Lt ;! - ... - & gt; & Lt; / PropertyGroup & gt;    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -