I am trying to run the example C# code in visual studio for square connect:
https://github.com/square/connect-api-examples/tree/master/connect-examples/v2/csharp_payment
When I open the solution all of the references have a yellow triangle with and exclamation point next to them.
I have tried to restore nuget packages on the solution, uninstall and reinstall some and i can't get the triangles to go away. It won't build for me.
Any ideas? Thanks
Restore NuGet packagesNavigate to Tools > Options > NuGet Package Manager > General, and then select the Allow NuGet to download missing packages check box under Package Restore. Enabling Restore NuGet Packages. In Solution Explorer, right-click the solution, and then select Restore NuGet Packages.
Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.
nuget restore will ensure all of your NuGet dependencies are downloaded and available to your project. Whereas dotnet restore is a complete restoration of all NuGet dependencies as well as references and project specific tools. Meaning that if you run nuget restore , you are only restoring NuGet packages.
msbuild -t:Restore will restore nuget packages for projects with PackageReference nuget management format. And your situation looks like packages. config nuget management format which you have used it.
There is a target in their project file that can become problematic when projects are moved between systems.
You can fix the problem with two steps:
<Target Name="EnsureNuGetPackageBuildImports" ..>
element at the end of the project file, then reload the project.Update-Package -Reinstall
in your (NuGet) Package Manager Console.That should set everything right for your system and re-point to the correct versions of the relevant libraries.
Try to delete packages folder at solution root and rebuild or restore packages again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With