1. David Peace
  2. SnapDevelop
  3. Monday, 10 October 2022 12:51 PM UTC

Hi All

I've installed PB2022 and build a small application to deploy with PowerServer. The deployment runs through OK but when I open the SnapDevelop C# code I get errors loading the project.

An example of the errors are:

Error NU1301: Failed to retrieve information about 'Microsoft.Extensions.Logging.Log4Net.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.Extensions.Logging.Log4Net.AspNetCore'&semVerLevel=2.0.0'.

Error NU1301: Failed to retrieve information about 'PowerServer.Core' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Core'&semVerLevel=2.0.0'.

I have my package source setup as: https://www.nuget.org

What am I missing?

Cheers

 

 

Accepted Answer
Logan Liu @Appeon Accepted Answer Pending Moderation
  1. Thursday, 21 December 2023 10:07 AM UTC
  2. SnapDevelop
  3. # Permalink
Hi David, 1) Did you start using NuGet v2 a long time ago? I can't see this activePackageSource node in my NuGet.config file. activePackageSource has been deprecated in NuGet 3.x+ (https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#activepackagesource) <activePackageSource> <add key="nuget.org" value="https://www.nuget.org/api/v2/";; /> </activePackageSource> 2) NuGet client tools can be installed in many ways. For SnapDevelop, it depends on NuGet installed along with .NET Core SDK. https://learn.microsoft.com/en-us/nuget/install-nuget-client-tools Please open CMD, go to the folder of the C# solution, and run the "dotnet restore" command directly: https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-restore If you can see the same errors, please try to reinstall .NET Core 6 SDKs on your machine to see whether it works. Regards, Logan
Comment
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Monday, 10 October 2022 12:58 PM UTC
  2. SnapDevelop
  3. # 1

the name is nuget.org, the source (url) is: https://api.nuget.org/v3/index.json

 

if you go to package source, you can see that setup.  Should also have visual studio packages listed there too.

tools| Options| package manager| nuget package manager | Package Sources

 

Comment
  1. David Peace
  2. Monday, 10 October 2022 13:22 PM UTC
Hi Mike



I had tried that option too, but was geting errors too e.g.:



Failed to retrieve information about 'Microsoft.NET.Test.Sdk' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.NET.Test.Sdk'&semVerLevel=2.0.0'. 1 1

Failed to retrieve information about 'PowerServer.Core' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Core'&semVerLevel=2.0.0'. 1 1









  1. Helpful
  1. Logan Liu @Appeon
  2. Tuesday, 11 October 2022 02:48 AM UTC
Hi David,



I think Mike is correct. It seems that your NuGet Package Source Configuration is not correct. It should be https://api.nuget.org/v3/index.json instead of https://www.nuget.org.



If references a package not existing in the NuGet source, it outputs in my environment:

Error NU1301: Failed to retrieve information about '{PACKAGE NAME}' from remote source 'https://api.nuget.org/v3/index.json/FindPackagesById()?id=...



This default NuGet official package source is set up by default and usually doesn't need to modify it. Please verify the URL of the package source again.



Alternatively, you can directly modify the NuGet.Config file to configure the source.



E.g.: This is a user scope NuGet.Config (%appdata%\NuGet\NuGet.Config). You can edit it to add a user scope source directly.

<packageSources>

<add key="nuget.org" value="https://api.nuget.org/v3/index.json"; />

</packageSources>



BTW: You can refer to NuGet documentation to know more details about NuGet.Config:

https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior

https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file#package-source-sections

https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1301



Regards, Logan
  1. Helpful 1
  1. David Peace (Powersoft)
  2. Wednesday, 12 October 2022 08:50 AM UTC
I have my package resources set up with nuget.org and https://api.nuget.org/v3/index.json as the URL. Interestingly this was not setup by default.



My NuGet.Config looks like this:



<configuration>

<activePackageSource>

<add key="nuget.org" value="https://www.nuget.org/api/v2/"; />

</activePackageSource>

<packageRestore>

<add key="enabled" value="True" />

<add key="automatic" value="True" />

</packageRestore>

<bindingRedirects>

<add key="skip" value="False" />

</bindingRedirects>

<packageManagement>

<add key="disabled" value="False" />

<add key="format" value="0" />

</packageManagement>

<packageSources>

<add key="nuget.org" value="https://api.nuget.org/v3/index.json"; />

</packageSources>

</configuration>









However, I'm still getting the following errors:



1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'Microsoft.Extensions.Logging.Log4Net.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.Extensions.Logging.Log4Net.AspNetCore'&semVerLevel=2.0.0'.

1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'Microsoft.ApplicationInsights.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.ApplicationInsights.AspNetCore'&semVerLevel=2.0.0'.

1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'PowerServer.Api' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Api'&semVerLevel=2.0.0'.

1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'Swashbuckle.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0'.

1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'PowerServer.Core' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Core'&semVerLevel=2.0.0'.

1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'SnapObjects.Data.SqlServer' from remote source 'https://www.nuget.org/FindPackagesById()?id='SnapObjects.Data.SqlServer'&semVerLevel=2.0.0'.

1> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs\ServerAPIs.csproj(1,1): Error NU1301: Failed to retrieve information about 'AspNetCoreRateLimit' from remote source 'https://www.nuget.org/FindPackagesById()?id='AspNetCoreRateLimit'&semVerLevel=2.0.0'.

2> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\AppModels\AppModels.csproj(1,1): Error NU1301: Failed to retrieve information about 'PowerServer.Core' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Core'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'Microsoft.AspNetCore.TestHost' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.AspNetCore.TestHost'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'Microsoft.Extensions.Logging.Log4Net.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.Extensions.Logging.Log4Net.AspNetCore'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'xunit.runner.visualstudio' from remote source 'https://www.nuget.org/FindPackagesById()?id='xunit.runner.visualstudio'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'Microsoft.ApplicationInsights.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.ApplicationInsights.AspNetCore'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'PowerServer.Api' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Api'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'Swashbuckle.AspNetCore' from remote source 'https://www.nuget.org/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'PowerServer.Core' from remote source 'https://www.nuget.org/FindPackagesById()?id='PowerServer.Core'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'xunit' from remote source 'https://www.nuget.org/FindPackagesById()?id='xunit'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'SnapObjects.Data.SqlServer' from remote source 'https://www.nuget.org/FindPackagesById()?id='SnapObjects.Data.SqlServer'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'coverlet.collector' from remote source 'https://www.nuget.org/FindPackagesById()?id='coverlet.collector'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'AspNetCoreRateLimit' from remote source 'https://www.nuget.org/FindPackagesById()?id='AspNetCoreRateLimit'&semVerLevel=2.0.0'.

3> C:\Users\dpeace\source\repos\PowerServer_simple_test_cloud\ServerAPIs.Tests\ServerAPIs.Tests.csproj(1,1): Error NU1301: Failed to retrieve information about 'Microsoft.NET.Test.Sdk' from remote source 'https://www.nuget.org/FindPackagesById()?id='Microsoft.NET.Test.Sdk'&semVerLevel=2.0.0'.

  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.