visual studio 2010 - GACed .net library project succesfully build only on second try -


I am trying to create a project library which should be in GAC, so I created the following line as a post Added construction program:

"C: \ Program Files (x86) \ Microsoft SDKs \ Windows \ v7.0A \ bin \ gacutil.exe" -if "$ (TargetPath)"

Everybody (second build, forward build, etc ...) I get this for the execution:

  ------ start building : Project: Test .BusinessLogic, Config Grace: Debug any CPU ------ test. Business - & gt; C: \ Users \ Eran \ Documents \ Test \ Trunk \ Test. BusinessLogic \ bin \ Debug \ Test.BusinessLogic.dll Microsoft (R) .NET Global Assembly Cache Utility Version 3.5.3072 9.1 Copyright (c) Microsoft Corporation All Rights Reserved. Assembly successfully added to the cache ========== Build: 1 succeeded or up-to-date, 0 failed, left 0 ==========  

Which is good - build successful

But for every weird (first build, third build, etc ...) build performance, I get this:

  ------ start building Gone: Project: Test. Business, Configuration: Debug any CPU ------ Test Business - & gt; C: \ Users \ Eran \ Documents \ Test \ Trunk \ Test. BusinessLogic \ bin \ Debug \ Test.BusinessLogic.dll Microsoft (R) .NET Global Assembly Cache Utility Version 3.5.3072 9.1 Copyright (c) Microsoft Corporation All Rights Reserved. Failure to add assembly to cache: Can not create that file when the file already exists. C: \ Windows \ Microsoft \ .NET Framework \ v4.0.30319 \ Microsoft.Common.targets (3717 9): Error MSB3073: Command "" C: \ Program Files (x86) \ Microsoft SDKs \ Windows \ v7.0A \ Bin \ gacutil.exe "-if" C: \ Users \ Eran \ Documents \ Test \ Trunk \ Test. BusinessLogic \ bin \ Debug \ Test.BusinessLogic.dll "" Exited Code 1. ======= === Build: 0 succeeded or up-to-date, 1 failed, left 0 ==========  

Which Bad and very strange.

How can I solve this issue?

Are you in the context of this assembly? / P>

Microsoft warns on using this tool when active reference exists.

/ uf

  Eliminate all indexed references and an assembly of & lt; Assembly_name & gt; The assembly is the full name for the removal. The assembly will be removed until it is referred by the Windows Installer.  

!! Warning: Use the / uf command with care, because the applications may fail to run !!

Visual Studio is better to work with this device, e.g. Run it before the compilation begins, and after creating your assembly

(VSD2010 in a separate script):

  gacutil / uf < Assembly name & gt;  

(or VSD2010 in a different script) Create your assembly without pre-post or post build actions called gacutil:

  gacutil / if & lt ; Assembly name & gt;  

Comments