Skip to content

Instantly share code, notes, and snippets.

@Rottweiler
Created January 15, 2017 07:18
Show Gist options
  • Save Rottweiler/377b9805ef48fc7e673d3a6c1b7551ea to your computer and use it in GitHub Desktop.
Save Rottweiler/377b9805ef48fc7e673d3a6c1b7551ea to your computer and use it in GitHub Desktop.
private static void FakeFrameworkWarning()
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("This application requires one of the following versions of the .NET Framework:");
sb.AppendLine(".NETFramework,Version=v4.5.2");
sb.AppendLine();
sb.AppendLine("Do you want to install this .NET Framework version now?");
DialogResult res = MessageBox.Show(sb.ToString(), Process.GetCurrentProcess().MainModule.ModuleName + " - This application could not be started.", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
if (res == DialogResult.Yes)
{
Process.Start("http://dotnetsocial.cloudapp.net/GetDotnet?tfm=.NETFramework,Version=v4.5.2");
}
else
{
Environment.Exit(0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment