dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.9k stars 387 forks source link

Error when installing Microsoft.DotNet.Interactive.SqlServer, 1.0.0-beta.22553.7 #2479

Open clumnah opened 1 year ago

clumnah commented 1 year ago

Describe the bug

I have tried this on Windows 11 and MacOS Ventura and the results are similar. I am using a .Net Interactive notebook that i wrote several months ago. I wanted to update it. When I run the initial command of #r "nuget:Microsoft.DotNet.Interactive.SqlServer,*-*" It will fail with the below on MacOS

Error: System.TypeLoadException: Could not load type 'Microsoft.DotNet.Interactive.Commands.SendValue' from assembly 'Microsoft.DotNet.Interactive, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at System.Reflection.Assembly.get_ExportedTypes()
   at Microsoft.DotNet.Interactive.Extensions.AssemblyBasedExtensionLoader.LoadFromAssembly(FileInfo assemblyFile, Kernel kernel, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Extensions\AssemblyBasedExtensionLoader.cs:line 112
   at Microsoft.DotNet.Interactive.Extensions.AssemblyBasedExtensionLoader.LoadFromAssembliesInDirectory(DirectoryInfo directory, Kernel kernel, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Extensions\AssemblyBasedExtensionLoader.cs:line 74
   at Microsoft.DotNet.Interactive.Extensions.AssemblyBasedExtensionLoader.LoadFromDirectoryAsync(DirectoryInfo directory, Kernel kernel, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\Extensions\AssemblyBasedExtensionLoader.cs:line 47
   at Microsoft.DotNet.Interactive.CompositeKernel.LoadExtensionsFromDirectoryAsync(DirectoryInfo directory, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\CompositeKernel.cs:line 308
   at Microsoft.DotNet.Interactive.CompositeKernel.LoadExtensions(KernelCommand command, KernelInvocationContext context, KernelPipelineContinuation next) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\CompositeKernel.cs:line 148
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.<>c__DisplayClass6_0.<<BuildPipeline>g__Combine|2>d.MoveNext() in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 72
--- End of stack trace from previous location ---
   at Microsoft.DotNet.Interactive.KernelCommandPipeline.SendAsync(KernelCommand command, KernelInvocationContext context) in D:\a\_work\1\s\src\Microsoft.DotNet.Interactive\KernelCommandPipeline.cs:line 44

On Windows 11, it will fail with the below

Error: C:\Users\chris.lumnah.perf\.packagemanagement\nuget\Projects\8988--91204698-c34b-4d2f-a863-51ea2ec99ae4\Project.fsproj : error NU1101: Unable to find package Microsoft.DotNet.Interactive.SqlServer. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\6.0.403\FSharp\library-packs

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ):

Screenshots

If applicable, add screenshots to help explain your problem.

jonsequitur commented 1 year ago

Did you clear your NuGet package cache at some point? This looks like a bug that @KevinRansom just fixed and if it is, you can work around it by deleting this folder: C:\Users\chris.lumnah.perf.packagemanagement.

clumnah commented 1 year ago

I deleted the folder you mentioned above but i still received this error. [Error: C:\Users\chris.lumnah.perf\.packagemanagement\nuget\Projects\4360--e6851505-77d6-406a-9244-64529f9c6639\Project.fsproj : error NU1101: Unable to find package Microsoft.DotNet.Interactive.SqlServer. No packages exist with this id in source(s): C:\Program Files\dotnet\sdk\6.0.403\FSharp\library-packs](url)

brettfo commented 1 year ago

It looks like you don't have the main NuGet.org package source enabled. Can you look at %appdata%\NuGet\NuGet.Config? It should look something like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
</configuration>