.NET Framework Developer Center > .NET Development Forums > Common Language Runtime > Visual Studio 2008 on Vista: run gacutil /i in post build event
Ask a questionAsk a question
 

AnswerVisual Studio 2008 on Vista: run gacutil /i in post build event

  • Monday, November 02, 2009 8:19 PMguoqingyu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    One of the post build event command in my C# project is
    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i $(TargetPath)

    it would fail but another command of uninstall succeeds.
    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /u $(TargetName)

    I tried using command line with administrator permission to install the assembly and it worked.

    I am using Vista Business. I disabled UAC on my computer.

    Thanks a million,

    Gene

Answers

  • Tuesday, November 03, 2009 9:12 PMguoqingyu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I figured it out, so I just answer the question to myself:

    This command would not work for me:

    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i $(TargetPath)

    But this would work for me:

    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i "$(TargetPath)"

    the target path folder on my computer is “D:\xxx xxx xxx\”, which has space - put quotation marks around the target path variable resolved my issue.

    • Marked As Answer byguoqingyu Tuesday, November 03, 2009 9:13 PM
    •  

All Replies

  • Tuesday, November 03, 2009 9:12 PMguoqingyu Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    I figured it out, so I just answer the question to myself:

    This command would not work for me:

    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i $(TargetPath)

    But this would work for me:

    "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil.exe" /i "$(TargetPath)"

    the target path folder on my computer is “D:\xxx xxx xxx\”, which has space - put quotation marks around the target path variable resolved my issue.

    • Marked As Answer byguoqingyu Tuesday, November 03, 2009 9:13 PM
    •