Failed to add reference to 'Microsoft.DiaSymReader.Native.amd64' - visual-studio

I have created a nuget package and published to Azure. When I add the package to another project it fails with the following error:
I followed the same process for every other nuget package without issues. Any tips?

Related

Unable to find package Telerik.UI.for.Xamarin with version(>=2022.1222.1)

We have a Xamarin project, and we need to start debugging on MAC. We use the MacInCloud Service.
After cloning the project from source control, I encounter the following error -> Unable to find package Telerik.UI.for.Xamarin with version(>=2022.1222.1). It appears as soon as the project is cloned and with the the 'Could not restore packages'.
What options do I have to resolve this issue?
I have tried removing the the package from the Packages directory and removed the reference in the csproj aswell.
I can't do a manual install of telerik as we do not have admin rights on MacInCloud.
The log file >This is the entire log file - Getting restore information for project /Users/user219905/Documents/GitHub/gts-mobile/GtsApp/GtsApp/GtsApp.csproj
Getting restore information for project /Users/user219905/Documents/GitHub/gts-mobile/GtsApp/GtsApp.iOS/GtsApp.iOS.csproj
Getting restore information for project /Users/user219905/Documents/GitHub/gts-mobile/GtsApp/GtsApp.Android/GtsApp.Android.csproj
Running restore with 4 concurrent jobs.
Reading project file /Users/user219905/Documents/GitHub/gts-mobile/GtsApp/GtsApp/GtsApp.csproj.
Restoring packages for /Users/user219905/Documents/GitHub/gts-mobile/GtsApp/GtsApp/GtsApp.csproj...
Restoring packages for .NETStandard,Version=v2.0...
GET https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin/index.json
GET https://nuget.devexpress.com/xRMAAuTIJGNTlKc1O83zlgVKkkr2ibgsDfUBelIIfu3Oq2Ku77/api/FindPackagesById()?id='Telerik.UI.for.Xamarin'&semVerLevel=2.0.0
GET https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin.datagrid/index.json
GET https://nuget.devexpress.com/xRMAAuTIJGNTlKc1O83zlgVKkkr2ibgsDfUBelIIfu3Oq2Ku77/api/FindPackagesById()?id='Telerik.UI.for.Xamarin.DataGrid'&semVerLevel=2.0.0
NotFound https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin.datagrid/index.json 172ms
OK https://api.nuget.org/v3-flatcontainer/telerik.ui.for.xamarin/index.json 173ms
OK https://nuget.devexpress.com/xRMAAuTIJGNTlKc1O83zlgVKkkr2ibgsDfUBelIIfu3Oq2Ku77/api/FindPackagesById()?id='Telerik.UI.for.Xamarin.DataGrid'&semVerLevel=2.0.0 367ms
OK https://nuget.devexpress.com/xRMAAuTIJGNTlKc1O83zlgVKkkr2ibgsDfUBelIIfu3Oq2Ku77/api/FindPackagesById()?id='Telerik.UI.for.Xamarin'&semVerLevel=2.0.0 502ms
Resolving conflicts for .NETStandard,Version=v2.0...
Unable to find package Telerik.UI.for.Xamarin with version (>= 2022.1.222.1)
Found 1 version(s) in nuget.org [ Nearest version: 2015.3.1202 ]
Found 0 version(s) in DevExpress
Unable to find package Telerik.UI.for.Xamarin.DataGrid. No packages exist with this id in source(s): DevExpress, nuget.org
Package 'Microsoft.Bcl 1.1.10' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package 'Microsoft.Net.Http 2.2.29' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.
Package restore failed. Rolling back package changes for 'GtsApp'.

How to disable "transitive package management" for a Visual Studio project

How do I disable "transitive package management"?
I wish to do so, so that I can install a package that I "packed" locally and have in a .nupkg file. When I attempt to do so, I get a messaging stating that The 'Source' parameter is not respected for the transitive package management based project(s) {csproj file}. The enabled sources in your NuGet configuration will be used.
Complete Context
When developing a NuGet package that's not ready for distribution via our NuGet feed, I often create a local .nupkg file like this from the package manager console:
nuget pack {path-to-csproj-file}
This generates a {project-name}.nupkg file, which I can then install in another project by opening it in Visual Studio, navigating to the package manager console, and entering the command
Install-Package {path-to-nupkg-file}
This has worked great and once the NuGet package is ready for distribution, we push it up to Azure DevOps and let the build pipeline there push it into our feed.
However, I just recently inherited a project where the prior developer apparently setup "transitive package management" that prevents this workflow. Here's what I get when I try to install directly from a .nupkg file:
Install-Package C:\Users\Josh\source\repos\SpeakerDiscountManager\SpeakerDiscountData.1.0.5.nupkg
The 'Source' parameter is not respected for the transitive package management based project(s) MembershipApplicationWidget\MembershipApplicationWidget.csproj. The enabled sources in your NuGet configuration will be used.
<snipped several lines of unsuccessfully searching configured package sources>
Install-Package : NU1102: Unable to find package SpeakerDiscountData with version (>= 1.0.5)
Obviously, it doesn't find the package I've specified via file, because it is searching online feeds and it doesn't exist in any of our online package sources--the package is in a testing state, not ready for anyone to use but me.
Based on the error message, I need to turn off "transitive package management" so that I can specify a file source for the package, but I've been unable to turn up any information online about how this is configured.
I did try installing this exact same .nupkg file in another project, using the same Install-Package {path-to-nupkg-file} procedure. This works.
How to disable “transitive package management” for a Visual Studio
project
I think this problem transitive package management is related to your current project structure which has some intricate dependencies, custom rules and so on. Therefore, turning off transitive package management is unpractical. If you create other projects and then install this package by your way, I think it probably will not occur.
As a best workaround, as you said(hint from the message The enabled sources in your NuGet configuration will be used.), add the the local nuget package's path into Nuget Package Source.
In your side, I think you specify -Source xxxxx(the path of the nuget package) to install this package in the package manager console, if so, this function actually is inconvenient.
You can just add the folder path which SpeakerDiscountData.1.0.5.nupkg exists into global nuget package source. Once you have done it, it will applies to any projects in this machine.
It has two ways:
1) VS IDE UI
Tools-->Options-->NuGet Package Manager-->Packages Sources-->add a new key and input the path of the nuget folder. Also, check its option.
2) global NuGet.Config file
(C:\Users\xxxx\AppData\Roaming\NuGet\Nuget.Config and step 1 is just add the path into this file by VS UI Control)
add these:
<packageSources>
<add key="Local Packages Source" value="C:\Users\Josh\source\repos\SpeakerDiscountManager\" />
..........
</packageSources>
After that, you can use your command to install this nuget package.
Note: If the root directory of your solution also has a file named nuget.config, the parameters in it will override the global file. It has the highest priority.
Just go to Vs IDE Tools/Nuget Package Manager/Package Manager Setting And Check The address of Package Sources.
it's something like "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages".
Then Copy your package file into that folder and at last run this command in Package Manager Console:
install-package packagename

Teamcity Nuget Publish to Octopus Repository(built in) fails with 503 error

I have an AsP.net Website with nuspec file set up on teamcity.I have basically defined two build steps.
1. Nuget Pack
2. Nuget Publish.
The nuget package gets created successfully, but I get a 503 error whilst trying to
run the Nuget publish step.
Here is the teamcity publish settings
the error returned is as follows:
[push] An error was encountered when fetching 'PUT https://myoctopusdeployrepo/nuget/packages/'. The request will now be retried.
[10:08:14][push] An error occurred while sending the request.
[10:08:14][push] The remote server returned an error: (503) Server Unavailable.
I know the push to the built in octopus repository works at least for asp.net csharp projects using .csproj and octopack , but i get this error when trying to push a package that was generated from a nuspec file.
Perhaps there is something I'm missing out in the settings ?
Whilst researching and trying out certain other build steps, I came across the 'Octopus Deploy: Push Packages' build step ( Teamcity 2018.2). This runs octo.exe which will need to be installed on the build agent(Octopus deploy commandLine tool) . This plugin is available on the octopus deploy website.
the command as listed in the log is as below
octo.exe push --server http://octopusdeployserver --apikey SECRET --package <package url>
I hope this helps.

Cannot restore nuget packages on VSTS (Packages failed to install)

I'm using Visual Studio Team Services to build a .NET solution. I have a Nuget Installer task to restore the packages of the solution that is configured as follows:
Nuget.config file has 2 package sources - one is nuget.org (v2) and the other is a custom feed (Nuget Server v2.5.40416.9020). All packages from the nuget.org feed are restored but the ones from the custom feed are not, for each package from the custom feed there is an error message like this:
Unable to find version 'abc' of package 'xyz'
Error:
[error]Error:
C:\a_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.22\node_modules\nuget-task-common\NuGet\3.3.0\NuGet.exe
failed with return code: 1 [error]Packages failed to install
This was working fine 1 or 2 days ago.
Locally everything seems to work fine. Also, I tried with the nuget version 3.5.0 and a custom version of nuget.exe, without success.
Any suggestions?
I just had this error today. I fixed this error by reviewing the changes in my solution file with our base code branch and found some old lines that weren't supposed to be there. I think they were a result of a bad merge and should have been removed during a conflict resolve.
To fix the issue I simply removed the references that were old and everything built just fine.
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Services", "Services", "{EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}"
EndProject
{3C14F190-6B6A-4913-9681-AFD9B62850FA} = {EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}
{687ECE00-A567-40F3-BFF9-C3B639328F27} = {EAECFF2D-7339-4180-8E1E-6DF9EC9EB131}
Thanks,
Fissh

NuGet package installed on the solution level instead of project level

I'm trying to customize an existing NuGet package to add some new behavior, specifically into a package called StyleCop.MsBuild
Downloaded the source of the package from bitbucket repo (https://bitbucket.org/adamralph/stylecop-msbuild/wiki/Home)
Changed id of package in *.nuspec file from StyleCop.MSBuild to MyCustomPackage
Created *.nupkg file using NuGet Package Explorer
Uploaded *.nupkg file to my local NuGet server
So the only change was the id of the original package.
But now when I try to install MyCustomPackage into a project, it is installed on the solution level and not on the project level. Visual Studio creates a folder called '.nuget' in the root of the solution and places the packages.config file in there.
Not sure what causes this change since all I did was to change the package id.
Any help appreciated.
The StyleCop.MsBuild package has an msbuild target in the build folder and the convention is that the name should match the package id. So by changing the package id, the msbuild target file was not referenced anymore and the package became a solution level one.
https://docs.nuget.org/create/creating-and-publishing-a-package#import-msbuild-targets-and-props-files-into-project

Resources