New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VS doesn't support environment variables in repositoryPath (NuGet.exe does) #2763

Closed
dsagar3409 opened this Issue May 11, 2016 · 12 comments

Comments

Projects
None yet
5 participants
@dsagar3409

dsagar3409 commented May 11, 2016

Hi,

I have installed the latest Nuget Package (version: 3.4.3.855) and it is not able to resolve environment variable mentioned in the “repositoryPath” (Nuget.config). However, NuGet.exe (console application) is able to resolve it.

The path is mentioned as shown below:
<config> <add key="repositoryPath" value="%MYNUGETPATH%" /> </config>

MYNUGETPATH should resolve to a folder located on my local machine.

I get the following error when I try to install any package for a project.

"The given path's format is not supported."

@yishaigalatzer yishaigalatzer added this to the 3.4.5 milestone May 11, 2016

@rrelyea rrelyea changed the title from Issue with Nuget Environment variable to VS doesn't support environment variables in repositoryPath (NuGet.exe does) May 17, 2016

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea May 17, 2016

Contributor

Looks like 3.4 added the support for env vars. Haven't dug into it to see if it was meant to only work in NuGet.exe.
NuGet/NuGet.Client#171
I believe it was done by @TravisTheTechie

Contributor

rrelyea commented May 17, 2016

Looks like 3.4 added the support for env vars. Haven't dug into it to see if it was meant to only work in NuGet.exe.
NuGet/NuGet.Client#171
I believe it was done by @TravisTheTechie

@TravisTheTechie

This comment has been minimized.

Show comment
Hide comment
@TravisTheTechie

TravisTheTechie May 17, 2016

It was targeted for NuGet.exe (for CI), but I thought it would work for the Visual Studio plugin since it appeared to use the same Settings object. My first thought would be that Visual Studio can't resolve that environment variable -- but this isn't code I'm that familiar with to be 100% sure that's the case. I just fixed an issue that I needed. Sorry it doesn't work for you though! 😿

TravisTheTechie commented May 17, 2016

It was targeted for NuGet.exe (for CI), but I thought it would work for the Visual Studio plugin since it appeared to use the same Settings object. My first thought would be that Visual Studio can't resolve that environment variable -- but this isn't code I'm that familiar with to be 100% sure that's the case. I just fixed an issue that I needed. Sorry it doesn't work for you though! 😿

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208

zhili1208 May 17, 2016

Contributor

@dsagar3409 just tried it, it works on my machine. so what' s the path for that nuget.config and did you reopen the solution after adding nuget.config?

Contributor

zhili1208 commented May 17, 2016

@dsagar3409 just tried it, it works on my machine. so what' s the path for that nuget.config and did you reopen the solution after adding nuget.config?

@dsagar3409

This comment has been minimized.

Show comment
Hide comment
@dsagar3409

dsagar3409 May 19, 2016

@zhili1208 Could you let me know the Nuget packege version you tried ?

The config file will be loacted in C:\Users\sadevana\AppData\Roaming\Nuget

I restarted the VS after adding the repository path but it didn't help.

dsagar3409 commented May 19, 2016

@zhili1208 Could you let me know the Nuget packege version you tried ?

The config file will be loacted in C:\Users\sadevana\AppData\Roaming\Nuget

I restarted the VS after adding the repository path but it didn't help.

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208

zhili1208 May 19, 2016

Contributor

@dsagar3409 I tried 3.4.3.855, looks like nuget read the repository path, but throws for path format. So what's your project type and what's the path you specified in nuget.config? If it's an relative path, please also share your solution path.

Contributor

zhili1208 commented May 19, 2016

@dsagar3409 I tried 3.4.3.855, looks like nuget read the repository path, but throws for path format. So what's your project type and what's the path you specified in nuget.config? If it's an relative path, please also share your solution path.

@dsagar3409

This comment has been minimized.

Show comment
Hide comment
@dsagar3409

dsagar3409 May 20, 2016

@zhili1208 my project is a web application(its just a blank web app) and I am using full path in the environment variable. For example:

The above value should resolve to C:\logs.

As mentioned above by the developers I think this will be fixed in 3.4.5. So I'm waiting for it.

dsagar3409 commented May 20, 2016

@zhili1208 my project is a web application(its just a blank web app) and I am using full path in the environment variable. For example:

The above value should resolve to C:\logs.

As mentioned above by the developers I think this will be fixed in 3.4.5. So I'm waiting for it.

@dsagar3409 dsagar3409 closed this May 20, 2016

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208

zhili1208 May 20, 2016

Contributor

@dsagar3409 I didn't see your config value, Can you share you NuGet.Config file? thanks

Contributor

zhili1208 commented May 20, 2016

@dsagar3409 I didn't see your config value, Can you share you NuGet.Config file? thanks

@zhili1208 zhili1208 reopened this May 20, 2016

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208
Contributor

zhili1208 commented May 23, 2016

@dsagar3409

This comment has been minimized.

Show comment
Hide comment
@dsagar3409

dsagar3409 May 23, 2016

Hi @zhili1208 here in I have attached the config file.

NuGet.zip

dsagar3409 commented May 23, 2016

Hi @zhili1208 here in I have attached the config file.

NuGet.zip

@dsagar3409 dsagar3409 closed this May 23, 2016

@zhili1208

This comment has been minimized.

Show comment
Hide comment
@zhili1208

zhili1208 May 23, 2016

Contributor

what's the environment variable value? MYNUGETPATH = "C:\logs" ?

Contributor

zhili1208 commented May 23, 2016

what's the environment variable value? MYNUGETPATH = "C:\logs" ?

@dsagar3409

This comment has been minimized.

Show comment
Hide comment
@dsagar3409

dsagar3409 May 23, 2016

Yes you are right .

MYNUGETPATH = "C:\logs"

dsagar3409 commented May 23, 2016

Yes you are right .

MYNUGETPATH = "C:\logs"

@zhili1208 zhili1208 reopened this May 25, 2016

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue May 25, 2016

@zhili1208 zhili1208 self-assigned this May 26, 2016

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue May 27, 2016

zhili1208 added a commit to NuGet/NuGet.Client that referenced this issue Jun 1, 2016

@rrelyea rrelyea modified the milestones: 3.5 Beta, 3.4.5, 3.5 RTM Jun 29, 2016

@rrelyea

This comment has been minimized.

Show comment
Hide comment
@rrelyea

rrelyea Jun 29, 2016

Contributor

appears to have been fixed with that commit from @zhili1208. setting milestone to 3.5rtm, as it will first ship there.

Contributor

rrelyea commented Jun 29, 2016

appears to have been fixed with that commit from @zhili1208. setting milestone to 3.5rtm, as it will first ship there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment