让VS2019支持.NET Core WinForms和WPF设计器的临时办法(转)

.net core 3.0 Preview 6,vs2019 16.1.4 暂时还不支持Winform designer 

让VS2019支持.NET Core WinForms和WPF设计器的临时办法(转)_第1张图片

 

解决方案:

 将Form1修改为其他名字

让VS2019支持.NET Core WinForms和WPF设计器的临时办法(转)_第2张图片

让VS2019支持.NET Core WinForms和WPF设计器的临时办法(转)_第3张图片

 让VS2019支持.NET Core WinForms和WPF设计器的临时办法(转)_第4张图片

 

WinForm   编辑项目文件  加入 TargetFrameworks   使其支持net472;

"Microsoft.NET.Sdk.WindowsDesktop">

  
    WinExe
    net472;netcoreapp3.0
    true
    7.3
  
  " '$(TargetFramework)' == 'net472' ">
    "System" />
    "System.Core" />
    "System.Xml.Linq" />
    "System.Data.DataSetExtensions" />
    "Microsoft.CSharp" />
    "System.Data" />
    "System.Deployment" />
    "System.Drawing" />
    "System.Net.Http" />
    "System.Windows.Forms" />
    "System.Xml" />
  
  " '$(TargetFramework)' == 'net472' ">
    
    "Form1.cs">
      Form
    
  

 

现在已经支持WPF的设计器了   以下参考

WPF

"Microsoft.NET.Sdk.WindowsDesktop">

  
    WinExe
    net472;netcoreapp3.0
    true
  
  " '$(TargetFramework)' == 'net472' ">
    "System" />
    "System.Data" />
    "System.Xml" />
    "Microsoft.CSharp" />
    "System.Core" />
    "System.Xml.Linq" />
    "System.Data.DataSetExtensions" />
    "System.Net.Http" />
    "System.Xaml">
      4.0
    
    "WindowsBase" />
    "PresentationCore" />
    "PresentationFramework" />
  
  " '$(TargetFramework)' == 'net472' ">
    
    "App.xaml.cs">
      App.xaml
      Code
    
    "MainWindow.xaml.cs">
      MainWindow.xaml
      Code
    
  

 

转载于:https://www.cnblogs.com/LiChen19951127/p/11090388.html

你可能感兴趣的:(让VS2019支持.NET Core WinForms和WPF设计器的临时办法(转))