开发者

gacutil from MSBuild

in my MSBuild file (TFSBuild.proj since I am running Team Builds) the exec command=g开发者_开发知识库acutil alwys fails with the following error: Failure initializing gacutil my build machine is a W2K3 with Team Build 2010.

any ideas.

Many thanks


Do a system-wide search for the following file: gacutil.exe.config

Then open the file in Notepad and check to see which version .NET Framework it references. It may look like the following:

<?xml version ="1.0"?>
<configuration>
    <startup>
        <requiredRuntime version="v1.1.4322"  />
    </startup>
</configuration>

For me, and probably for most PCs with .NET Frameworks which are more recent than Version 1.1, This config file will cause the message "Failure initializing gacutil". The following config file will work better:

<?xml version ="1.0"?>
<configuration>
    <startup useLegacyV2RuntimeActivationPolicy="true">
        <requiredRuntime safemode="true" imageVersion="v4.0.30319" version="v4.0.30319"/>
    </startup>
</configuration>

I came to this answer with help from Nitya-MSFT. See the following link, specifically the answer from Nitya-MSFT:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/49d4a656-40f1-4bb9-b1a7-da0f63557d0e/failure-initializing-gacutil

My customer's PC was previously a 32-bit machine running Windows 7 & .NET Framework 1.1.    Then, sometime recently, it was upgraded to have a 64-bit operating system running Windows 10 & .NET Framework 4.0.      However, the gacutil.exe was still running against an old config file, gacutil.exe.config, which was pointing to the old .NET Framework 1.1.      I used the XML supplied by Nitya-MSFT in order to create a new gacutile.exe.config.   Of course, I placed it into the folder alongside the gacutil.exe executable.     And my trouble went away!!    Much appreciation to Nitya-MSFT.    


Do you have the .NET framework SDK installed? I don't believe Gacutil is part of the standard .NET loadout.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜