-
Notifications
You must be signed in to change notification settings - Fork 388
Upgrade to version 3.0.0/3.1.0 causes FileNotFoundException (Newtonsoft assembly) #1045
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
Comments
Just to make it clear, downgrading |
I am hitting this too! In my case it manifests like a YamlDotNet problem, but working through all the dependencies I found that it was |
Are you all using collectors? |
Sorry maybe a stupid question but what do you mean by that? I have two nuget packages:
|
can you write your command line? |
So we're using github actions to run unit tests and generate coverage report, this is the part of yaml for pull request checks:
Apart from that we're not executing anything related to code coverage inside the docker. |
ok you're using msbuild integration. Only to understand if it's an issue related to msbuild integration or not. |
I believe the issue is coverlet.collector nuget package doesn't specify dependencies, but still includes Newtonsoft.Json.dll. From the detailed output publish, I see this :
|
@billybraga if you don't publish and run <PackageReference Include="coverlet.collector" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference> |
I don't have the problem with Here is my package reference: <PackageReference Include="coverlet.collector" Version="3.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> (it's what dotnet added automatically after installing coverlet.collector) |
@mdrgeniebelt you're using msbuild integration, can you remove the package reference to |
@MarcoRossignoli looks like removing reference to |
Why the issue is closed? I have the same issue. Steps to reproduce:
|
@billybraga is absolutely right about it. |
This is also happening for us, not sure why issue is closed, we can't just "not use the package" as a solution? |
Still happening |
Reopening because the issue is still present with collector. |
Can someone provide a small repro(with collector usage)? |
@billybraga I saw that you're publishing a project. I expect that you don't reference coverlet collector for a project like all/exe/etc...it should be referenced only for test project and used with |
I updated the repo to remove the coverlet collector from the console project and add a test project with the coverlet collector. The same error occurs when running the published console app. |
@billybraga you should avoid Anyway the issue will be present if you publish test project. Does it work if you simply run |
I solved my problem by adding IsPublishable=false in csproj of test projects (instead of removing the test dlls in CI/CD before building final docker image with dlls). As for running I still think coverlet shouldn't add a Newtonsoft dll directly instead of relying on nuget dependencies, but personally I'm not having problems anymore with that since using IsPublishable=false like stated above. |
I'm working on this issue. Think I already have a hint. |
Hi all! Can someone dogfood this preview version with the fix attempt and tell me if it works? |
I can confirm, the publish now doesn't override P.S.
I obviously don't know the original reasons to use |
Hi,
At first I thought this is APM package that is causing this issue but after upgrading/downgrading different packages for a day I found out that it is coverlet.collector that is causing it. The issue only shows up in docker container though, we're using
mcr.microsoft.com/dotnet/sdk:5.0-alpine
image.More details here:
elastic/apm-agent-dotnet#1117
The text was updated successfully, but these errors were encountered: