Looking in my machine nuget config I can see my ADO feed is registered, but there's no ADO token in it:
(C:\Users\user\AppData\Roaming\NuGet\NuGet.config)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<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="dev.myfeed.com" value="https://pkgs.dev.azure.com/myfeed/_packaging/myfeed/nuget/v3/index.json" />
</packageSources>
<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>
Running a dotnet restore on my project successfully downloads a package which only exists in this feed, and I can't understand how it succeeds? The feed requires a token to authenticate against, and there's no token in my machine NuGet.config file. Has it retrieved the token from somewhere else?
Has it retrieved the token from somewhere else?
The credentials are stored in Azure Artifacts Credential Provider. The Azure Artifacts Credential Provider automates the acquisition of credentials needed to restore NuGet packages as part of your .NET development workflow. We need to install the latest .NET Core SDK and credential provider first when we use dotnet with Azure Artifacts feeds.
Here is my sample when I run dotnet restore and verify with credential provider. I need to open a browser and sign in my account:
Related
we want to keep the Nugets we use in our feed in case nuget.org will be down.
Under NuGet.Config we did:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="Nugets" value="https://pkgs.dev.azure.com/<ourOrganization>/<ourProject>/_packaging/Nugets/nuget/v3/index.json" />
</packageSources>
<packageRestore>
<!-- The 'enabled' key is True when the "Allow NuGet to download missing packages" checkbox is set.
Clearing the box sets this to False, disabling command-line, automatic, and MSBuild-integrated restore. -->
<add key="enabled" value="True" />
</packageRestore>
</configuration>
Now if I go to the artifacts -> Nugets I can see some of the package, appear as NugetGallery, but not all of them.
For example Newtonsoft.Json is missing.
Also when I look at the source - why are all of them under Nugetgalley, and not 'this feed'?
Thank you for your help.
My solution builds perfectly on my local machine and it uses Microsoft.Data.Sqlclient and Azure.Core nuget packages, but the solution does NOT build on our Azure Devops server because there is no internet access there. The error is "Error NETSDK1064: Package Azure.Core, version 1.20.0 was not found."
I put these packages in a .packages subfolder and created a Nuget.config file that I believe references this sub-folder, but no luck.
How can I tell our DevOps server to use find the Nuget packages in the .packages subfolder?
I finally got this to work through the NuGet Restore task placed before the build. I chose "custom" as the NuGet Restore command type, and the actual command was:
restore CoreBZ2.sln -PackagesDirectory ..\packages
with ALL of the needed packages (all .nupkg files) in the "packages" subfolder of my solution. (CoreBZ2.sln is the name of my project/solution.)
I also had a NuGet.config file placed in the same folder as the solution and it looked like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value=".\packages" />
<add key="Azure.Core" value=".\packages" />
</packageSources>
<config>
<add key="globalPackagesFolder" value=".\packages" />
<add key="defaultPushSource" value=".\packages" />
</config>
<activePackageSource>
<add key="All" value=".\packages" />
</activePackageSource>
<config>
<add key="repositoryPath" value="$\..\packages" />
</config>
</configuration>
There is probably a better way to do this, but this did finally result in a successful build on the offline DevOps server.
I recently added grial nuget packages to a xamarin solution.
It works fine locally but the build fails on mobile.azure.com.
I have used the nuget command line to add the new package source, including the credentials as a username / encrypted password.
It still breaks the build though, but this time with the error
"Data unprotection failed."
Has anyone come across this before, and do you have any possible solution?
thanks
You need to consider adding a nuget.config file. Below is an example that we used to include our Proget Feed.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="true" />
<add key="automatic" value="true" />
</packageRestore>
<packageSources>
<add key="NRTH Proget" value="http://proget.nrth.com/nuget/nuget" />
</packageSources>
</configuration>
Just drop this file in the same folder as your solution (.sln) file.
I am trying to log in to Azure Active Directory from my web page in cloud services. The log in screen comes up and I am able to log in OK. However when it sends me to my homepage it says "page cannot be displayed". In the Azure Active Directory configuration I added SSL localhost to the APP URI and Reply URL and configured the properties in VS2013 to show SSL = True and set the project URL to the localhost. I was able to access the page before I added the log in screen.
Relevant web.config settings:
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
<add key="webpages:Enabled" value="false" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="ida:FederationMetadataLocation" value="login.windows.net/conpro.com/FederationMetadata/2007-06/…; />
<add key="ida:Realm" value="localhost:44307/"; />
<add key="ida:AudienceUri" value="localhost:44307/"; />
</appSettings>
Your web.config URI values need to include https://. I'd suggest taking a look at this sample app as well.
I'm using nuget integration with msbuild (visual studio 2012) to automatically restore broken packages. Below you can see my .nuget/nuget.config file for solution:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
</packageRestore>
<disabledPackageSources />
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
<config>
<add key="repositoryPath" value="..\..\Lib\NuGet\Packages" />
</config>
</configuration>
My packages directory moved outside from solution. This works fine during build, but Package Manager Console still using $(SolutionDir)\packages to install (and restore) packages.
It is possible to change packages directory for "Package Manager Console"?
nuget.config
You got the first part:
<config>
<add key="repositoryPath" value="..\MySuperCoolPackages" />
</config>
But you have to tell the command line about the nuget.config file explicitly.
C:\SomeFolder\NuGet.exe install "C:\MySolution\.nuget\packages.config" -ConfigFile "C:\MySolution\.nuget\nuget.config"
When you create nuget.config with repositoryPath you need to restart VS for it to be reread and console to be aware of it.
Edit: #DmitryBykadorov weird, may be your nuget is out of date? There was an early problem where due to config being in .nuget subfolder and not in .csproj's current>parent>parent>etc path it wouldn't see it and required one nuget.config with restore info and one (typically next to .sln or .csproj itself) with repositoryPath, but my VS2012 with whatever latest nuget it comes with works fine with config below. May be your global nuget config somehow affects it, or your solution needs hard clean/rebuild?
<configuration>
<solution>
<add key="disableSourceControlIntegration" value="true" />
</solution>
<config>
<add key="repositoryPath" value="..\..\lib" />
</config>
</configuration>