I have a setup project to install a Windows Forms application. When I build this setup project, I get a warning that says:
WARNING: The version of the .NET Framework launch condition '.NET Framework 3.5' does not match the selected .NET Framework bootstrapper package. Update the .NET Framework launch condition to match the version of the .NET Framework selected in the Prerequisites Dialog Box.
I can see in the launch conditions window that .Net Framework 3.5 is selected
Then when I go see the prerequisites window Net Framework 3.5 SP1 is selected.
What can I do to get ride of this message, the launch window dropdown does not contain 3.5 SP1 and the prerequisites window list does not contain 3.5 without sp1?
Thanks to you all!
A solution is to create a custom prerequisite for .NET Framework 3.5. Visual Studio setup projects do not support custom prerequisite creation. However, it can be done by manually generating the required manifests.
You can find the manifests structure here: http://msdn.microsoft.com/en-us/library/ms229223(VS.80).aspx
These manifests can be generated automatically with the Bootstrapper Manifest Generator tool.
After generating the package manifests, you can add all these files (including the package) in a separate folder in the Visual Studio prerequisites folder, for example:
C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages
You can then select the custom prerequisite in your setup project Properties page.
Another solution would be to remove the launch condition completely and use just the prerequisite.
Related
I am trying to build MSIX setup for my WinForms application built on .net6. I want to give auto-update feature when the user clicks the "Update" button. I think originally developer didn't have control over updating MSIX and there was only way it was updated automatically when the application is restarted.
But there is a recent article on taking full control over MSIX updates I tried to follow it but I am facing the exception 'System.InvalidOperationException' while running the below line of code.
Package package = Package.Current;
I am using visual studio 2022 & WinForms application running on .net 6. I have kept other configurations as described in the above article but it is not working as expected. (I have tried in .net core 3.1 and it is working with it)
Package.Current only works in a packaged context, so you need to make sure to actually debug/launch the packaging project. An InvalidOperationException indicates that you are running your project unpackaged.
Make sure to select "Set as Startup Project" on the packaging project, likely named "MyApp (Packaging)" in the Solution Explorer. Then you can launch/debug your project as you normally do.
I have a WPF using .net core 5, I want to create an installer with "Visual Studio Installer Projects".
I followed the usual steps and install the created installer on my machine.
The problem is when I want to run the app from the shortcut on my desktop, I get always this error message :
The message box will close and nothing happen whether I click 'yes' or 'no'.
Any idea what can cause this problem ?
You have to add the prerequisites. In your case the correct .NET Version.
If you would like your installer to be able to install the necessary runtime for a framework-dependent .NET Core 3.1 app, you can do this using prerequisites. From the properties dialog of your installer project, open the Prerequisites... dialog and you'll see the following entries:
The .NET Core Runtime... option should be selected for console applications, .NET Desktop Runtime... should be selected for WPF/WinForms applications.
I installed Visual Studio 2019 GA Released version today.
I installed this template https://github.com/Dotnet-Boxed/Templates via dotnet new command line
I then can use the dotnet new to create a project from command line.
However, the installed template does not show in this windows in Visual Studio 2019.
What the point of putting the link to install a new template from CLI but not listing new installed template in the UI?
Is this a bug or actually a missing feature?
https://devblogs.microsoft.com/dotnet/net-cli-templates-in-visual-studio/
in this post you can see how to enable .net core cli project templates in VS2019
Starting in Visual Studio 16.8 Preview 2 we’ve enabled a preview feature that you can turn on that enables all templates that are installed via CLI to now show as options in Visual Studio as well. To enable this option visit the Preview Features options in the Tools…Options menu and look for the “Show all .NET Core templates in the New Project dialog” (we’re awesome at naming) checkbox and check it:
After enabling you need to restart the Visual Studio instance to get this capability. After restarting and choosing to create a new project you’ll see some slight differences in the experience.
This is a missing feature that is still being actively planned and developed. Look for it sometime in the .NET Core 3 timeframe.
Section Controls, NuGet Packages, and Existing Assembly References of .NET Core 3 release notes on Support for Windows Desktop Applications states the following:
Desktop applications often have many dependencies, maybe from a
control vendor, from NuGet or binaries that don’t have source any
more. It’s not like all of that can be updated to .NET Core 3 quickly
or maybe not even at all.
As stated above, we intend to support dependencies as-is. If you are
at the Build conference, you will see Scott Hunter demo a .NET Core 3
desktop application that uses an existing 3rd-party control. We will
continue testing scenarios like that to validate .NET Core 3
compatibility.
I created a WPF application targeting .NET Core 3 in VS 2019 using dotnet new wpf command, and it works fine.
However, when I add a 3rd party WPF control from NuGet (control was built targeting .NET Framework 4.6.1) I get the following error message:
Warning NU1701 Package 'Syncfusion.Shared.WPF 16.4.0.52' was restored
using '.NETFramework,Version=v4.6.1' instead of the project target
framework '.NETCoreApp,Version=v3.0'. This package may not be fully
compatible with your project.
The application still builds successfully but when I attempt to run the application public MainWindow() throws :
System.Windows.Markup.XamlParseException: ''The invocation of the
constructor on type 'Syncfusion.Windows.Tools.Controls.GroupBar' that
matches the specified binding constraints threw an exception.' Line
number '16' and line position '10'.'
Was anyone able to add a reference to a 3rd party WPF control to a WPF application targeting .NET Core 3 and if so what is the trick?
Hello, I need to publish my application with .NET Framework 4.0 (for windows XP support) but when trying to add it to the prerequisites it is missing. What can i do?
i used the old, free "Bootstrap Manifest Generator" tool, which is a bit hard to find nowadays. My steps were as follows:
I downloaded the .NET Framework 4.0 redistributable package: https://www.microsoft.com/en-za/download/confirmation.aspx?id=17718
To get the package to appear in the "Prerequisites" dialog box, i downloaded the "Bootstrap Manifest Generator" tool from SoftPedia (http://www.softpedia.com/get/Programming/Other-Programming-Files/Bootstrapper-Manifest-Generator.shtml). I scanned my download with McAfee and it was safe.
I installed the package and ran it. The series of images below illustrate the options that i selected on the tool:
Select "New Project" and then the "Package Manifest" option
- Fill-in the Project Name and Project Code, and then click the first icon above the white panel labeled "Package"
- Browse to the redistributable package
Enter the "Display Name" and then click the second icon above the white panel. The output folder will be highlighted in blue.
Move the containing folder (navigate one level up to copy the "DotNETFX40" folder) to the location shown below (Note, i'm using VS2017 Community on Windows 10):
In my WPF application, in the "Prerequisites" dialog, i now see the DotNETFX40 folder, as highlighted below.
Now when i publish the application, the DotNETFX40 folder is published as well:
I think you will have to use Visual Studio 2015 to be able to select .NET Framework 4.0 as a prerequisite.
The official support for .NET Framework 4 has ended: https://blogs.msdn.microsoft.com/dotnet/2015/12/09/support-ending-for-the-net-framework-4-4-5-and-4-5-1/