Wpf: .NET Core 3.0 has no SplashScreen Build Action.

Created on 29 Jan 2019  路  16Comments  路  Source: dotnet/wpf

In .NET Framework 4.7.2 with Visual Studio 2019 Preview 2. There is SplashScreen Build Action of image file. But, .NET Core 3.0 doesn't have SplashScreen Build Action.

If I type manually "SplashScreen", It shows an error. (SplashScreen is not supporting). Built-in SplashScreen is no more supported? Or, Work-in Progress?

issue-type-bug rank20 regression

Most helpful comment

That's a good build action for apps that run with slow startup and I hope it been supported in .NET Core 3.
Actually, a more extensible splash screen such as loading from an external file may be more usable and .NET Framework 4.7.2 doesn't have it.

All 16 comments

That's a good build action for apps that run with slow startup and I hope it been supported in .NET Core 3.
Actually, a more extensible splash screen such as loading from an external file may be more usable and .NET Framework 4.7.2 doesn't have it.

Maybe some developers will use multi-thread UI to show the splash screen when they can not find the default build action. And some of the developers will find the UI thread crash see https://github.com/dotnet/wpf/issues/297

Yeah, We can make a custom splash screen using new thread and window. But, in .NET Framework, there was SplashScreen build action (like Resource, Embedded Resource, etc.). If I add an image file to project and set SplashScreen, the image shows when application is starting without any source code. It has a limitation such as no animated image (gif, apng, etc.) but so simple to use.

This is not related to .NET Core 3 or .NET Framework, it's old/classic .csproj format vs. new SDK styled .csproj format. If you create for example an SDK styled WPF project that targets .NET Framework 4.7.2., you have the same problem that the Splashscreen Build Action is not there.

Here's the official documentation for this feature / Build Action:
https://docs.microsoft.com/en-us/dotnet/framework/wpf/app-development/how-to-add-a-splash-screen-to-a-wpf-application

Note:
This issue is related to
https://github.com/dotnet/project-system/issues/2160
and @onovotny mentioned it already here:
https://github.com/onovotny/MSBuildSdkExtras/issues/91

Is there a way to make WPF default SplashScreen in new SDK styled csproj format? or was it deprecated?

What I see is this entry in the Microsoft.WinFX.targets file:

  <Target Name="SplashScreenValidation" Condition="'@(SplashScreen)' != ''" >
    <Error Condition="'$(TargetFrameworkVersion)' == 'v3.0'" Text="The SplashScreen Build Action is not supported in the selected Target Framework." />
  </Target>

That means it's not supported right now.

Oh, it seems that SplashScreen is not supported explictly.

I'm closing this issue since it's external to this repo

@stevenbrix where should we create a follow-up issue to support WPF SplashScreen build targets? Do you have a separate repo for a WPF msbuild SDK/tooling? As far as I know SplashScreen is specific to WPF.

@miguep can you log an issue with the right team? Thanks

Thanks!

@grubioe this is the right repo for this issue. The code for this lives in winfx.targets.

talked to @rladuca about this already.

Yes, the check that disables this in winfx.targets is an old check intended to block .NET Framework 3.0. It unintentionally blocks .NET Core as well since it pivots on "v3.0".

We just need to update this to ensure that we predicate the check on not being in Core and all should be well.

Assigning to @vatsan-madhavan as per offline conversation.

Cool, thanks @rladuca .

For all others: If you're waiting like me for this feature, you can use as a workaround WPF's SplashScreen class in the App's Startup event to show a splash. I just did this in a WPF app I've migrated:

public partial class App : Application
  {
    protected override void OnStartup(StartupEventArgs e)
    {
      var splash = new SplashScreen("Images/FriendStorageSplash.png");
      splash.Show(true, true);

      base.OnStartup(e);
    }
  }
Was this page helpful?
0 / 5 - 0 ratings