C# Express - Build class project in subfolder - c#

I have a solution in C# Express 2010 which has multiple class libraries in it. When I build my program, the .exe and all of the .dll files are put in the same folder.
Is there any way for me to specify which subfolders I can place the .dll libraries in?
For example, put the main .exe in the root folder and the .dll files in a subfolder called "lib".

You can change your build output for each project. http://msdn.microsoft.com/en-us/library/ms165410.aspx

Related

How do I create an installer for a class library in VS 2013?

I am hoping to get some help to figure out how to create an installer in visual studio 2013.
My class library project generates a DLL called DataTest. The solution also has an xml file called config.xml. Currently when I build the solution the DataTest DLL ends up in the bin folder (and the config.xml is just a static file somewhere). What I want the installer to do is copy/install the DataTest DLL to C:\MyData\Test and the xml file should end up in C:\MyData\Config.
I have found this http://geekswithblogs.net/TarunArora/archive/2014/04/24/visual-studio-2013-installer-projects-ndash-hello-world-installer.aspx which seems like a good place to start but I don't have much experience with the different configurations in VS so I don't really know how to do what I want to do.
Thanks
I'm assuming you want an MSI file to do the install because you posted that link, so you're using the Visual Studio Installer projects extension.
This might also help, old but still applies:
https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/
Configurations in Visual Studio don't really have much to do with this. The Bin, Release, Debug folders in your build are nothing to do with where you want to deploy the file on the target system. For example, if you have a Dll that you want to install in the Common Files Folder then you select that folder in the File System view of the setup project and just drag and drop the file in there. The same principle applies to the Program Files folder, which is the usual place for applications.

Which is the correct .exe file to use for a console application written in C#? Also can you please explain about Build/Release

I have a simple console application written in C#. I want to use its .exe file to run it from SqlServer Agent jon(CmdExec).
I build the application to get the .exe file and now I'm confused about the two folders bin and obj. Both of the folders contain Debug and Release folders and inside there is exe.
Can you advice me, which one is the .exe file I should use for production?
Thanks
You'll want to use the one in the bin folder. Give this a read:
What are the obj and bin folders (created by Visual Studio) used for?
You should use the one in the bin folder.
The obj folder is used to store intermediate files during compilation.

How to export class libraries in Visual Studio 2012

In Eclipse when I implement a class library and I'm ready to deploy, I usually export and package it into a JAR file that later you can just add to the build path in another project. Is there an equivalent feature in Visual Studio? Is there a proper way to "publish" a class library and package it into a dll file to later add as a reference in another project? Or do you just usually go and dig for it in the bin folder yourself?
Most VS projects compile into a DLL. If you want your DLL to be "published" to some particular location when you build, you can use build events which can also package up your dll (you could call a batch script, for example, that takes care of that for you).
Is there a proper way to "publish" a class library and package it into a dll file to later add as a reference in another project? Or do you just usually go and dig for it in the bin folder yourself?
Sure, just add the bin\debug\yourdll.dll or bin\release\yourdll.dll as a reference in your other project, or otherwise to the location you moved it to in your build event. No need to go digging for it every time.
Change the output type to 'release' or 'Debug'.
Go to Build, Build Solution (Or f5)
Navigate to: The Solution Bin folder for release or debug.
3a. You can quickly navigate to the solution folder by right clicking the solution in the
'Solution explorer' and selecting 'Open folder in File Explorer'.
The compiled DLL file will be in that directory. (bin\release or bin\debug)

How can I put files in the user's local application data folder in a setup project?

I'm working with a visual studio 2008 - You get access to a number of special folders to use if you want to include files within. One I don't see on the list is the user's local application data folder. Is there anyway to put files in that folder from within a VS2008 setup project?
When I was facing similar challenge, I made it so:
Created a class library auxiliary project.
Added the System.Configuration.Install.dll reference.
Added a new class inheriting from System.Configuration.Install.Installer
Wrote an override of the Install method to copy the files
In the Setup project, targeted the above mentioned project output to the Application folder and -
In Custom actions (Install group) picked the auxiliary project output from the Application folder.

Find out all the files required to run a c# application

I need to generate a list of all the files which are enough to run my application on any machine. I need this for a setup program. When i go to bin/release folder i'm able to see some pdb files and some configuration files, which i think will not be needed. I tried to disable generation of pdb files too but it still generates pdb for the other projects present in the solution.
So i need a way in visual studio 2008, which can get me all the files (the .exe and .dll and other files) required by my application to run.
Thanks.
Have you tried publishing the application (Build > Publish [app])?
This should just copy all the essential files to the specified folder.
The pdb files are used for debugging. Building in "Release" mode should exclude these files.
You can also create a setup project within the solution. Using that project it is possible to see a list of included files.
If you make a release build or publish the application then you should have a complete set of assemblies your application needs.
However, it can still rely on assemblies which reside in the GAC (Global Assembly Cache) of your machine. Check the references of your project if you think there are assemblies missing in the bin folder.
To solve this exact problem with our software, we wrote a simple console app that finds all the .vbproj & .csproj files in our projects directory, then changes all of the to Release mode (which does not create pdb files, documentation files etc).
This is then run by the build machine (CruiseControl.Net) before it starts compiling the projects.

Categories