Executable or dynamic link library? - c#

Why does a very simple C# winform application generate both an .exe and a .dll? I'm using Visual Studio 2022, version 17.3.0.
I expected just an .exe.

Related

Is it possible to create a Windows Service through Visual Studio Code?

In my visual studio code project, I have generated an .exe file for the project and I'm trying create make my .exe as Windows Service.
From here and here, if I'm not mistaken, these solutions look like done by using Visual Studio instead of Visual Studio Code. Is it possible to create a Window Service through Visual Studio Code?
You cant,
Visual Studio Code is a code editor redefined and optimized for
building and debugging modern web and cloud applications. Visual
Studio Code is free and available on your favorite platform - Linux,
Mac OSX, and Windows.
It has no concept of an Windows Service
If you wish to create a Windows service you will have to use Visual Studio or something that can compile standard .net Windows application
Great comment from Ben Voigt
You're correct that Visual Studio Code doesn't have a concept of a
service, but that's because it is an editor not a compiler. The same
C# compiler installed as part of the .NET runtime, can build Windows
Services. And you can edit the windows service code in VS Code

Add own IronPython DLL to Visual Studio

I have created a dll using IronPython.
How can I use the dll in Visual Studio C# ? I have tried to add the dll using AddReference but I couldn't see its contents.

Create a C++/CLI Project in visual studio 2015 with Platform toolset v120 (Visual Studio 2013)

I am using Visual Studio 2015 (Update 3) in Windows 10. I have one c++ project which is written with platform toolset v120. Now I want to use the codes of this project in my C# application. So I decide to create a C++/CLI Project (Class Library) and write a wrapper for the mentioned codes to be able to use them in my C# application. The problem is that when I change the platform toolset of my C++/CLI project to v120, the compiler give me this error:
LNK1104 cannot open file 'MSVCMRTD.lib'
But it works with the default platform toolset (v140). Please be informed that I don't have written any code in my C++/CLI project. I think one of the solutions is to install the whole Visual Studio 2013 besides 2015 version which is not a good solution. (I am not going to even try it). Any solution except installing Visual Studio 2013 would be welcome.
I found the solution and bring it here for further uses. I searched the library in my computer and add it to the "Linker -> General -> Additional Library Directories" in my project's properties.

Convert C# project to .exe (visual studio 2010)

Is it possible to convert visual studio 2010 express project to .exe file? Yes I know that in Projects -> [FileName of the .sln file] -> Bin -> Debug is .exe file. But when I copy it to other directory/ hdd/ usb it do not work. My project includes .mp3 and .wav files.
You cannot just copy the exe. You need to copy all of the dependencies also. If you want to know which explicitly, you could run Fusion Log Viewer to see what is missing.
Use a compiler... like Inno Script Studio (https://www.kymoto.org/products/inno-script-studio). It's free and I've been using it for years. I'm not sure what the express version of Visual Studio has available, but I know the Visual Studio 2012 Professional version has InstallShield LE available which is very easy to use as well.

I am getting an output message when opening .net 4.0 solution file in VS 2010

I am using Visual Studio 2010 sp1
When I am opening .NET 4.0 application in VS 2010, I am getting an Output message as
Loading F:\Projects..\Project.csproj ...
F:\Projects..\Project.csproj : error : The project file 'F:\Projects..\Project.csproj' cannot be opened.
The project type is not supported by this installation.
But I am able to open other projects in the application. They are loaded properly.
Provide me a solution for how to open. Thanks.
Its one of these two:
Your Visual Studio Installation is corrupted (not likely).
The Project was created with a verion of Visual studio that supported more project types and your installation supports less. For example if you create a Sharepoint or a Test Manager Project with Visual Studio Ultimate and you try to open it with Visual Studio Proffesional. (most likely).
Another example would be when you create a Web Project using VS Web Express, and after that you try and open it with VS Express for Windows Phone.

Categories