dotnet / msbuild

The Microsoft Build Engine (MSBuild) is the build platform for .NET and Visual Studio.
https://docs.microsoft.com/visualstudio/msbuild/msbuild
MIT License
5.21k stars 1.35k forks source link

Microsoft.Build.Framework.XamlTypes not exposed in .net core/net standard 2.0 #6045

Open mediabuff opened 3 years ago

mediabuff commented 3 years ago

Hello, I am trying to used the types defined in Microsoft.Build.Framework.XamlTypes in a .net core or a .net standard 2.0 library. I have add ed a dependency to 'Microsoft.Build.Framework'.

These types are visibile if the consuming library is .net framework.

benvillalobos commented 3 years ago

Team Triage: XamlTypes has not been ported to .net core yet. https://github.com/dotnet/msbuild/blob/6bad8ea6a27fc23621ee8a41fd941dff01976de1/src/Framework/Microsoft.Build.Framework.csproj#L32. We would be open to taking a PR for that 🙂

Note: We don't have context as to why it's specifically not being build for core flavors.

eriawan commented 3 years ago

@BenVillalobos

I would like to work on this issue, but since all of those codes under XamlTypes folder needs WPF references such as System.Windows.Markup, so if we are going to include this into the netcore, we have to add <UseWPF>true</UseWPF> in the project files.

Are you ok with this?

fearthecowboy commented 2 years ago

Given that this would require dependency on WPF and System.Windows - is it feasible to create a Microsoft.Build.Frameworks.XamlTypes assembly?

A quick and dirty csproj file shows that it can build just fine if I take the XamlTypes folder and make a new project.

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

  <PropertyGroup>
    <TargetFramework>net6.0-windows</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <UseWPF>true</UseWPF>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.Build.Framework" Version="17.1.0" />
  </ItemGroup>

</Project>