I've just started working with Visual Studio 2012 and NuGet and I really like it. A couple of the packages I'm using - AutoFac and CommonServiceLocator, for example - have .xml and maybe .pdb files in adidtion to the .dll. When I build, VS2012 copies these files to bin/release on a RELEASE build - I get .dll, .xml, and .pdb. That's great for debug, but I'd prefer it didn't happen in release.
I confirmed my Build settings for the projects that they are not generating debug symbols. It seems to be related to packages I got from NuGet.
How do I control that?
This happens because the package owners included these files in their package definitions as library files. NuGet freely lets folks do this, and most of the other behavior you're seeing is default behavior for Visual Studio when .xml and .pdb files are the same directory as a referenced assembly.
You can contact the package owners about your concerns, but as you've surmised it's safe to remove them from a site prior to publishing.
Related
I'm working on a solution (C#) with 3 projects in it (one library and two applications) and I wonder what is the bare minimum of files you need to commit to be able to pull off a fresh solution and get it to work right away?
Obviously all source files, *.sln, *.csproj are needed and not the obj folder or bin folder (unless I want to keep a working copy of the compiled files).
But do I need to commit the:
Properties folder
.vs folder
*.resx
*.config
I have Googled it but all I found was a list of the file types, but no explanation of what files where critical to make the solution/project load and compile.
[EDIT]
It has been suggested that this is the same question as: Should I add the Visual Studio 2015 .vs folder to source control?
The question is not related to only the .vs folder, but to all project/solution files.
Though SVN and Git are different Version Control System, I think the files that should be excluded in the Version Control System should be similar. This file is a ignore file for Git (an .gitignore), but should be work as it should in SVN Version Control Systems.
https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
This file is often used in various places like Github Destktop, or the Github Site itself.
I'm using the built-in Google Test Adapter to write unit tests for a project in Visual Studio 2017. When I create the unit test project in my solution VS creates a package directory with the libs and header files for googletest, along with a package.config file. However I'd like to keep the googletest files out of my solution directory (and source control, though obviously I could just ignore them), and in a shared directory like the windows or standard library headers.
How can I configure my solution to get the libs and header files from a shared directory outside of my solution?
Not quite the answer I was looking for, but I learned that Visual Studio can automatically download NuGet packages when they are missing from solutions. Therefor you can just ignore the package directory from your source control but include packages.config, and whenever you clone the project Visual Studio will download the missing packages. This was good enough for my needs.
I have a cmake project that builds fine on Linux and that I want to build also on Windows. The code is portable and is made of C++ so... it should build. The only thing is that, on Windows, I need to use nuget to restore some packages, cpprestsdk is one of them. Now when I run
cmake .
CMake will generate solution files and projects files that I don't want to include in my VCS at all. The thing I want MSBuild to do is to apply the packages contained in my packages.config to all the project files found in the project directory.
Anyone knows how?
The thing I want MSBuild to do is to apply the packages contained in my packages.config to all the project files found in the project directory. Anyone knows how?
I am afraid you can not do such things. That because whether you are using MSBuild or NuGet to do this thing, you have to use to the nuget.exe to do it. However, install nuget packages to the project file relies on VS capabilities not nuget.exe and nuget team not plan to bring it to the exe.
The NuGet Command Line does not actually install any packages. The install command is actually doing a restore operation.
This means that nuget.exe install will only download and extract the package into the output location. It will not modify the project file. Although, the package manager console seem to offer "Install-Package" for doing this, but you have to open each project files with Visual Studio and execute Install-Package in the package manager console for each project files, which is not what you want. So you could not enable this script outside of visual studio.
So we could not use MSBuild to apply the packages contained in the packages.config to all the project files found in the project directory.
You can refer to this thread and this thread for details.
Hope this helps.
I am making a C++ project (quite new to C++) and it needs the so called "boost" library. I thought I could add it with a nugget to make my life easier...(#include <boost\date_time.hpp> added) but now I am getting this error
Error LNK1104 cannot open file
'libboost_date_time-vc141-mt-gd-1_65_1.lib'
What is the problem?
Error LNK1104 cannot open file
'libboost_date_time-vc141-mt-gd-1_65_1.lib'
According to the error, you should add the libboost_date_time-vc141-mt-gd-1_65_1.lib library directory to your project configuration. This .lib included in the NuGet package boost_date_time-vc140 or boost_date_time-vc141.
Since you are using Visual Studio 2015, you just need install the NuGet package boost_date_time-vc140 to your project, NuGet will add the libboost_date_time-vc141-mt-gd-1_65_1.lib library directory to your project configuration automatically. After installation completed, that error will be resolved.
Besides, since you are use boost library in Visual Studio 2015, I suggest that you can use the boost-vc140, which included many dependencies. So you do not need to add them manually.
Hope this helps.
You need to add the boost library directory to your project configuration, go to the project menu, then properties.
In the property tree go down to 'VC++ Directories' and in the library directories add \lib64-msvc-12.0 (change the 64 to 32 for 32 bit builds).
I suggest you do this through view->other windows->property manager, then it will be set up for all future projects as well.
The reason why you have a link error is because you installed the header-only NuGet "Boost" package. However, due to an unfortunate design decision, this header-only package also contains header files for Boost libraries that are not header-only, such as datetime. With a better design, you would have gotten the error earlier (at compile time).
The "Boost.vc120" and "Boost.vc140" packages contains both header-only libraries and regular compiled libraries; the difference between them is the compiler used.
My solution consists of several managed and unmanaged libraries. I am using NuGet for all projects (even for the unmanaged libraries). I am not storing the packages in source control (I am using the option "Enable NuGet package restore"). Since introducing this change with NuGet, the unmanaged projects files (vcxproj and vcxproj.filter) are checked out by VS even there were no changes made. Does anybody has a clue what could be the issue?. I think it is connected with NuGet.