leocb / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
438 stars 132 forks source link

Designer problem when referencing existing MaterialSkinCore multiple time #268

Closed valimaties closed 2 years ago

valimaties commented 2 years ago

I have installed the latest VS 2022 Preview 7 on my PC. (Edit: same error on VS 2019, too) I've tried to open a form from my project in Designer. But designer shows me this error.

DesignerError

Form1 code: Form1Initialization

valimaties commented 2 years ago

Solved using solution from stackoverflow.com.

We must add <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute> line in a PropertyGroup element of each project file.

full code exemple:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.1</TargetFramework>
    <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
  </PropertyGroup>

</Project>