msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

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

Open mediabuff opened this issue 4 years ago • 3 comments

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.

mediabuff avatar Jan 14 '21 14:01 mediabuff

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.

benvillalobos avatar Feb 10 '21 16:02 benvillalobos

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

eriawan avatar Jun 10 '21 20:06 eriawan

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>

fearthecowboy avatar May 04 '22 17:05 fearthecowboy