简体   繁体   中英

How to share .exe file created in Visual Studio 2013 (C#)?

I have done a WPF form in C# and i want to share it with my friends. But when I use the Project/bin/Debug or Project/bin/Release both don't respond so I don't know what to do. What's curious is that on my computer each exe from Debug or Release folder works fine...

Is there a specific way to make an exe?

Thanks in advance

Antoine

The right way to share this app is to build the Setup.exe. Add Visual Studio Installer -> Setup.Project to your solution and create the standardized setup file (typically the installation package to share will contain setup.exe with one .msi file): it will take care of all proper dependencies. Hope this may help.

There is ClickOnce deployment, which is both lean and easy to work with even if you don't have pre-existing installer experience as the in-built tooling will automatically identify dependencies for you, and easily let you adjust what is a dependency, whether or not it is included, and optionally paths for acquisition (when not part of your distribution/installer.) Just as well, .NET apps don't really benefit from the power of full-featured installers (since their dependency graphs are usually restricted to the BCL and/or referenced types which appear in the /bin/ folder, further, this was by design in .NET 1.0).

Similarly, you can ZIP up a Release EXE and all files in the folder to give to someone, they can unpack it anywhere to run it. This was an original tenet of .NET called xcopy deploy , where the need for deployment technologies were identified (15 years ago) as a major hurdle to deployment (both cost and complexity.) Sharing a .NET application should be no more difficult than archiving it and e-mailing it, or making it available for download.

"The .NET Way" is to XCOPY or ClickOnce. "The Windows Way" is to create a " Windows Installer API " compatible package.

ClickOnce technology satisfies the Windows Installer API requirement (which is only a requirement if you're seeking 'Windows Logo approval' for your product, which almost nobody does, but there it is.)

The only purpose for using Windows Installer API is to provide a clean path for user management of installed app (eg to ensure they appear in add/remove, get installed to standard locations with ideal permission sets, etc.)

Lastly, ClickOnce makes it possible to handle "auto-deploy" of new versions. You can achieve this by placing a ClickOnce url on a website you own and your users can install simply by clicking on the link. Once installed each launch of the app will do a version check from that original location, so when you deploy new versions of your app to your website all your users automatically get those updates. This behavior can be configured, but doing something similar with other installer technologies is a pain to say the least.

Hope this helps!

References

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM