Ask a questionAsk a question
 

AnswerGacutil.exe Errors out w/ spaces in filepath

  • Monday, January 14, 2008 8:28 PMP.Brian.Mackey Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Everytime I use Gacutil.exe and specify a filepath w/ spaces in the name, the utility says it can't find the file specified.

     

    E.G.

    COMMAND

    -----------------

    C:\>gacutil /i GacUtilCL.dll /r FILEPATH "C:\Documents and Settings\bmackey\My D
    ocuments\Visual Studio 2005\Projects\GacUtilUI\GacUtilCL\bin\Debug\" "GAC Util"

     

    RETURNS

    ------------------
    Microsoft (R) .NET Global Assembly Cache Utility.  Version 2.0.50727.42
    Copyright (c) Microsoft Corporation.  All rights reserved.

                  SCHEME: <FILEPATH>  ID: <C:\Documents and Settings\bmackey\My Documents\Visual Studio 2005\Projects\GacUtilUI\GacUtilCL\bin\Debug" GAC>  DESCRIPTION : <Util>
    Failure adding assembly to the cache:   The system cannot find the file specified.

Answers

  • Wednesday, January 16, 2008 4:08 PMSergey Kanzhelev Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi,

     

    Regarding to the gacutil /?

     

    ...

    Options:
      /r <reference_scheme> <reference_id> <description>
        Specifies a traced reference to install (/i, /il) or uninstall (/u, /ul).
          <reference_scheme> is the type of the reference being added
            (UNINSTALL_KEY, FILEPATH or OPAQUE).
          <reference_id> is the identifier of the referencing application,
            depending on the <reference_scheme>
          <description> is a friendly description of the referencing application.
        Example: /r FILEPATH c:\projects\myapp.exe "My App"
    ...

     

    So, in your situation I think you have to use following command line:

     

    C:\>gacutil /i GacUtilCL.dll /r FILEPATH "C:\Documents and Settings\bmackey\My D
    ocuments\Visual Studio 2005\Projects\GacUtilUI\GacUtilCL\bin\Debug\GacUtilCL.dll" "GAC Util"

     

    Why don't you specify whole path right after /i attribute?

  • Wednesday, January 16, 2008 4:42 PMP.Brian.Mackey Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I tried the suggestion regarding full path + filename and it did not work.  I was using /i and /r simply because I was going by an example in the help file.  We did manage to fix the problem by your second suggestion, which is specifying the path after /i and not using /r.  This worked, not sure why /r doesn't do well w/ spaces in file path, but thats simply the way it is.

All Replies

  • Wednesday, January 16, 2008 4:08 PMSergey Kanzhelev Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer

    Hi,

     

    Regarding to the gacutil /?

     

    ...

    Options:
      /r <reference_scheme> <reference_id> <description>
        Specifies a traced reference to install (/i, /il) or uninstall (/u, /ul).
          <reference_scheme> is the type of the reference being added
            (UNINSTALL_KEY, FILEPATH or OPAQUE).
          <reference_id> is the identifier of the referencing application,
            depending on the <reference_scheme>
          <description> is a friendly description of the referencing application.
        Example: /r FILEPATH c:\projects\myapp.exe "My App"
    ...

     

    So, in your situation I think you have to use following command line:

     

    C:\>gacutil /i GacUtilCL.dll /r FILEPATH "C:\Documents and Settings\bmackey\My D
    ocuments\Visual Studio 2005\Projects\GacUtilUI\GacUtilCL\bin\Debug\GacUtilCL.dll" "GAC Util"

     

    Why don't you specify whole path right after /i attribute?

  • Wednesday, January 16, 2008 4:42 PMP.Brian.Mackey Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    I tried the suggestion regarding full path + filename and it did not work.  I was using /i and /r simply because I was going by an example in the help file.  We did manage to fix the problem by your second suggestion, which is specifying the path after /i and not using /r.  This worked, not sure why /r doesn't do well w/ spaces in file path, but thats simply the way it is.