question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

.NET Core 3 support request

See original GitHub issue

Description

I would like to use FsXaml with .NET Core 3 .NET Core 3 brings support for WPF, but it doesn’t seem to work with FsXaml

Repro steps

Please provide the steps required to reproduce the problem

Using the latest preview for .NET Core 3 -

  1. Create a new dotnet core 3.0 application with WPF support -

project.fsproj

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

    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>netcoreapp3.0</TargetFramework>
        <RootNamespace>MyNamespace</RootNamespace>
        <UseWPF>true</UseWPF>
    </PropertyGroup>

    <ItemGroup>
        <PackageReference Include="Elmish.WPF" Version="3.1.0"/>
        <PackageReference Include="FsXaml.Wpg" Version="3.1.6"/>
    </ItemGroup>
</Project>
  1. Add a XAML file to the project.

  2. Build the project.

Expected behavior

Project builds and I can start using the Type provider for the XAML file in my code.

Actual behavior

Build outputs an error as follows

C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk.WindowsDesktop\targets\Microsoft.WinFX.targets(243,9): error MC1000: Unknown build error, 'Object reference not set to an instance of an object.'  [C:\Users\dam5s\workspace\epub-desktop\epub-desktop\epub-desktop.fsproj]  

Known workarounds

None that I know of. I’m using a C# project with my XAML files instead.

Related information

  • Windows 10 Pro
  • Latest stable version
  • 3.0.100-preview8-013656

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mattstermillercommented, May 7, 2020

I took the project files and other changes from @amazingant 's repo that he linked above, applied them in a branch on my fork, and worked with it to get as far as I could.

Here is the progress I was able to make:

  • The core projects of this library, FsXaml.Wpf and FsXaml.Wpf.TypeProvider, have the new sdk project file format and target both netcoreapp3.0 and net45. They build and pass tests.
  • The FsXaml.Wpf.Blend project has the new sdk project file format but only targets net45 since its dependency System.Windows.Interactivity.WPF is only compatible with .NET framework. It was last updated in 2013.
  • 3 of the demo projects build with Visual Studio 2019 and run. 1 more builds but crashes on startup with a XamlParseException. The other 2 fail to build with “The provided method is marked as an abstract method; therefore, it should not define an implementation” and “Cannot inherit a sealed type” errors. I don’t know how to fix these since the TypeProviders SDK seems to have changed quite a bit since the last release of FsXaml and I don’t know if there were fundamental design changes regarding generating sealed vs. abstract types.

I need guidance on how to fix the demo apps or possibly the library to get this working.

Also, I noticed that the FAKE build script is very out-of-date. I was unable to use it and resorted to using paket, the dotnet SDK, and VS (and for building the demo projects, manually copying the library DLLs to the bin folder).

0reactions
xp44mmcommented, Jan 28, 2023

request to support latest version, the fsproj file like this:

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

  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net7.0-windows</TargetFramework>
    <UseWPF>true</UseWPF>
    <UseWindowsForms>False</UseWindowsForms>
  </PropertyGroup>

  <ItemGroup>
    <Resource Include="FirstMetroWindow.xaml" />
    <Resource Include="App.xaml" />
    <Compile Include="FirstMetroWindow.fs" />
    <Compile Include="App.fs" />
  </ItemGroup>


  <ItemGroup>
    <PackageReference Include="FsXaml.Wpf" Version="3.1.6" />
    <PackageReference Include="MahApps.Metro" Version="2.4.9" />
    <PackageReference Include="System.Reactive" Version="5.0.0" />
  </ItemGroup>

</Project>

Read more comments on GitHub >

github_iconTop Results From Across the Web

.NET and .NET Core official support policy
The only difference is the length of support. LTS releases get free support and patches for 3 years. STS releases get free support...
Read more >
.NET Core 3.1 will reach End of Support on December 13, ...
.NET Core 3.1 will reach end of support on December 13, 2022. After that date, Microsoft will no longer provide servicing updates or...
Read more >
Microsoft to End Support for .NET Core 3.1 in December 2022
The long-term-support (LTS) version 3.1 of Microsoft .NET Core Framework is slated to go out of support on December 13th, 2022.
Read more >
Microsoft Announces End of Support Date for .NET Core 3.1
NET Core 3.1 will reach [the] end of support on December 13, 2022,” Microsoft's Dominique Whittaker writes. “After that date, Microsoft will no...
Read more >
Net Core Support (Official Response Requested)
Hi,. I know I have asked this before but I'm going to ask again as there has been no official response yet. We...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found