开发者

Place DLLs in GAC on Solution Build in Debug

开发者 https://www.devze.com 2022-12-14 00:01 出处:网络
We have a couple of DLLs that开发者_如何学编程 need to be put in the GAC at compile time only in Debug mode as this is what developers use locally. Release mode will be the Continuous Integration serv

We have a couple of DLLs that开发者_如何学编程 need to be put in the GAC at compile time only in Debug mode as this is what developers use locally. Release mode will be the Continuous Integration server build and we will not want to put any dlls in the GAC.

We used to do something similar with post build events on a project, but if a post build event can be conditionally run if debug.

What is the best way to achieve this?


If you want your post build event to run only in debug mode, configure it this way:

if not $(ConfigurationName) == Debug goto end
...your commands here...
:end

Or, more generically, to run different commands on each configuration:

goto $(ConfigurationName)

:Debug
...commands for debug mode
goto end

:Release
...commands for release mode
goto end

:end


if $(ConfigurationName) == Debug "C:\Program files\Microsoft Visual Studio 8\SDK\v2.0\Bin\GacUtil.exe" -i "$(TargetPath)"

if $(ConfigurationName) == Debug "C:\Program files\Microsoft Visual Studio 8\SDK\v2.0\Bin\GacUtil.exe" -i "$(TargetDir)\Perito.Framework.Common.CallbackTransport.Interfaces.dll"

0

精彩评论

暂无评论...
验证码 换一张
取 消