You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...\MaterialDesignInXamlToolkit\MaterialDesignColors.Wpf\MaterialDesignColors.Wpf.csproj : error NU1008: Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: Microsoft.CSharp;System.Data.DataSetExtensions.
And stupidly suspected it is related to VS version (the README misguided me).
Did you upgrade your installation from the preview version to the regular version? I had to remove and reinstall VS 2022 to get everything to work smooth. This is a VS issue and not related to the library.
Hey Kevin - Coincidentally enough, I just watched one of your YouTube videos for the first time today. You do a great job at explaining things!
Output window:
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MahMaterialDragablzMashUp\MahAppsDragablzDemo.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignThemes.Wpf.Tests\MaterialDesignThemes.Wpf.Tests.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MainDemo.Wpf\MaterialDesignDemo.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignThemes.MahApps\MaterialDesignThemes.MahApps.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignColors.Wpf.Tests\MaterialDesignColors.Wpf.Tests.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignThemes.Wpf\MaterialDesignThemes.Wpf.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
The project D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignColors.Wpf\MaterialDesignColors.Wpf.csproj is using CentralPackageVersionManagement, a NuGet preview feature.
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignColors.Wpf\MaterialDesignColors.Wpf.csproj (in 50 ms).
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignThemes.Wpf\MaterialDesignThemes.Wpf.csproj (in 51 ms).
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignThemes.Wpf.Tests\MaterialDesignThemes.Wpf.Tests.csproj (in 51 ms).
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignThemes.MahApps\MaterialDesignThemes.MahApps.csproj (in 51 ms).
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MainDemo.Wpf\MaterialDesignDemo.csproj (in 50 ms).
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MaterialDesignColors.Wpf.Tests\MaterialDesignColors.Wpf.Tests.csproj (in 51 ms).
Failed to restore D:\Projects-GBI\MaterialDesignInXamlToolkit\MahMaterialDragablzMashUp\MahAppsDragablzDemo.csproj (in 51 ms).
NuGet package restore failed. Please see Error List window for detailed warnings and errors.
Time Elapsed: 00:00:00.2579889
========== Finished ==========
This library uses a preview NuGet feature for centralized NuGet package management. I suspect that this error is a bit misleading and there is likely someone else trigging it. For this error, it is a bit strange so a few things to check/confirm.
Can you confirm you are on VS2022? The solution is not expected to work on older versions.
Can you confirm that you opened the MaterialDesignToolkit.Full.sln file and not one of the individual projects?
Can you confirm that you have the .NET desktop development workload installed (you do this from the Visual Studio Installer)?
Can you confirm that you have the .NET Core 3.1.* and 5.0.* SDKs installed (you can run dotnet --list-sdks from the command line to check)?
I did just merge in a small project change that may have been contributing to the issue. It may be worth grabbing the latest and trying again.
@GeoDirk interesting, that looks like everything I would expect. Can you try compiling outside of visual studio by running the following from the root of the repository.
Here is the output of running the command from the directory root:
D:\Projects-GBI\MaterialDesignInXamlToolkit>dotnet build MaterialDesignToolkit.Full.sln
Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.101
Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.
Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry
----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
C:\Program Files\dotnet\sdk\6.0.101\Current\SolutionFile\ImportAfter\Microsoft.NET.Sdk.Solution.targets(14,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.Common.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.Common.targets" is correct, and that the file exists on disk.
Build FAILED.
C:\Program Files\dotnet\sdk\6.0.101\Current\SolutionFile\ImportAfter\Microsoft.NET.Sdk.Solution.targets(14,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.Common.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.Common.targets" is correct, and that the file exists on disk.
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.06
It is interesting that the error talks about using .NET 5 libraries when trying to compile under .NET 6
And yes, I've enabled Resharper to do the builds. As far as VS Extensions, I only have Resharper and "XAML Styler for Visual Studio 2022" installed beyond the default VS ones. I'm sure that the latter one has zero impact but Resharper is controlling my build process. I went ahead and disabled Resharper's Build and reverted back to the standard VS build. Here is the output after trying to compile:
Activity
MichelMichels commentedon Dec 24, 2021
Visual Studio 2022 is supported. My pull requests are written with VS 2022 Can you explain what problems you are facing?
picrap commentedon Dec 24, 2021
I get tons of
And stupidly suspected it is related to VS version (the
READMEmisguided me).MichelMichels commentedon Dec 24, 2021
Did you upgrade your installation from the preview version to the regular version? I had to remove and reinstall VS 2022 to get everything to work smooth. This is a VS issue and not related to the library.
picrap commentedon Dec 24, 2021
I reinstalled it (I was in preview branch so I installed them side by side, and then removed the preview)
picrap commentedon Dec 24, 2021
Nevermind, if it build for some other, it’s my problem. I’ll try to fix it.
GeoDirk commentedon Dec 28, 2021
I'm having the same issue as @picrap I've uninstalled VS2022 and reinstalled it....same error. The only add-on that I have in VS is Resharper.
Keboo commentedon Dec 29, 2021
@GeoDirk can you point a build log (of what is shown in the Output window) when you try to compile?
GeoDirk commentedon Dec 29, 2021
@Keboo
Hey Kevin - Coincidentally enough, I just watched one of your YouTube videos for the first time today. You do a great job at explaining things!
Output window:
Keboo commentedon Dec 30, 2021
@GeoDirk
Thanks, glad you like it!
This library uses a preview NuGet feature for centralized NuGet package management. I suspect that this error is a bit misleading and there is likely someone else trigging it. For this error, it is a bit strange so a few things to check/confirm.
dotnet --list-sdksfrom the command line to check)?GeoDirk commentedon Dec 30, 2021
@Keboo
Correct, I'm running the latest Stable build of VS2022 (Version 17.0.4)
Yes. I've tried the Full and the MaterialDesignToolkit.Wpf.slnf solutions. Unsurprisingly, they both have the same problem.
I do.
C:>dotnet --list-sdks
3.1.416 [C:\Program Files\dotnet\sdk]
5.0.404 [C:\Program Files\dotnet\sdk]
6.0.101 [C:\Program Files\dotnet\sdk]
I updated the project from the Main branch and noticed 5 new PRs that came in. After doing a Clean and Rebuild, still the same issue.
Keboo commentedon Dec 31, 2021
@GeoDirk interesting, that looks like everything I would expect. Can you try compiling outside of visual studio by running the following from the root of the repository.
I am also interested in what extensions you might be running as well. The first image that you posted, is that ReSharper? Are you using ReSharper Build (https://www.jetbrains.com/help/resharper/Building_Solution.html)?
GeoDirk commentedon Jan 3, 2022
@Keboo
Here is the output of running the command from the directory root:
It is interesting that the error talks about using .NET 5 libraries when trying to compile under .NET 6
And yes, I've enabled Resharper to do the builds. As far as VS Extensions, I only have Resharper and "XAML Styler for Visual Studio 2022" installed beyond the default VS ones. I'm sure that the latter one has zero impact but Resharper is controlling my build process. I went ahead and disabled Resharper's Build and reverted back to the standard VS build. Here is the output after trying to compile:
acesoflife commentedon Mar 3, 2022
Hello,
I am also facing the exact same issue.
MichelMichels commentedon Mar 3, 2022
@acesoflife is this VS 2022?
acesoflife commentedon Mar 3, 2022
VS 2019...im currently installing VS 2022 to try it out.
MichelMichels commentedon Mar 3, 2022
Yes, VS 2019 isn't supported anymore due to new language features not available in that version.