Create installer for WPF core application - wpf

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.

Related

Unable to take control over MSIX updates for .net 6 WinForms application

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.

platform requirement not met error in wpf application

I am getting following error while browsing wpf application from windows 8.Its working in other machines .Do we need to do any configuration changes.
As mentioned here, the problem may happen because the target framework used on the dev machine is not installed on your client machine. Try installing .Net2.0 by clicking "Install .Net Framework" button.

Published application requires visual studio to run

I have developed a WPF application and I need to try it on other computers.
1- I change my project properties to build in release mode and rebuilt project. However, /bin/release folder is empty and it still generates /bin/debug folder.
2- I selected publish and install it on other computers. Funny thing is, the program is not running if that computer does not have Visual C# (.Net Framework, Sql server etc. does not cause a problem)
3- I added a installer and add project output(release) to this application. It says /bin/release/abc.exe couldn't be find.. Changed it to project output(debug) and it builds fine. However, this setup is not even working on my computer..
So my question is simple... How can I publish WPF application in release mode and how can I run them on other computers without installing Visual C#. Thank you in advance
Check properties of your project, and set output folder for Release configuration.
You need .NET 4 framework installed on PC, to run (simple) WPF application.
Should work, when you set your output folder, see 1.

.Net Setup project warning

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.

Setup project for wpf application

I am trying to build a setup-msi using visual studio for my wpf application.
The issue i am facing is that i force primary output from wpf project to the setup project
and the dependencies are calcaluted automatically.
I run the msi locally (on the machine i built the wpf app) and everything works fine.
The problems start when i try to install it on different machines.
On other machines i run the installation process and it finishes justfine
but when i try to run the application i get exceptions about assemblies that could not be found.(e.g System.Web , Version=4,0,0,0 could not be found etc)
I really suck building setup projects but can anybody give a hand?
P.S.: I also tried installShield... same results.
I would guess that the target machine only had .NET Framework 4.0 Client Profile installed. System.Web is in .NET Framework 4.0 Extended, which is installed with the full 4.0 Framework but not with the Client Profile.
Are you bootstrapping .NET 4 in your setup?
Check for the presence of "Microsoft .NET Framework 4 Client Profile" and "Microsoft .NET Framework 4 Extended" in Add/Remove Programs (XP) or Programs and Features (Vista/7) on the machines where the application ran fine and those where it gave that error.
Edit: .NET Framework Deployment Guide for Developers. That should help you figure out how best to deploy it.

Resources