Skip to content

Support for Visual Studio 2022? #2541

Closed

Description

@picrap

Hi proud people from Xaml world,

How about supporting VS2022?
Currently I need to reinstall VS2019 just to build the project 😱

Thanks.

Activity

  1. MichelMichels commented on Dec 24, 2021

    @MichelMichels
    Member

    Visual Studio 2022 is supported. My pull requests are written with VS 2022 Can you explain what problems you are facing?

  2. picrap commented on Dec 24, 2021

    @picrap
    Author

    I get tons of

    ...\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).

  3. MichelMichels commented on Dec 24, 2021

    @MichelMichels
    Member

    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.

  4. picrap commented on Dec 24, 2021

    @picrap
    Author

    I reinstalled it (I was in preview branch so I installed them side by side, and then removed the preview)

  5. picrap commented on Dec 24, 2021

    @picrap
    Author

    Nevermind, if it build for some other, it’s my problem. I’ll try to fix it.

  6. GeoDirk commented on Dec 28, 2021

    @GeoDirk

    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.

  7. Keboo commented on Dec 29, 2021

    @Keboo
    Member

    @GeoDirk can you point a build log (of what is shown in the Output window) when you try to compile?

  8. GeoDirk commented on Dec 29, 2021

    @GeoDirk

    @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!

    image

    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 ==========
    
    
  9. Keboo commented on Dec 30, 2021

    @Keboo
    Member

    @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.

    1. Can you confirm you are on VS2022? The solution is not expected to work on older versions.
    2. Can you confirm that you opened the MaterialDesignToolkit.Full.sln file and not one of the individual projects?
    3. Can you confirm that you have the .NET desktop development workload installed (you do this from the Visual Studio Installer)?
    4. 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)?
    5. 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.
  10. reopened this on Dec 30, 2021
  11. added
    questionOld items with this tag will be automatically closed.
    on Dec 30, 2021
  12. GeoDirk commented on Dec 30, 2021

    @GeoDirk

    @Keboo

    1. Can you confirm you are on VS2022? The solution is not expected to work on older versions.
    

    Correct, I'm running the latest Stable build of VS2022 (Version 17.0.4)

    2. Can you confirm that you opened the MaterialDesignToolkit.Full.sln file and not one of the individual projects?
    

    Yes. I've tried the Full and the MaterialDesignToolkit.Wpf.slnf solutions. Unsurprisingly, they both have the same problem.

    3. Can you confirm that you have the .NET desktop development workload installed (you do this from the Visual Studio Installer)?
    

    I do.

    4. 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)?
    

    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]

    5. 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.
    

    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.

  13. Keboo commented on Dec 31, 2021

    @Keboo
    Member

    @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.

    dotnet build MaterialDesignToolkit.Full.sln

    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)?

  14. GeoDirk commented on Jan 3, 2022

    @GeoDirk

    @Keboo

    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:

    image

  15. acesoflife commented on Mar 3, 2022

    @acesoflife

    Hello,
    I am also facing the exact same issue.

    Screenshot 2022-03-03 162910

  16. MichelMichels commented on Mar 3, 2022

    @MichelMichels
    Member

    @acesoflife is this VS 2022?

  17. acesoflife commented on Mar 3, 2022

    @acesoflife

    @acesoflife is this VS 2022?

    VS 2019...im currently installing VS 2022 to try it out.

  18. MichelMichels commented on Mar 3, 2022

    @MichelMichels
    Member

    @acesoflife is this VS 2022?

    VS 2019...im currently installing VS 2022 to try it out.

    Yes, VS 2019 isn't supported anymore due to new language features not available in that version.

  19. converted this issue into a discussion #2678 on May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionOld items with this tag will be automatically closed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions