dotnet / efcore

EF Core is a modern object-database mapper for .NET. It supports LINQ queries, change tracking, updates, and schema migrations.
https://docs.microsoft.com/ef/
MIT License
13.75k stars 3.18k forks source link

Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0 #16948

Closed Parilar closed 2 years ago

Parilar commented 5 years ago

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. Das System kann die angegebene Datei nicht finden.

I got a fresh dll project with Net.Core 2.2 as target. Only using 2 packages : -Microsoft.EntityFrameworkCore -Microsoft.EntityFrameworkCore.Tools

7889 doesnt solved the problem. I dont have app.config.

Any other solutions to fix this problem ?

Parilar commented 5 years ago

My .csproj file :

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.2</TargetFramework>
      <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
      <ApplicationIcon />
      <OutputType>Library</OutputType>
      <StartupObject />

  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.2.6" />
    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="2.2.6">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

    </PackageReference>

  </ItemGroup>

  <ItemGroup>
    <Compile Update="Class1.cs">
      <CopyToOutputDirectory>Never</CopyToOutputDirectory>
    </Compile>
  </ItemGroup>

</Project>
ajcvickers commented 5 years ago

@Parilar There isn't enough information here for me to be able to reproduce what you are seeing. Please post a small, runnable project/solution or complete code listing.

Parilar commented 5 years ago

Attached RPGCore.zip

ajcvickers commented 5 years ago

@Parilar I can build your solution fine, but there's no code to run. How should I reproduce the issue?

Parilar commented 5 years ago

@ajcvickers its an dll, if you import it to a console project it doesnt work

ajcvickers commented 5 years ago

@Parilar Then create a solution that contains both those things together so that I can run it and see the same thing you are seeing.

ajcvickers commented 5 years ago

EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.

BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.