Team Foundation (TFS 2010) Folder Cloaking - Server Side Alternative? - visual-studio

I have a website project that is consuming user controls from another shared project. I am using a build event to copy the *.ascx files over from the source user control project.
I don't want the ascx files to be checked into TFS source control from the consuming project, only the source project. Is there a way to keep TFS from trying to check in files from a specific folder other then cloaking?
My issue with cloaking is that it's a client side function, which means every developer who takes down the project would have to manually cloak the folder or folders in question themselves. I'd like to be able to setup the solution in such a way as a developer could take the project down from source control without having to manually configure it to accommodate my separate project for shared user controls.
There is an article here: http://devio.wordpress.com/2009/11/05/shared-aspx-and-ascx-files-in-visual-studio-and-tfs/ that seems to address this issue but I think they're setup is different then mine in that I am using a website project and not a web application project. Being that I have no .csproj file there's no way to include or exclude files from my project.

Check out the TFS Power Tools (if you haven't already) http://visualstudiogallery.msdn.microsoft.com/en-us/c255a1e4-04ba-4f68-8f4e-cd473d6b971f, under Team Members > General Settings, you can setup a Worspace Template to cloak as needed.
Not played with it myself, but looks to be the functionality that you need.

Related

Prevent VS from checking out App.config from SourceSafe when I am making local changes to it

I am working with a project (shared by a small team via SourceSafe source control) with four .config files in it:
App.config is the configuration file that is eventually used when the program is executed.
The other three files are essentially templates that I can quickly copy & paste into App.config.
App.Integration.config and App.Release.config are valid for all team members. For instance, it refers to integration or production database servers on the network.
App.Debug.config is a template with settings that are valid only for my machine, e.g. because it refers to my local copy of a development database.
Background: Why am I managing multiple configuration files manually? ASP.NET web projects automatically support multiple configuration files, but other project types don't. I also know that this could be automated by adding a custom MSBuild task to the project file; however, this might break or confuse later build steps, such as ClickOnce deployment.
Obviously, I do not want to check in "my" local version of App.Debug.config into SourceSafe, which is why I told Source Safe to ignore that file. For the same reason, I have SourceSafe ignore App.config, because that file is often going to be edited, e.g. when switching from the local configuration file to the integration environment's version. If everyone checked in their versions of these files, they would be seen by all other developers.
However, if I understand correctly, this leads to SourceSafe no longer keeping a copy of these files at all, so if someone checks out a fresh copy of the project, these two files will be missing.
Is there a way to have an "initial" copy of e.g. App.config in my SourceSafe repository, but at the same time prevent Visual Studio from checking out the file when it is locally edited by a developer?
Background: Why am I using SourceSafe at all? It's not my decision, and I can do nothing about it in the short term.
You can use the pin feature to keep a copy but not allow checkout.
In solution explorer, locate your file (e.g. App.config), right click on it to call menu "Show History...", select a version of your file and then click button "Pin".

Opening a Visual Studio 2010 project in 2012 what creates the backup folder and how to control it?

I have an issue. We are upgrading to VS 2012 at work. When we open a VS 2010 project Visual Studio converts the project. This is fine, because VS 2010 can still use the project (yay microsoft). However, there is a \Backup folder created in the solution directory. Is this being created as part of the migration? Is there any way to control it?
The reason I ask is that the process that makes this folder copies web.config files into the folder. If you then try to build the solution (these are MVC projects), we get a "It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS." error. The cause is that there is a web.config file in a subfolder instead of the root folder. We did not make and do not want this change, and cannot figure out how to control it. Deleting the Backup\Web.config file fixes the error. Renaming it from web.config to web.config.bak fixes the problem.
I don't really want to have to personally open and convert every single project, and don't want random people bumping into this problem. Any idea how to either stop VS from creating the Backup folder, or how to make it create them in the my documents studio folder etc? I can't find any setting to control this and can't find any good info.
By chance, are you using the MvcBuildViews property to pre-compile your views at build time? If so, this is why you're encountering this (since it does the pre-compile in the same directory, it doesn't filter out any of the files below the project directory).
Note that you will also encounter this issue if you use the Publish feature for this project. Publish copies the web.config under your intermediate build output directory (by default, obj/) before and after applying web.config transforms.
The good news is that in VS2012, or in VS2010 with the latest Azure SDK installed, pre-compile is now supported for Web Application Projects (including MVC). These settings are currently in the project properties, under the Package/Publish Web tab.
(this doesn't directly address your question about the Backup folder, but it was too long for a comment.)
There is no way to control it that I found. We had to go ahead and run through and convert every project to 2012 and delete the backup folders to prevent any other team from running into it.

Getting Team Foundation to recognize new files added to source controlled directory

I am working on a PHP project, so I am not using Visual Studio, however the company I work at is mostly a .NET shop so we use Team Foundation Server for version control. I can use VS to manually add files to the TFS project but that is a bit cumbersome when I am adding a bunch of new files, I pretty much have to add the file right after I create it so I don't forget.
What I want to know is if there is a way to have TFS pick up a new file added to a directory that is under source control for a project. For instance if I added a few PHP files to the source controlled html directory I would like to be able to just go to check in pending changes in TFS and have the newly added files included in the list. Does anyone know if this is possible? Thanks much!
There's no way to have this happen automatically with TFS 2010 or below. I've seen a video that says they'll be adding this feature for the next release.
In the meantime, you can use Source Control Explorer, then right-click a folder in the left pane and choose "Add Items to Folder". Follow the dialog and you'll be able to add any of the items that haven't previously been added.

How do I keep folder tree and publish websites in TFS 2010?

I have a visual studio solution that consists of several web applications, windows services and other class libraries. I am in the process of configuring it for continuous integration with TFS 2010.
The default build template puts every binary in the drop folder, and creates a _PublishedWebsites folder in which it publishes every web application. I do not want that because I need to separate the files that belong to one service from the files that belong to the another service.
I have followed the steps in TFS 2010 BUILD SERVER: Can not keep folder tree in the drop location to put each output in its own folder. That works well, but now my web applications are no longer published. The project is compiles and its binaries are placed in a sub-folder inside the drop folder, but it is missing all the other files, like Web.config, aspx, css, etc.
I could probably use two build templates, one for web applications, and the other one for windows services, but I'd rather have a single build template. How can I achieve this?
Why you don't use separate build process for each web application? Creating multiple build processes and multiple build definitions is very easy. You can copy or branch template process and then create a new build definition for each of them.

Prevent third party DLLs from being checked out in VSS

(I know I am using Visual Source Safe, I do not have a choice because it comes with the MSDN Subscription license and my company does not want to buy a third party source control solution....)
I have a VS 2005 solution with 3 C# class library projects, 2 ASP.NET web site projects and one ASP.NET web service project that is stored in a Visual Source Safe database. Some of the projects reference a common library DLLs that handle common taskes.
When a new person sets ups the solution on their workstation and build it for the first time, it checks out the common library DLLs in the bin folder of the ASP.NET web site and web service projects. When another developer that is currently working on the project tries to build, they receive a "file excludely checked out by other user" message.
VS 2005 does not display the check mark next to the DLL that is causing the headache.
Is there a way to prevent this from happenning?
Why do you have the bin folder checked into SourceSafe? On projects I've worked on, the third party dlls were checked into a separate folder (maybe called ExternalLibraries or ThirdParty) at the same level as the solution file. The compile process would be set up to copy the dlls into the bin folder. This could be handled with .refresh files, or with a pre- or post-build step. This way, VisualStudio/SourceSafe won't see the files as having been updated, and won't try to check them out.
If the compile is already pulling the files in due to them being dependencies, I'd suggest removing the bin folder from VSS. This is not the same as an "Exclude folder from project" which hides the folder from VS05 when compiling (and gives you the compile error you mentioned.)
If the third party dlls aren't going to change, another option is to make those files read-only in VSS. This way, no users will be able to check out the files. (To mark the files read-only, you will need to change the permissions from the VSS management tool; the developer's tool doesn't have that feature.)
As for why it happens, I don't believe VSS checks the binary version numbers - it is only concerned with modify file date. If a new developer pulls all the code out, all files (including binaries) will have the current date as the modify date. This may be causing the unnecessary checkouts.
Regarding your later comments - I'm not sure why VS05 wouldn't see the files as under source control but the VSS UI does. I suspect it has to do with the .vss files (and similar) that are in that folder. In this case, VS05 is incorrect.
Not sure if this is the problem or the best fix, but if you update every developer's machine so that they have the same latest versions of the common DLLs installed, this shouldn't keep happening. I think VSS checks out the DLLs in the \bin folder if the version referenced by the project file doesn't match the version installed on the developer's machine.
#Pedro:
In the VS 2005 IDE inteface, it does not indicated that the \bin folder is in VSS. When I look at the project in the VSS UI, it shows that is checked out to the user who did the latest build on their workstation.
If I use the "Exclude folder from project" option, it will cause the compiler to throw "reference not found" errors.
In my solution structure, the class library project creates a reference to the third party DLLs using the "Add Reference" command. Then I set a project reference to the class librarys in my ASP,NET web site and web service projects (using the web site project template). Because the class library has a dependency on the third party DLLs, they are copyed in the \bin folder.
How do I set a file to read-only through the VSS UI?

Resources