Output location of project - c#

I was looking for the output of a project as a *.dll file to add it in References, but in bin folder there where Release and Debug folders.
Is there any difrence between the output.dlls?
Where is the useable output?
please explain the folders roles.

The folders correspond to your Solution Configurations, e.g. Debug or Release. You can specify custom configurations as well, and a folder would be created for it.
Instead of referencing the .DLL file directly by browsing to it, you should reference the project that defines the .DLL. If the project is not in your solution, you can add it by right-clicking on the solution title in the Solution Explorer and choose "Add" > "Existing project...".
This will allow Visual Studio to rebuild the .DLL in case you make changes, which you can now make without leaving your other project, and automatically reference the correct version, and also reference the configuration matching your project, i.e. if your project is run in Release, it will also use the release version of the .DLL.

Related

References can not be reinitialized after check-in from visual studio team service

I did check-in to download source code for the first time, but i got some missing references. I've tried following ways but it doesnt work for me:
Add references: Right click -> add references then find references (after adding the references, there is nothing change, you can see in the photo below)
Dlls were set to Copy Local (I even can not change the copy local to
true)
Adding namespaces to both web.configs did nothing.
I used VS2015. is there any way to update it correctly? thanks
Generally, source code does not contain dll's, since they are vey big files. So I would not normally expect to get dll's from source control. You would usually have to build the solution and hope that Nuget is enabled to download the dll's from where they are stored.
However, the dll's you are showing come with the .net framework, so this should not be an issue, unless of course, the solution file is expecting to find the dll's in some /bin directory.
You can find which directory the dll's are expected to be in by right clicking on the missing dll and then clicking on 'properties'. This should show you the referenced dlls path in the properties window.
If the dll is not in that path you can do one of 2 things:
Delete the reference and add a new reference to the dll, where it actually exists
paste the dll in the path that is being referenced by the solution.

Visual Studio DLL References - Using Relative Paths And $(ConfigurationName) To Select The Corresponding DLL?

I have 2 separate Visual Studio C# solutions. One solution contains projects that generate DLL files (class library projects) and the other solution contains projects that depend on the DLL files from the other solution.
I have two questions about adding the DLL files from the first solution as references to each of the projects in the second solution.
When I add the DLL files as references (using the Browse option) is
there a way to use relative directories so that if I move the
solutions to a different folder I won't have to update the
references? (Assuming the two solutions are always in the same
location relative to one another.)
For example: ....\Solution1\Project1\bin\Debug\Project1.dll
If I change the DLL solution's configuration from Release to Debug I
want the other solution projects to reference the DLLs in the Debug
folder and vice versa. When adding the DLL files to each project can
I use something like the Visual Studio macro $(ConfigurationName) in
the DLL file path so that, depending on whether I build in Debug or
Release mode, I use the correct DLL file?
For example:
....\Solution1\Project1\bin\$(ConfigurationName)\Project1.dll
Thank you.

Visual Studio 2013 C# configuration settings

I want to add include directories and libraries in my c# project like i can in my c++ project
C++ Project : There are options to include directories and linker dependencies.
C# Project
There does not appear to be an option in the project settings to add those settings. I added the path in reference path, but my debugger throws an error. Right now i've added all the dll in my project\bin\debug directory and its working, but i don't want to do it for all the projects. Where i can link these diretories ?
you can add reference of library files which you want to add into your project by right clicking the project under solution explorer and then "add reference" and then browse or select from the list of dlls..
You can't. You have to include references to code files and assemblies one by one.
The linker and compiler for .NET works different than you are used to with c++. That's why you can't just link an entire directory containing some code files / assemblies.
Add reference to your existing dll for every project which will be use it
http://msdn.microsoft.com/en-us/library/7314433t(v=vs.90).aspx
https://www.google.it/search?q=add+reference+c%23&es_sm=122&source=lnms&tbm=isch&sa=X&ei=P-2fU472Bcr00gX-tYAw&ved=0CAoQ_AUoAw&biw=1920&bih=955

Teamcity/c# build doesn't copy my DLL to the bin folder

I have a C++ wrapper DLL added to one of my projects, the proect is my "Set as startup" project.
To do this I just right clicked on the project and did "Add exisitng item" and then in the properties I have
Build Action = None
Copy to Output Directory = Copy always
The code in this project does not directly use this dll, it's used in another project that's part of the solution and I cannot add it to the References as it's not a proper .NET dll.
My TeamCity build doesn't include this dll when it builds my project and I don't know why. I changed the build script so that it just copies the dll from a location to the bin folder but that doesn't work, when I run my app I get a run time error "could not find dll" even though I can actually see it in the bin folder.
So I cannot just copy it to the bin folder, I need to tell Team City to include that dll when the project is built, as it does when I compile it from Visual Studio
So my question is how can I tell Team City to include the dll when it complies my project?
I'm using VS2010, .NET 4

Is it possible to "collapse" content file paths in build output in visual studio?

I'm using an open source library (log4net) that comes with LICENSE, NOTICE, and README files that are supposed to be included when you distribute it. So I want to make visual studio put them in the output directory along with my binaries.
I have log4net and its three files in a "lib\log4net" dir. The problem is if I add the files as content files, they get copied to bin\release\lib\log4net, not bin\release. Is there any way to make visual studio collapse the paths when building?
I originally used a post-build step to copy them, but then visual studio isn't aware of them and it won't put them in any other dependent project's output folder (which it will do if you call them content).
You could use a post-build step on your project and just move them to the directory you want them in. I frequently use pre-build steps to bring in the latest versions of dependencies and post-build steps to arrange my project the way I want to deploy it.
If you are using an install project to package everything, what about adding the extra files directly to that instead?
All you have to do is right click the file, README, for example, and go to properties. One of the properties is "Copy to output directory". Set it to true.

Categories

Resources