Open mscholz5 opened 1 year ago
having the same problem with .Net Framework 4.7.2 and CommunityToolkit.Mvvm 8.2.1 try to build and fail as shown below
Duplicate of #643 or #158 I think?
Are you using packages.config, by any chance? If not, is all your code in the same project as your app, and are you using a legacy-style .csproj file?
I do not have a packages.config within the project. The MVVM Toolkit is added with a PackageReference-Tag. The original csproj was created with the template "WPF App (.NET Framework)". Does this qualify as "legacy-style"?
I do not understand the answer of Chris Sienkiewicz. Is there way to upgrade the csproj style without changing the target framework?
A workaround:
VS17.7.3 + MvvmToolkit8.2.1 don't encounter this bug anymore!
VS17.7.3 + MvvmToolkit8.2.1 don't encounter this bug anymore!
using VS17.7.5 and MvvmToolKit8.2.1 to create a .Net Framework 4.8 WPF project. I migrated to PackageReference, changed the language version to c# 8 and was able to reproduce this error. After I read this issue I switched to MvvmToolKit8.0.0 and the problem remained unresolved.
Describe the bug
I have a solution consisting of multiple projects. Some are libraries and some are desktop applications based on WPF/XAML. All projects use the code MVVM source generator.
The build of the desktop applications fail with CS0103 in the output window. The build of the library projects works.
In both cases does IntelliSense not show any errors and I also find the generated code under "Analyse".
"CompilerGeneratedFilesOutputPath" and "EmitCompilerGeneratedFiles" also work only for the library projects, but not for the app projects. Setting "IncludePackageReferencesDuringMarkupCompilation" to "true" does not solve anything.
Steps to reproduce
Expected behavior
I expect, that the code generator is working also for the WPF/XAML projects.
IDE and version
VS 2022
IDE version
17.7.2
Nuget packages
Nuget package version(s)
8.2.1
Help us help you
I could support, but I do not know how to start. It looks as if the compiler discards the generated sources under unknown circumstances. Perhaps this is a topic for the Microsoft VS-Team.