waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.76k stars 106 forks source link

(NU1101) Unable to find package Microsoft.SymbolStore. No packages exist with this id in source(s): nuget.org #332

Closed theXappy closed 6 months ago

theXappy commented 6 months ago

Version

main

What happened?

Compiling from source fails on default installations of Visual Studio (2022, but I guess all version) with this cryptic message:

Unable to find package Microsoft.SymbolStore. No packages exist with this id in source(s): nuget.org

image

Took me quite some time to figure out this package isnt' suppoused to be found on nuget.org feed, unlike the rest. I found it's available on a secondary feed hosted by microsoft from this page: https://dev.azure.com/dnceng/public/_artifacts/feed/dotnet-tools/connect The feed is:

https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json

There aren't any other github issues referencing this and it was very frustrating to debug. Can you please add this (unexpected IMHO) step in either the README or as a comment in the csproj, where the nuget package is defined? image

waf commented 6 months ago

Thanks for this. I think this might have to do with the recent package source mappings in visual studio. Building in Visual Studio used to work perfectly, but it also recently broken for me as well. Fixing it by setting up package source mappings here: https://github.com/waf/CSharpRepl/pull/333

waf commented 6 months ago

This should now be resolved, please give it a try.

theXappy commented 6 months ago

Hey @waf Thanks for the quick response but it still shows the same error unless I manually add the aforementioned feed in VS's settings. image

I don't know much about source mapping but I'm not sure it can force the nuget package manager to download packages from sources that weren't manually entered into its preferences. like this: image

theXappy commented 6 months ago

Scratch that. My issue was I added the CSharpRepl.csproj and CSharpRepl.Services.csproj to a different solution without copying the nuget.config file that you defined in this repo. Adding the config to the sln makes everything work.

waf commented 6 months ago

Great, thanks for confirming!