none
cannot we provide relative path for the dlls to be deployed to GAC when using gacutil RRS feed

  • Question

  • I am writing NANT sCripts to deploy assemblies into GAC but I am getting error like' failure in adding assembly to cache. sytem canot find the file specified " if i use the full paths it works . Cannot we use relative paths I have a folder known as GAC in my project directory . i want to give path like GAC\name of the dll in my NANt Scripts and install them to assembly by using GACUTIL

    • Moved by Alexander Sun Thursday, June 9, 2011 9:16 AM (From:.NET Framework Setup)
    Monday, June 6, 2011 12:03 PM

Answers

  •  

    Hi,

     

    As error message described, your NANT script project is not able to find file if you don’t provide a full-path of the assembly. I am not familiar with NANT script, so I don’t know how the NANT script project find file though provided path. But as I know, .NET project could access a file which is in project directory.

     

    For example, we have a test.xlsx file in the path of "project directory/GAC", we can access it though code below(it is not necessary to provide a full path):

    Process p = new Process();

                ProcessStartInfo si = new ProcessStartInfo();

                si.FileName=@"GAC\test.xlsx";

                p.StartInfo=si;

                p.Start();

     

    I think you'd better post thread in NANT script related forum.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Paul Zhou Wednesday, June 15, 2011 4:53 AM
    • Marked as answer by Paul Zhou Friday, June 17, 2011 5:29 AM
    Friday, June 10, 2011 5:12 AM

All replies

  • Hi ToniPalmiero,

     

    Welcome to the MSDN forum.

     

    I am sorry that this forum is about .NET Framework Setup. Your problem is a kind of CLR issue, so I will move your thread to CLR forum.

     

    Thanks.

     

    Best Regards,


    Alexander Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, June 8, 2011 10:04 AM
  • Thanks
    Wednesday, June 8, 2011 10:13 AM
  •  

    Hi,

     

    As error message described, your NANT script project is not able to find file if you don’t provide a full-path of the assembly. I am not familiar with NANT script, so I don’t know how the NANT script project find file though provided path. But as I know, .NET project could access a file which is in project directory.

     

    For example, we have a test.xlsx file in the path of "project directory/GAC", we can access it though code below(it is not necessary to provide a full path):

    Process p = new Process();

                ProcessStartInfo si = new ProcessStartInfo();

                si.FileName=@"GAC\test.xlsx";

                p.StartInfo=si;

                p.Start();

     

    I think you'd better post thread in NANT script related forum.


    Paul Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by Paul Zhou Wednesday, June 15, 2011 4:53 AM
    • Marked as answer by Paul Zhou Friday, June 17, 2011 5:29 AM
    Friday, June 10, 2011 5:12 AM
  • Agree with Paul. The issue that you have specified is that the NAnt script doesnt recognize the relative path that you have provided. You could refer to http://nant.sourceforge.net/release/latest/help/fundamentals/projects.html for the NAnt relative path documentation and see if it helps.
    Tuesday, June 14, 2011 5:09 AM