Team Foundation Server - Committed files appear hidden for other TFS-Members - asp.net-mvc-4

Since some months, we are using TFS 2012 with Visual Studio 2012 and until some weeks we didn't notice any problems during checking in/out. Furthermore, we are working on a ASP.NET MVC4 project.
But recently, we noticed that if Person A checks in new files (f.i. .cs or .cshtml) and Person B does "Get latest version", then he receives those files but they are hidden for some reason. So we have to do "Include in project" manually every time. This happens to any of us.
Neither I have direct access to the TFS configuration nor did I change my Visual Studio settings. Thus, it is really strange that this happens for no known reason.
Do you have any ideas what I should try or check?

The only time I have seen this kind of behavior is when someone checks in the files, but not the corresponding .csproj file. The .csproj file contains the definition of what files are included, so for the solution to build with the new files, the .csproj file must be checked in as well.
Note that it may be necessary on occasion to do a "Save All" before the changes to the .csproj file are committed.

I would recommend checking the .csproj file of the last few check-ins that have had this problem. I've encountered this any number of times when one of my co-workers "Excludes this file" from the project because they don't understand why something isn't working. They forget to re-include it in the project and then check everything back in. The project file doesn't contain the files that were excluded.

Related

What else keeps putting the wrong project into the solution?

I've been working with this VB.NET ASP.NET solution all day. It has 12 projects in it. One of them, named PJATools, was being referenced from the wrong folder. I tried, several times, to fix it withing Visual Studio, but it never worked. Finally, I decided I'd better edit the solution file. (There were several other similar problems resulting in a few hundred errors. Editing the .sln file and making it point to the correct project within the solution, fixed all of those.) However, removing the PJATools.vbproj from the .sln file, then adding the existing PJATools.vbproj immediately makes VS point to the wrong folder, with the wrong .vbproj file.
I have tried deleting all of the .DLLs generated by previous builds. I have tried doing a Build Clean. No matter what I do, it always points to the wrong folder with the wrong .vbproj, the instant I add the correct .vbproj in the correct folder to the project.
There must be other files in a VS solution or project, which can change where VS thinks a project in a solution, is to reside. The only thing I can think of is the .sln file and other .vbproj files which might reference PJATools. I've checked all. If they reference PJATools at all, they point to the correct folder and .vbproj file. So, it must be something else. But what?
I'm working with VS 2019. .NET 4.5.2.

VB.net .exe cannot be run from another computer. Missing assemblies for ClosedXML

I must put this program into production today, and I can't get it to run independently.
In the program, I have included NuGet package "Imports ClosedXML.Excel" and use it to create spreadsheets. When I build my executable, and try to run it from another computer, it cannot find the ClosedXML and Documentformat.OpenXml assemblies.
I checked in References that "Copy Local" was = True for ClosedXML and Documentformat.OpenXml, but it's not working. I found another website that mentioned Global Assembly Cache, and that if the dependency is in there, it will not be included in the Build .exe.
I am running Visual Studio Professional 2017. I am in over my head on this one, so if you have answer (and I hope you do), please try to provide it in elementary terms I can understand.
Sometimes issue is solved by individually adding application files inside the following menu
Go to Publish-->Application Files
Select Show all files
Under Publish Status
Set the files you need to Include [not include(auto)]

TFS Build dropping extra files including csproj in target folder

I have an automated build process set up to run from a build definition in TFS, which publishes a web application and generates/executes a database project script successfully via publish profiles that are passed as msbuild arguments in the build process definition. Everything is now running as expected except that several unnecessary files are being deployed to the target folder, including the .csproj file, all of the config transforms, and the properties folder which contains all of my publish profiles.
This is strange because 1. It's definitely not including ALL files/folders and mostly appears to be including ones used by the publish profile like transforms, while applying the transform correctly and excluding any explicitly excluded file (as defined in the pubxml), and 2. The process works perfectly if I do it by publishing from the project in Visual Studio 2013. I have the profile configured to only include files needed by the application, and I've confirmed in the csproj file that this property is there.
I tried excluding the properties folder from deployment in the pubxml file, but this causes the build to crash because it can't find the assembly file. What I've gathered is that the process is keeping all files it needs to complete the build, and dropping all of those files in my destination folder. FWIW, I'm using the "file system" method and I'm not sure yet if web deploy will make a difference. I haven't been able yet to connect to the target server with web deploy, but that's a separate problem to solve. Is there something in the build that I can configure so that my destination folder has only the files it needs to run the application, and not the files needed to BUILD the application?
FYI I also have not been using a drop folder, I'm not sure if that makes a difference or not but that might be the only thing I haven't tested as it doesn't seem necessary since I'm using a publishprofile and don't want to use the default tfs build configuration.
I found a solution that works well enough, after reading this: http://www.asp.net/web-forms/tutorials/deployment/advanced-enterprise-web-deployment/excluding-files-and-folders-from-deployment
This was a little uglier solution than I wanted, since it requires hard-coding the names of excluded files, but it does the trick and only requires identifying the files and folders in one location instead of altering a publish profile for each target environment. I created a wpp.targets file and used the ExcludeFromPackageFolders and ExcludeFromPackageFiles elements to identify the extra files. Ironically, if I don't also name the wpp.targets file in the exclude element, THAT file is included in my package. It's possible MSDeploy doesn't have the same issues with TFS as filesystem, but after spending half a day trying to work through a different set of issues and permissions workarounds, we decided that file system is a cleaner publishing method.

Visual Studio Solution

My program adds files to a VB.NET solution. What I want is that the project, when files are added to it, is refreshes or prompted to refresh. Now what I am currently doing is unloading and reloading the project. This is fine, but I noticed that my newly added files are not included in the project, and I have to manually include them by clicking them.
How can I make my project add all files that are not included and refresh when new ones are added?
Thanks
My code to add.
A lot of files can exist in folders and subfolders under the solution (sln file). not all of these files are required to participate in projects. each project file (vbproj / csproj) maintains the inventory of files included in the project. you need to both place your files at appropriate places and update the vbproj file appropriately.
As it happens, the vbproj files are not simple indexes, they are full blown build scripts. they have a pretty intricate file format (XML) and a convoluted semantics. Appending nodes in that file works fine if you follow the existing pattern. but i suggest you look up MSBUILD first.
Please note that if the project you are mutating programmatically, is open in visual studio, then there are strong chances of inconsistency. make sure the project is not open in any visual studio. programmatically altering the program itself (or the same project) is not advisable.

migration to TFS 2008, build no longer moves resource dlls to bin folder

We recently moved our source control from 2005 to 2008 and the web projects builds have stopped copying the resource dlls for referenced (project reference) resx files into the bin folder (they remain at the same level as _publishedWebsites). I cannot see anything different in the build (It is still set to Mixed Platforms) but at the _CopyWebApplication target the copy ignores these folders, any ideas?
looks like we had a problem with the targets file for webapplications, I copied over the old one and the builds worked. doesn't exactly answer the why but it got us working. If I get a chance to diff them I will and post the result
If you get a chance, post your answer, as I've recently run into the same issue. The referenced project .dlls are not being placed in the _PublishedWebsites folder, but are being placed at the same level.