1

I have created Sales Management System using C# and MS SQL Server 2012. This is working fine. All I want to know in how can I create an exe so that this can be installed in another machine without any .NET Framework.

e.g. it should say like SalesManagementSystem.exe, and I should be able to install it in any machine.

4
  • 3
    You will need the .Net framework installed. There is no getting around that. Unfortunately the Setup and Install project templates were not included in VS2012, MS wanted to decommision them, after much public outrage they were brought back in VS2013. Commented Aug 25, 2017 at 5:35
  • so how to create the exe any idea on that?? Commented Aug 25, 2017 at 5:36
  • Unless it's .NET Core where you can bundle the DLLs with app, then you can't create an executable from .NET code which doesn't require the .NET Framework installed on the machine that will run it. If you really want that, write the app in something like C++ instead. However, newer versions of Windows have certain versions of .NET (and therefore any earlier version too) already installed. So the check the Microsoft Docs for what your target O/S will support. Commented Aug 25, 2017 at 5:37
  • blogs.unity3d.com/2015/05/06/an-introduction-to-ilcpp-internals Commented Nov 15, 2019 at 5:05

3 Answers 3

4

Just download the Setup project templates and create an installer:

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2015InstallerProjects

See my extensive guide here on how to make an Installer (one that upgrades itself as well): Install to same path when upgrading application

Sign up to request clarification or add additional context in comments.

Comments

0

A .Net application will never run without the corresponding framework installed. But depending on the target OS the framework is already installed. Please check the release history at wikipeda. There you can see which .Net version is already installed in which windows version.

If you want to deploy a single executable you have to embed all your depending assemblies into your executable as a resource (plenty of questions and answers are already at SO) and load them by overwriting the AssemblyResolve event.

If you want to create a windows installer take a look at WiX.

Comments

0

You cannot just skip the .NET Framework on the target machine - it is needed to run your program. The exe file, produced by the C# compiler contains MSIL, which is understood by .NET Framework, as opposed by the destination OS - be it Windows or any other.

Having that said, your best bet is to write an installer for your app and distribute the .NET Framework distribute the .NET Framework along with it. When launched, the installer might check what is the installed version of the .NET framework on the target machine (if any) and respond appropriately by installing whatever it is needed for your application.

You can use WiX to author an installers.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.