microsoft / vs-dapr

View, manage, and diagnose Dapr services within Visual Studio.
https://dapr.io
MIT License
21 stars 2 forks source link

The 'DaprPackage' package did not load correctly #4

Closed tomasKosar closed 10 months ago

tomasKosar commented 10 months ago

I just want to say that I am excited to start using this extension and I appreciate the hard work on this.

Unfortunately the new Dapr extension is not working for me. It does not work in my existing project with Dapr as well as in new Web API project created from VS template.

I am getting this error message when I try to use the extension. Screenshot 2023-10-24 172152

In the suggested ActivityLog.xml there I see this error:

SetSite failed for package [DaprPackage]Source: 'Dapr.VisualStudio.Package' Description: Could not load type 'System.Reactive.Linq.DispatcherObservable' from assembly 'System.Reactive, Version=6.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. System.TypeLoadException: Could not load type 'System.Reactive.Linq.DispatcherObservable' from assembly 'System.Reactive, Version=6.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263'. at Dapr.VisualStudio.PackageComponents.DaprRunMonitor.<InitializeAsync>d6.MoveNext() at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine) at Dapr.VisualStudio.PackageComponents.DaprRunMonitor.InitializeAsync(DaprPackage package, CancellationToken cancellationToken) at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()&#x000D;&#x000A; at System.Threading.Tasks.Task.WhenAll(IEnumerable1 tasks) at Dapr.VisualStudio.DaprPackage.<InitializePackageComponentsAsync>d18.MoveNext() in D:\a\1\s\src\Dapr.VisualStudio.Package\DaprPackage.cs:line 108 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Dapr.VisualStudio.DaprPackage.<InitializeAsync>d14.MoveNext() in D:\a\1\s\src\Dapr.VisualStudio.Package\DaprPackage.cs:line 76 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.VisualStudio.Shell.AsyncPackage.<>cDisplayClass21_0.<<Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize>b__1>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e) at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)

Based on mention of "System.Reactive, Version=6.0.0.0" then I tried to create new .NET 6 project rather then .NET 7. Now I am not getting any error. But "Dapr" project does not appear in the solution so I am unable to set startup project and run the solution in dapr.

Any help on how to make this work would be appreciated. Thanks.

philliphoff commented 10 months ago

@tomasKosar Apologies for hitting this issue! You're not the only one (though I've yet to reproduce it myself). That said, I believe I understand what the issue is (a conflict between versions of System.Reactive.dll shipped with Visual Studio 17.7) even if I'm not sure yet what an appropriate fix would be.

I suggest you try Visual Studio 17.8 (currently in preview) and let me know if that allows you to move forward. This should install side-by-side an existing Visual Studio installation.

philliphoff commented 10 months ago

It looks like I can't multi-target 17.7 and 17.8 (as the extensibility SDK has breaking changes between them), so I have little choice but to move to 17.8 despite still being in preview itself.

tomasKosar commented 10 months ago

OK Thanks for the explanation.

I have VS preview next to VS as well and I regularly switch between them. I did not have time to try VS preview yesterday. I tried it today and it seems like it works alright. So I will be using VS preview until this extension will be available in standard VS version. Thanks.

philliphoff commented 10 months ago

Glad you're now up and running. Closing as fixed as of v0.1.1024.3.