Add existing project to solution with files - c#

How can I add a project I have developed separately to my current solution including all its project files? When I select Add existing project in my solution explorer, the project is added but I don't see the project files in my solution folder.

If you are on some version of Visual Studio, then I think that you can't do what you are asking. However you can manually copy the project to wherever you need it to be, and then add it to the former solution.

Related

DotNet Core - Purpose of Solution Files

What's the purpose of using solution files for DotNet Core projects? I'm using a Mac, and I can use project-to-project reference to modularize and build shared libraries without solution files:
dotnet add reference ..\Library\Library.csproj
which adds the following to my current directory's .csproj file:
<ItemGroup>
<ProjectReference Include="..\Library\Library.csproj" />
</ItemGroup>
And now building my current directory's .csproj will build Library.csproj.
Solution file works as container for application's project/projects. It comes handy when you are working on your application out of IDE. Following are some of uses of solution file.
Open project or multiple projects in IDE just by opening solution file in IDE. e.g. If you open solution file in visual studio then all of projects which are part of solution will get opened in visual studio.
You can control build/deployment of projects (what to build and what not to) under solution using solution level configuration.
If you are using editor like VS Code then solution file facilitate to build all those project which are part of solution just by running "dotnet build" command. If projects were not part of solution then you need to build them individually.
When working out of IDE (like Visual Studio) and source control you can add all project files and solution to source control just by adding solution to source control. Same goes with check in or checkout.
These are some of advantages of solution file and there can be many more. However solution file is not must have thing and you can still live without it. Its just makes developer's life easy and improves productivity.

How to Configure the nuget.config file for xamarin project is VS2015

I am building a Xamarin app in Visual Studio, but am having problems with the source control, which I think is because I don't have a nuget.config file.
Firstly, do I need one per solution or one for the whole project, or alternatively just on in the PCL etc.
Secondly (the main question), is it possible auto-generate these files based on the nugets you currently have installed? Also, when these are updated, is it possible to keep the nuget.config file up to date?
Update:
In Visual Studio the Manage NuGet packages for Solution option which was present in past versions is not displayed for my project, not sure if this is the software version or the projects configuration.

Visual Studio creates bin folder on opening web application solution?

Visual Studio is creating a \bin folder and copying various assemblies into it when I open a web application solution, even before I compile
What is triggering this action?
And how do I control it?
Reason I'm questioning the process, is the assemblies are not the expected ones
This is where Visual Studio puts all the dlls for runtime for your project. Library dependencies that the project needs. All the dlls that Visual Studio needs for a web project are kept here as well as other packages from Nuget that you might add, and your own. If you look in the References section in the Web Project, you will see many of the dlls that appear in the bin directory.
If there are some assemblies there that you do not want. You can try removing the reference from the Reference folder. Right click on the library in the Reference folder and select remove.
Be careful with removing references though, because your project may need it to function.

How do I create a Shared Code project (.shproj)

How I add a .shproj to my Visual Studio solution and reference it from other projects?
I know that Visual Studio 2013 Update 2 added a new project type for "Shared Code." This type of project does not produce a dll itself. Instead the files from the Shared project are included as source files in the assemblies that reference it.
I know it exists because I have seen one in an open source project. However, looking through the project templates in Visual Studio I could not find a "Shared" project type.
Edit: According to the Visual Studio 2015 Preview documentation, VS 2015 adds templates for shared projects and a UI for managing the references, so the below should no longer be necessary after upgrading.
There does not seem to be a way to create one directly. It appears currently that Shared Code projects are automatically created when you create a Universal App project as shown in this introduction to creating a Universal App.
Therefore, to create one in your solution: Add a new project type "Blank App (Universal App)." Delete the Windows 8 and Windows Phone projects it created leaving only the Shared project.
Check out the Shared Project Reference Manager extension.
Note: make sure you have VS2013 update 2 or above for this to work.
An alternative to vossad01's approach is to create a shared code project, then open up the .csproj file and see what the project looks like in the .csproj. Visual Studio's csproj files are simply XML files so you can open, copy, and paste the shared code project into your own csproj.

Team Foundation Server: Sync Source but not Project Files?

I made a project in XNA 4.0 on one computer, which has VS2010 installed with TFS, while on another I have VS2012 installed and MonoGame 3.0.1 with it. Because MonoGame is essentially a continuation of XNA, code written for XNA 4.0 should work fine with MonoGame. However, the references go to different DLL files, and build slightly different. Is there a way to sync the source (.cs) and content files, but not the project and solution files in TFS?
What you could do is manually put all .CS files under source control using Team Explorer. So... don't put the project under source control, just the source files. It's very manual and you'd obviously need to manually check files in and out.
What I use are the TFS Powertools that integrate into Windows File Explorer to make this easier.
Actually you definately SHOULD synchronise the project, just don't add the files TO the project
Project 1 (xna) with no files
Project 2 (monogame) with no files
Both checked into TFS
Then add the files to a whole other root folder and check them into TFS
Then from each project, chose add existing file, and click the the split Arrow, there is an option to add a reference to the file (instead of including the file Inside the project)
That way everything (both projects and all code) are in TFS, and the code can be shared across both projects with no issues.

Categories