Felix
Felix

Reputation: 10078

How do I create an executable in Visual Studio 2015

In earlier versions of Visual Studio console applications generated an EXE file.Now I see DLL instead. First, is there a way to generate EXE? I need the users to run this executable with parameter: greeting.exe johnny. I tried both in-IDE build and dotnet build.

Second, if this is not possible, what is the way to run the resultant dll from command line with parameter?

UPDATE. I should have mentioned that I selected Console Application (.NET Core). The old-style Console Application still produces executable. I am using .NET Core libraries, and I would prefer to use .NET Core Application. And I can run it from command line dotnet run greeting without parameter (but in any event, I don't think that this is what I expect user to do)!

Upvotes: 2

Views: 14512

Answers (1)

Freddy
Freddy

Reputation: 876

You seem to have picked the wrong project type. The right type is somewhat similar to "Win Console Application". It seems like you selected a (portable) class library.

If you pick the right project type, your exe file will be in the Debug folder of your project once you hit "Run".

Update: Since the question has been updated, an update to my answer:

If you select for example Templates > Visual C# > Windows > Console Application, it will definitely create an exe file. You don't need to select ASP.NET core or anything similar. A simple Visual C# Console application should do the job.

Upvotes: 5

Related Questions