How to make TFS include bin and debug folders by default - tfs

I recently started working on a project that is using .Net Core & React. Our shop is using TFS for a version control and this is where I encountered a problem.
When React project is created it uses NPM that loads up a bunch of files in "node_modules" folder as dependencies. Some of these modules have "bin" and "debug" folders in them, but TFS naturally ignores them causing compilation issues for other developers.
Is there a way to add something like "!\ClientApp\node_modules*" to ".tfignore" file to eliminate this behavior on certain paths?

Remove all folders generated by package managers from source control entirely. Restoring packages should be part of your build process, both on your desktop and during CI.

Related

Electron share dependencies within multiple electron.js applications

I am working of multiple electron applications and i am not using installer to install my electron application instead of installer i am using win-unpacked folder because i don't want to install application.
since win-unpacked folder hold all the required dependencies it doesn't required installation but i want to use same dependencies for my other electron applications (dependencies such as dll,resources etc) to reduce size of multiple builds.
when i try to put other exe to win-unpacked folder it shows ui of the same application because resources folder is same, i think there must be some way to change resources folder name or at leaset .asar name change while creating build will resolve issue.

Importing a project into Visual Studio

I have a WinForms project with certain NuGet package dependencies that don't seem to be recognized even after using the NuGet restore option. I've received this project from a colleague and am trying to set it up so I can compile and work on it on my own machine.
Things I've tried:
Uninstalling and reinstalling Accord and OpenTK to no avail.
Adding references in the reference manager to everything that is giving me a warning and also listed in the reference manager (not all things issuing a warning are listed there). This resulted in additional warnings...
Updating the reference path to include the bin\debug directory of my project.
NuGet restore command in the package manager console. I had seen this references in a previous post while searching for solutions, but I guess these commands don't work on my installation?
Deleting the entire project and unzipping it again and praying it just works.
I had the same issue when I moved project files from a folder inside of the solution. Some reference file paths were still pointing to the old location and I went thgouth all the steps you did without solution.
The way I solved the issue is to manually edit (open in a text editor outside of VS2019) the paths in .sln and .csproj files. If you see any broken or wrong paths, do a search in files (I use grep) on the entire project directory.
Your colleague could have had paths specific to his environment left over in the project. I've seen this before numerous times.
Also, does your nuget console work with other projects?
This or this might help.

Visual Studio 2013 Web Deploy Missing Dependencies

I have recently run into an issue where (for some reason this behaviour has appeared out of nowhere) during web deployment of a project to Azure Websites - some reference assemblies of the dependent projects are not automatically included into the deployment package.
SO this is a rough structure of my project:
1) ASP.NET MVC project that references class library project
2) Class library project that references some NuGet packages
Now, when I web deploy the ASP.NET MVC project to Azure Website - not all of the NuGet packaged assemblies from the reference class library are deployed (it seems that some are included automatically and others are not). Everything works fine when run locally. All of the required assemblies are copied over to the bin folder of the ASP.NET MVC project.
Now, the only way that I have found to work around this issue is to add the NuGet package of the missing reference directly to ASP.NET MVC project. I really don't like this workaround - since it breaks the modular structure of my project.
Surely there must be a way to specify which assemblies are to be included with Web Deploy? I have tried some pretty extensive google searches on the topic - but that didn't yield an working solution.
Try the following for each of the offending Nuget packages:
Open the Package Manager Console. Make sure the Default Project dropdown is set to your MVC project.
Run Uninstall-Package [Package Name] -Force
Run Install-Package [Package Name]
If you need to keep a particular version of a package instead of just pulling the latest in, you can add -Version [Version Number] to the end of the last command.
That will essentially refresh all the references and other bootstrapping for the package, then try to web deploy again.

NuGet adds Packages folder to the solution. Should it be part of Source control?

I am using NuGet to add packages to my solution. NuGet added a Packages folder to my visual studio’s solution root folder. The concerning part is that the “packages” folder is not part of source control. That means the source code comes from TFS, but the project references come from a folder that is fed by external source. People can put malicious code in the packages folder and build the application.
I like to understand how my other colleagues that get the source code from the TFS source control can build the project with packages folder not being part of the source control?
We did have a similar problem where our build server wasn't allowed to have internet connection, so couldn't download packages. We started with creating our own NuGet Source, which was simply a shared folder with all packages copied to it. The visual studio projects would of course use these packages rather than packages hosted on www.nuget.org
I must say that we scrapped this idea because of the overhead of doing it as our package usage increased.
My advise is that if you are worried about packages downloaded at build time, store the packages folder on source control.
NuGet supports automatic package restoration so your colleagues who use this feature will automatically download required packages. There is a policy at nuget.org that prevents user to delete or update exact version of package once it is published so it can support package restore without any interruptions - see this answer for more detail. If you are using other package sources than nuget.org than you should check their package deletion/update policy because it may be different.

Visual Studio - could no resolve this reference

I created an ASP.NET MVC project in Visual Studio 2012 on my laptop, did a bit of work on it without issues, then checked it into source control. I've checked it out on my main desktop machine (a completely fresh Git clone), and it won't compile stating that various references are missing (one of which being entityframework.dll). Looking back on my laptop, those DLLs are in my project's "bin" folder (which I didn't add to source control for obvious reasons). On my laptop, if I rename my bin folder, then I get the same compile errors. Am I incorrect in not committing certain DLL files that are in my bin folder? Surely those DLLs should be copied into the bin directory at compile time?
The desktop probably can't find the folder to copy from.
You should add the references using NuGet (if you aren't already) and include the packages folder in source control. (or enable package restore)
You should look as to where the library references are stored in your project file. If the project is referencing copies in your bin directory then you have your project setup incorrectly.
You should maintain a libraries directory in your source control tree that id checked in like any other dependency.
The bin directory should be output only.

Resources