-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not load System.Diagnostics.DiagnosticSource #7889
Comments
Looks like this only occurs on Class Library projects targeting WorkaroundYou can workaround the issue by forcing a runtime config to be generated by the project. This avoids falling back to running on 1.0. To do this, add the following to the project's <PropertyGroup>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup> |
Thanks a lot @bricelam, this workaround fixed the problem I was having with |
It works for me, thanks @bricelam |
Thank you @bricelam. I was about to punch a hole through my computer screen until I found your work around. |
@bricelam please at least you could add some friendly messages to guide user what to do and how to solve it. This exception is very confusing and eat a lot of time. Also why netstandard1.6 doesn't work with migration? |
Thanks @bricelam, it works.... |
Thank you a lot @bricelam it really worked ! |
Note, a fix has been checked into |
It works for me too. Thanks @bricelam !! I have spent a lot time to solve the issue! So, let's go ahead ! |
Using the workaround for now. Thanks! |
It works for me too @bricelam, Thanks! |
Re-opening. We probably need to update the PMC tools too. |
Technically, it's in the 1.0.1 release of dotnet-ef (there is no 1.1.0). |
This patch fix is approved. Please follow the normal code review / pull request process and make sure you make the change in the correct branch. |
Preview builds of this patch fix should be available on the following feeds:
If you have a chance, please try out these preview builds and let us know if you have any feedback! |
Verified fixed in the 1.0.1 candidate build of dotnet-ef. |
I just installed System.Diagnostics.DiagnosticSource and System.Collections.Immutable from the NuGet Package Manager, and everything is working :) |
Any suggestions when calling |
i am using vs 2017. I got same error and fixed with @bricelam replies. Thanks. After adding code below, you should run clean solution and rebuild solution.
|
hmmm. did it for the main program and for my library that uses System.Diagnostics... |
...the myprogram.exe.config still contains
but should that not look like anything 4.3.2 ??? |
This was a great help. Thank you! |
I'm still seeing this issue. My main console app and related data access class library (that contains my DbContext) are both targeting .NET Core 2.0. Nothing I can see references 4.0.2.1. Both projects have 4.4.1 of System.Diagnostics.DiagnosticSource installed, and both have the EDIT: I'm using v2.0.0 of all EntityFrameworkCore packages |
@robinchesterman Have you installed the .NET Core 2.0 SDK? |
@bricelam hello, I met the same issue as @robinchesterman when using EF Core 2.0 with .Net Core 2.0. The problem occurs after I upgraded from 2.0-preview2 to 2.0-rtm. You can reproduce the problem here in my repo: https://github.com/gridsum/DataflowEx/releases/tag/efcore-issue-7889 Just build and run tests which will fail with:
Thanks. |
@karldodd - Your issue is in this file https://github.com/gridsum/DataflowEx/blob/efcore-issue-7889/global.json By using global.json you are forcing VS to use 2.0.0-preview2 .net SDK. Hence you are hitting the issue. Update your global.json (or delete it if 2.0.0 RTM is in your path) to resolve the issue. |
I have this issue only when running tests under JetBrains Rider 2017.2 EAP. |
If I remember correctly, this issue went away when I installed .NET Core SDK 2.0.1 |
@smitpatel Nice catch! It is the global.json issue. The exception is gone after switching global.json to 2.0.0 rtm. Thanks a lot for your help. |
Same problem for me, but with windows service project in a production environmnet. I've posted here: I have a window service project (4.6.1) referencing Net Standard (2.0) projects that contain EntityFrameworkCore dll. EDIT: Solved for me. |
I see this is closed, but wasted hours on the same issue. Fortunately one comment referred to an issue with .Net 4.7.1. They incorporate some types into the main framework not previously there. Those types existed in the source used for latest service bus as of 8/16/2018 so they do not play together nor give a reasonable error to let you know why. I retargeted entire solution to .Net 4.7 and no more error. I almost went down the road of modifying latest version of the service bus interops, but it is bulky and even used some language constructs not supported in the latest released c#. Hopefully, a new service bus comes out at some point -- until then, would avoid 4.7.1 if you need service bus sdk. |
I am seeing a ton of people hitting this when using
netcoreapp1.1
. (See #7869, #7557, #7742, #7358 & #5627) We thought dotnet/corefx#15031 was going to fix it, but there must be another underlying issue somewhere.The text was updated successfully, but these errors were encountered: