-
Notifications
You must be signed in to change notification settings - Fork 13
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
The "BlazorWasmAntivirusProtection.Tasks.CleanOldDlls" task could not be loaded #36
Comments
Version 2.0 depends on .net 7.0 |
I created a new project, tried both 1.9 and 1.8, and in both times I got this error during Publish: The "BlazorWasmAntivirusProtection.Tasks.CleanOldDlls" task could not be loaded from the assembly C:\Users\user\.nuget\packages\blazorwasmantivirusprotection\1.8.5\build\net6.0....\tasks\BlazorWasmAntivirusProtection.Tasks.dll. Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask |
I tried updating to 2.0.0 on my .Net 7 project and am also getting this error on publish, except it says System.Runtime, Version=7.0.0.0. No issues on 1.8.5.
|
@stavroskasidis , I'm also facing the same error. C:\Users\xxxx.nuget\packages\blazorwasmantivirusprotection\2.0.0\build\net6.0\BlazorWasmAntivirusProtection.targets(19,3): Error MSB4062: The "BlazorWasmAntivirusProtection.Tasks.CleanOldDlls" task could not be loaded from the assembly C:\Users\xxxx.nuget\packages\blazorwasmantivirusprotection\2.0.0\build\net6.0....\tasks\BlazorWasmAntivirusProtection.Tasks.dll. Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. |
Thank you for your feedback. I think I see the issue. I will fix it asap and post a new version |
Hi, I still have the same error with the 2.1 version on dotnet 7. Do i need to do something ? |
Yes same issue exists with 2.1 version on .net 7 - Sample Repo |
I can't reproduce it. I have tried the sample repo you provided, in multiple PCs, everything works. I even tried a clean PC with only sdk 7.0 installed. What does your |
@stavroskasidis , Here is my
|
Out of curiosity, I ran "dotnet publish" from the command line and it seems like it works, the bug happens if I attempt to publish (even just direct-to-folder) from Visual Studio 2022 though. I haven't tried to migrate to the new container publishing stuff from .Net 7, so at the moment I publish to docker through VS and Docker Desktop. Wonder if it's a VS bug trying to find the runtime? I don't even technically have the .Net 7 SDK installed standalone, just as part of the Visual Studio install process. |
@Xeio the sample repo I provided above tries to run |
I'm very sorry, it is my fault! The error was caused by pull request #32 from me. Hi @stavroskasidis , could you take a look at a new pull request #39 to recover from this problem? |
@jsakamoto Thank you for finding this. I went a different approach from your PR, I used Brotli.NET which works in .netstandard2.0, a simpler change. Everyone try using v2.2.1, these issues should now be fixed. |
Oh, I took my mistake again, I failed update my development environment to track your latest achievement. |
I noticed there is the message below from @fingers10 :
The problem above is caused by the "BlazorWasmPreRendering.Build" NuGet package, not from your package. So it is good to close this issue with the resolved status. |
Yeah also this works when published from command line but fails with visual studio publish |
On my environment, your project is failed with the latest version 2.2.1, regardless of whether command line or Visual Studio. Moreover, the error message tells me the reason for the error is in the "BlazorWasmPreRendering.Build". So please don't post about it to this issue thread anymore. Instead, please post about it to the issue thread of the "BlazorWasmPreRendering.Build" (Issue 22). |
Just confirming that 2.2.1 seems to work for me now as far as the issue in the OP (CleanOldDlls task). |
@stavroskasidis for some reason the publish fails in github actions deploy. Here is the link. Error:
Logs:
Please refer issue for more details. |
@jsakamoto Turns out your implementation of packaging a BrotliCompress tool as a console app is a better implementation, because Brotli.NET uses native dependencies that may not be there (e.g. Docker container, github actions agent). I am releasing a new version (2.3) that includes your code from the pull request you submited earlier. @fingers10 Please try version |
Closing as it should be fixed with 2.3.0. Please reopen if you still have an issue. |
Environment:
To reproduce:
Ran into this error:
Error The "BlazorWasmAntivirusProtection.Tasks.CleanOldDlls" task could not be loaded from the assembly C:\Users\me\.nuget\packages\blazorwasmantivirusprotection\2.0.0\build\net6.0....\tasks\BlazorWasmAntivirusProtection.Tasks.dll. Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
With my other existing project the error is a little different, marked in bold:
Error The "BlazorWasmAntivirusProtection.Tasks.ObfuscateDlls" task could not be loaded from the assembly C:\Users\me\.nuget\packages\blazorwasmantivirusprotection\1.9.0\build\net6.0....\tasks\BlazorWasmAntivirusProtection.Tasks.dll. Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
I deleted the these folders
and then ran a
dotnet restore
, but it doesn't fix it.The text was updated successfully, but these errors were encountered: