Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core 3.0 has no SplashScreen Build Action. #299

Closed
pcfulife opened this issue Jan 29, 2019 · 16 comments · Fixed by #1276
Closed

.NET Core 3.0 has no SplashScreen Build Action. #299

pcfulife opened this issue Jan 29, 2019 · 16 comments · Fixed by #1276
Assignees
Labels
Bug Product bug (most likely) rank20 Rank: Priority/rank on a scale of (1..100) regression status: This issue is a regression from a previous build or release
Milestone

Comments

@pcfulife
Copy link

pcfulife commented Jan 29, 2019

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?

@walterlv
Copy link
Contributor

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.

@lindexi
Copy link
Member

lindexi commented Jan 30, 2019

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 #297

@pcfulife
Copy link
Author

pcfulife commented Jan 30, 2019

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.

@thomasclaudiushuber
Copy link
Contributor

thomasclaudiushuber commented Jan 30, 2019

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
dotnet/project-system#2160
and @onovotny mentioned it already here:
novotnyllc/MSBuildSdkExtras#91

@pcfulife
Copy link
Author

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

@thomasclaudiushuber
Copy link
Contributor

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.

@pcfulife
Copy link
Author

pcfulife commented Feb 2, 2019

Oh, it seems that SplashScreen is not supported explictly.

@stevenbrix
Copy link
Contributor

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

@weltkante
Copy link

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

@grubioe grubioe reopened this Jun 21, 2019
@grubioe grubioe added this to the 3.0 milestone Jun 21, 2019
@grubioe
Copy link
Contributor

grubioe commented Jun 21, 2019

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

@miguep
Copy link
Contributor

miguep commented Jun 21, 2019

I logged this issue:
dotnet/msbuild#4462

@grubioe
Copy link
Contributor

grubioe commented Jun 21, 2019

Thanks!

@livarcocc
Copy link

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

talked to @rladuca about this already.

@rladuca
Copy link
Member

rladuca commented Jun 24, 2019

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.

@rladuca rladuca assigned vatsan-madhavan and unassigned miguep Jun 24, 2019
@rladuca rladuca added Bug Product bug (most likely) area-infrastructure labels Jun 24, 2019
@rladuca
Copy link
Member

rladuca commented Jun 24, 2019

Assigning to @vatsan-madhavan as per offline conversation.

@vatsan-madhavan vatsan-madhavan added regression status: This issue is a regression from a previous build or release and removed area-infrastructure labels Jul 2, 2019
@thomasclaudiushuber
Copy link
Contributor

thomasclaudiushuber commented Jul 15, 2019

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);
    }
  }

vatsan-madhavan added a commit that referenced this issue Jul 15, 2019
WinFX.targets has a condition for preventing SplashScreen build-action from running on .NET Framework 3.0 - which is specified overly broadly.

Rewriting this condition to be more specific fixes the problem and brings the SplashScreen build action back to .NET Core 3.0.
@grubioe grubioe added the rank20 Rank: Priority/rank on a scale of (1..100) label Jul 16, 2019
vatsan-madhavan added a commit that referenced this issue Jul 16, 2019
* Fixes #299: .NET Core 3.0 has no SplashScreen Build Action.

WinFX.targets has a condition for preventing SplashScreen build-action from running on .NET Framework 3.0 - which is specified overly broadly.

Rewriting this condition to be more specific fixes the problem and brings the SplashScreen build action back to .NET Core 3.0.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Product bug (most likely) rank20 Rank: Priority/rank on a scale of (1..100) regression status: This issue is a regression from a previous build or release
Projects
None yet
Development

Successfully merging a pull request may close this issue.