I'm trying the new feature 'PublishSingleFile=true for .NET', and when publishing I get the following error message:
Can't resolve assembly: CommunityToolkit.Mvvm, Version=8.2.0.0.
I did the following research:
1. If I do not use mvvm mode (do not use CommunityToolkit.Mvvm), the program can be released normally and protected.
2. Other dll files can be packaged into the program normally, but only CommunityToolkit.Mvvm cannot be packaged.
3. CommunityToolkit.Mvvm is installed using NuGet and used normally.
4. If I don’t use the code provided in the post for protection, it can be published and run normally.
So I'm not sure, if the problem comes from CommunityToolkit.Mvvm, or because vmp doesn't support MVVM at the moment.
In my understanding, the code used in 'PublishSingleFile=true for .NET' only protects the project's dll with the same name before publishing, and does not participate in the packaging process. The packaging process is completed by VS. I don't know if my understanding is correct.
I made a test project, please check it out, thank you.
Can't resolve assembly: CommunityToolkit.Mvvm, Version=8.2.0.0
Can't resolve assembly: CommunityToolkit.Mvvm, Version=8.2.0.0
- Attachments
-
- MVVM.zip
- (1.17 MiB) Downloaded 173 times
Re: Can't resolve assembly: CommunityToolkit.Mvvm, Version=8.2.0.0
Just copy required DLLs to "obj\Release\net8.0-windows"