TFS Visual Studio. Download dll for all developer - visual-studio

When I use TFS with my colleagues and I download DLL with NuGet Packages and Push project into TFS server my colleagues can't have the dll when they get project by TFS.
They must download too the same DLL by NuGet.
Is there a solution to have DLL download by one developer when all developer get project in TFS ?

Very bad practice, We don't recommend check NuGet packages into TFS, just as mentioned by Daniel and Erik, it's better to manage packages with Nuget.
But if you still want to do that, you can check in the dll files to TFS manually. You need to check in the entire packages, dll files are excluded by default.
Right Click in Source Control Explorer > Add items to folder > Select the project packages (dll files) > Switch to Excluded items tab > Select the dll fiels > Include items > Finish > Check in the dll files.
Thus the packages (dll files) will be downloaded with the project when someone get project in TFS.

Related

How do you configure a VS2015 C# project to put the NuGet packages on build in a lib directory?

I am using Visual Studio 2015 Community. I have got a C# project with a bunch of NuGet packages. When I build the project the NuGet assemblies get copied into bin\Release but I don't want them in the root directory of my application, I want them to be put in a lib subdirectory.
The output path build setting doesn't do what I want, it changes the general output directory. I think that it's Visual Studio which copies the NuGet assemblies on build.
I like my projects organized and don't want a bunch of dependency DLLs in the root folder.
One suggestion is that you could think about using the init.ps1. When the NuGet package is installed for the first time or every time the solution is re-opened in Visual Studio, Init.ps1 will runs once for your solution.
Reference Ryan Vice's share us the detailed steps about how to let NuGet copy dlls to [solution root]\lib in this case:
How to copy Nuget content files relative to the solution root

Adding nuget files to Different folders in a Visual Studio project

I have a private hosted nuget repository with a .nupkg including several DLL files. These files are compiled C++ plugins for interacting with hardware, printers, cameras etc. I also have a c# project, which is set as the startup project in my solution. The usual way I'm adding these DLLs is to press "Add Existing Item" on my project and set the Build Action to Content and Copy to output Directory to Copy if Newer. So when built, the DLLs can be found in the output directory.
I want to simply this process by having these files in a nuget repo, but when pressing the "Manage Nuget Packages" on the project, these files are only added as Reference. How can I define where nuget is adding my DLL files? Is it event possible?

Visual Studio + nuget + TFS: checking in nuget packages?

I'm working on a TFS project with a small team. This project has a bunch of nuget packages installed, but it's for a 4.0 project, and the nuget package manager GUI doesn't even offer the older versions of the packages any longer since their 4.5 equivalents are now being used. In order to allow other team members to compile the project, they need to have the exact versions of the packages. I'd like to check in the entire "packages" folder used by nuget. Is this a good idea? If so, how does one check in the "packages" folder and all its contents since it exists at the solution level? There is no "Include in Solution" option in Visual Studio as there is when you right-click an assembly.
in the past I have also checked in the NuGet packages into version control. With this some problems appeared:
Some packages where not checked into version control when committing from Visual Studio into TFS.
Updating packages became a real problem.
For the first problem I had used the TFS Power Tools. The problem with this solution is that every developer needed to install the Power Tools.
A better solution came up with NuGet 2.7. It introduced package restore. With package restore there's no need to check-in the packages folder. They will be restored during build.
We use an on-prem TFS install with no internet access so we have to check in our package folders or our builds fail. The biggest issue is that VS does not behave consistently when it comes to adding the pending changes for new package files, often times it will ignore the .dll files in the pending changes window, sometimes it adds everything fine.

NuGet Package restore for website

I am trying to use NuGet Package Restore with VS2010 + Visual Sourcesafe. It is working partially for me.
Where this is coming from: NuGet not getting missing packages
My Solution2 has asp.net website[Project1 in above image] that has another nuget package installed. Now another developer opens the Solution2 via VS2010, the automatic restore works for Library projects in Solution1. It gets all missing packages for Library projects that is referenced in this Solution2 and I see them in Solution1/packages folder.
But for Website it says external dlls i.e. pacakages missing. The issue I think is because website doesn't have a .csproj file and so it doesn't know things needs to be restored.(http://nuget.codeplex.com/workitem/1663)
Making it work partially:
Added packages/repositories.config to website solution (What is a solution folder in visual studio)
Another developer goes to VSS and get that packages folder manually. Now when he builds the solution, the Package Manager Console prompts for restore i.e. has "Restore" button. On clicking it will bring the AjaxControlToolkit.
Questions:
- Is the above approach the only and best available for Websites?
When the developer clicks "Restore" button it brings packages for Library as well to Solution1/packages along with packages for nuget. Any reason why would it do that?
Any ideas on above issues?
Per you link, nuget doesn't support websites. If you really need to use Nuget, and let's face it, everyone does, then in my opinion the best approach is to switch your website over to a web application, at which point visual studio will create a csproj file for you, detailing the nuget packages that are contained in the project.
HTH
For adding Solution level "packages" folder with repositories.config to VS Solution Explorer, I created a Solution folder and added repositories.config.
That created packages folder in the SourceSafe when I checked-in the solution.
I also found someone pointing the same thing here.
Update: I think the newer nuget is restoring the packages. But one other trick for nuget to add the dll to the bin folder it to check-in the .refresh files for AjaxControlToolkit and its dependent packages.

How to share referenced assemblies with other developers using TFS2010

I am working on a VS2010 project with 4 other developers and we are having reference issues when we are connecting someone to the project for the first time or when somone adds a new dll file. How can we get the reference files to come from the bin folder on each developers machine when someone clicks on "Get latest Version" and "Check In"?
use Nuget (preferable) or create a 'Lib' folder in the solution (and add it to source control) for referenced DLLs (third party or otherwise).
NuGet is a Visual Studio extension that makes it easy to install and
update third-party libraries and tools in Visual Studio.
Using Nuget Packages
Managing NuGet Packages
There is an official Entity Framework Nuget package (as well as many others).

Resources