how to compile WPF project with environment variables but authentication failes

0 Answers 14 Views
Licensing
Peter
Top achievements
Rank 1
Iron
Iron
Peter asked on 05 Sep 2025, 03:56 PM

Hello. I have recently needed to repave my dev box. I got my latest code, setup two environment variables (username and password with the once only visible API key), as well as still have the nuget.config file and adding the proper telerik nuget server to the nuget manager. Unfortunately, I still have something wrong because when I compile, I get asked for my username and password what looks like it's the telerik nuget calls. Please help, this is driving me crazy. I'm just not able to figure this out.

 

I have ensured the nugetconfig is using the right\same environment variables as I have setup in the system environment. And the values are correct. Please help.

Peter
Top achievements
Rank 1
Iron
Iron
commented on 05 Sep 2025, 04:01 PM

I am seeing this popup.

After this popups as well.

 
Martin Ivanov
Telerik team
commented on 09 Sep 2025, 10:00 AM

Hello Peter, this dialog is displayed when the Visual Studio package manager tries to access a feed with authentication enabled (like the Telerik one). You need to enter your email address + password used to login to your telerik.com account. This stores the entered credentials in the Windows Credential Manager and in the corresponding nuget.config file (the global one by default). 

Then, the nugets will be restored using the saved credentials. The credentials will be searched in the global nuget.config or the config file in the solution folder (or recursively up in the file system hierarchy). If the config file doesn't contain the credentials you will see the popup that prompts you to enter them. Here is how my global nuget.config is defined:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="Telerik NuGet Server" value="https://nuget.telerik.com/v3/index.json" />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
    <add key="Local NuGet Feed" value="C:\Temp\LocalNugetFeed" />    
  </packageSources>
  <packageSourceCredentials>
    <Telerik_x0020_NuGet_x0020_Server>
      <add key="Username" value="my-email-here@my-domain-here.com" />
      <add key="Password" value="encoded-password-here" />
    </Telerik_x0020_NuGet_x0020_Server>
  </packageSourceCredentials>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
</configuration>

If you believe the setup is correct, you can double check if the project uses the correct nuget.config file.

And if this is correct too, then I would ask you to share the contents of your nuget.config file (by omitting all sensitive information), so I can check if there is something obvious that could cause the problem.

In case you are using Telerik NuGet Keys instead of your telerik.com email and password, you can check the following article and see if the information there helps as well.

No answers yet. Maybe you can help?

Tags
Licensing
Asked by
Peter
Top achievements
Rank 1
Iron
Iron
Share this question
or