This question already has answers here:
How to prevent VS 2008 from publishing .svn folders as part of publish process?
(3 answers)
Closed 2 years ago.
Does anyone know how to prevent VS copying the .svn folders associated with subversion when publishing a web project?
I'm using Tortoise SVN and Ankh svn VS plugin.
Thanks
I must say I've never had this problem, when you hit publish - do you check the option to only copy the files needed for running the application? (there's a third option which copies everything from the project folder which isn't very useful)
(uncheck hidden on the .svn folder and then check Show all files in VS and they will show up, but as you don't see them to begin with they shouldn't for some weird reason be a part of the project anyway)
Right-click the .svn folders and hit "Exclude from Project".
I seem to have fixed the problem but I don't know why it worked.
I simply deleted the .svn folder from the bin folder and it now it ignores all .svn folders.
Weird.
Related
I have a project where the repository was on a disk that now is faulty.
so I have created a new repo folder in file explorer on a new disk.
I then deleted the .svn folder in my project as I thought that would make it like a fresh project (obviously I was wrong about that)
as It still wont add the project to the new repo with error "Project not added to Subversion because it is out of working copy"
It doesn't even ask where I want to create the Repo so somehow the project still has the old address.
I also altered my .sln solution file changing Svn-Managed to = False
The Old repo is gone and I'm using a backup that has been altered in the past.
Could anyone help me get round this please
Mike
I'm afraid that your case is unclear and maybe several screenshots and details about your environment will help (solution directories layout, versions of VisualSVN, TortoiseSVN, Visual Studio).
If you want to add your solution into a new repository, run the Extensions | VisualSVN | Add Solution to Subversion command and follow the steps of the wizard. If you receive warnings, please examine them and update your question with these details. Note that you need to svn commit your solution to publish your solution's data into a repository.
Additional notes:
Removing the .svn directory from a working copy effectively unties the directory from Subversion. I.e., this action unversions the working copy. Note that up-to-date VisualSVN and Subversion versions place only one .svn directory at the root of a working copy. But SVN 1.6 and older have this directory in every folder of a working copy.
If you want to re-add an existing solution to a new repository, then indeed you could remove the .svn directory or run svn export from the working copy into a new directory - this creates an unversioned copy of your working copy. Note that you may need to re-open your Visual Studio solution after removing the .svn directory.
The command Add Solution to Subversion is only active if the opened solution is not in a working copy (i.e., when it is not versioned). If the command is greyed out, then you need to unversion your solution first. See TortoiseSVN Manual | Exporting a Subversion working copy (section Removing a working copy from version control at the bottom of the page).
VisualSVN does not place the Svn-Managed to = False string into your solution's .sln file. VisualSVN does not depend on it. I assume that this string was recorded by another Visual Studio plug-in.
This question already has answers here:
How can I always block checkin of a specific file in TFS
(8 answers)
Closed 9 years ago.
In my solution folder in visual studio 2012 adds folder "packages" sometimes. And this folder strongly want to check in TFS.
Please help me to disable this feature.
Updated after the comment below:
That's a folder for Nuget packages. Folder gets added to the solution whenever you add the first Nuget package to any of your projects in the solution.
2 things you need to do:
1) Right click on the folder in solution explorer and say Exclude from Project.
2) Then go to Source Control Explorer and right click on the packages folder and say delete. The Pending Change column should say "add" like the image below. It will be removed from source control once you do that but will stay in your local directory. Any changes you make after that in nugget packages will be done locally.
I am using Visual Studio 2010 to develop an MVC 3 application for Azure. We are using AnkhSVN for subversion control, which has been slightly buggy in the past.
The error I'm getting when I try and Build/Debug my application is:
Unable to copy file "C:\Xxx_bin_deployableAssemblies.svn\all-wcprops" to "bin\.svn\all-wcprops". Access to the path 'bin\.svn\all-wcprops' is denied.
The story gets more convoluted, since this error is not thrown on another one of our developer machines, just on mine. The only real difference in our machines is that I have SP1 installed on mine.
Also when I updated AnkhSVN and re-checked out the app from the subversion server it work without throwing an error for the first build. After shutting my comp and then starting back up there error popped back up again.
Update:
I still haven't found a real solution. I just delete the .svn file in the folder and that takes care of the issue with Building the app. However, when I update or commit it throws an unversioned error.
I think the problem is that the app is trying to copy the .svn file over during the build, instead of just ignoring.
Do you know of any way to have the .svn file to be explicitly excluded from the build?
I need to resolve this issue asap, so any help is great!
Thanks
I received the same errors after I versioned my MVC 3 app for Azure on VS 2010 SP1. I was able to resolve this issue in three simple steps.
1.) From the VS 2010 Solution Explorer, click 'Show All Files'. This will show the hidden 'bin' and 'obj' folders in your Web/Worker role project. Right-click and delete both 'bin' and 'obj' folders.
2.) In Windows Explorer, browse to the folder that is versioned (should be your root solution folder). Right-click -> 'SVN Update'. This will download and put back the 'bin' and 'obj' folders that you deleted in VS. This is necessary because your project will exclude these folders from the solution, however SVN will still think they are part of it.
3.) The final step is to delete these files from your repository. In Windows Explorer, browse to the project that contains the 'bin' and 'obj' folder. Select the 'bin' and 'obj' folder -> right-click -> TortoiseSVN -> Delete. Go back to the root versioned folder and SVN commit to remove them from the repository.
The next time you build your Solution, the 'bin' and 'obj' folders will be recreated. Just make sure you don't add or commit them to your repository.
I fixed this problem by going into Windows Explorer and changing the properties of the folder to not index (look in advanced settings) and then manually copying the files giving me errors.
I had the same problem and fixed it.
You have your build output checked into SVN. This Azure target (that's complaining) should only be messing with \bin, \obj directories during a build. It will be cleaning and building. This clashes with .svn as source controlled files under .svn have hidden files and folders with read-only access. Therefore the build runs and subsequently breaks when the Azure targets try to delete/move the .svn files.
To fix just remove your build output from SVN (anything in \bin or \obj). You should not be placing these files into source control anyway as the rest of the files in SVN produce this output, so there is no reason to save it separately. Then you can delete the bin/obj etc folders and you should no longer experience the issue.
If you just delete the bin and obj files as other people have suggested then you're just leaving the problem for the next poor sucker that checks out a clean.
I had the same problem. It appear that the project bin folder was "accidentally" also committed into the svn. After removing the bin which of course shouldn't be in the svn the problem was solved.
Now it is still needed to understand why the build try to copy the sv folder to the bin.
Somehow another application keeps the file locked while Subversion (below AnkhSVN) tries to replace it with a different version.
Usually this is caused by a virus or index scanner. Retrying a bit later usually resolves this issue.
Sometimes a Subversion "Cleanup" (Solution explorer->(relevant node, E.g. Solution)->Subversion->Cleanup) is required to recover from similar errors.
I also had this problem. The cause for me was that I had created the bin directory myself instead of letting VS create the bin directory. Once I deleted the bin directory cleaned the build and did a rebuild, everything worked fine.
We use subversion so we have subfolders named _svn in our solution. Doing a Find in Files returns strings from these subfolders.
Is there any way to tell Visual Studio to ignore these files?
From "Find in Files", in "File Types" or "Look at these file types", you can use:
!*\ExcludeFolder\*
Example:
!*\bin\*;!*\obj\*;!*\.*;!*\ExcludeFolder\*
What you can do is to setup a set of folders that will be used for searching. In Find and Replace window, on the right hand side of "Look In" input you have a "Choose Search Folders" option where you can setup those sets of folders.
Just remember to turn off "Include sub folders" options if you have added root project folder.
If you don't have hundreds of folders this solution should work.
Never had an issue with the global find until we moved to Visual Studio 2017 and started with Angular + .net Core applications... (mostly problems with the HUGE node_modules folder being searched)
I found that using the MSBuild exclusion property DefaultItemExcludes is working fine to exclude from global find in Visual studio 2017..
I now by default open up the project file (.csproj) for a new core project in VS2017 and adjust the property as follows to exclude the node_modules (sometimes I add the wwwroot too):
<DefaultItemExcludes>$(DefaultItemExcludes);node_modules\**</DefaultItemExcludes>
See also
https://github.com/dotnet/cli/issues/7525 , there they advise to prepend the folders to exclude and seem to use a forward slash instead of backward slash, like this :
<PropertyGroup>
<DefaultItemExcludes>node_modules/**;$(DefaultItemExcludes)</DefaultItemExcludes>
</PropertyGroup>
Hope this helps anyone experiencing issues with VS2017 global find / search .
I had this problem when moving to Windows 10 using Visual Studio 2015 and TortoiseSVN. Previously the .svn folders were all hidden so did not appear in search results. To solve this I simply went to the folder properties in Windows Explorer and checked the 'Hidden' attribute for the .svn folder. After refreshing the folder view in Visual Studio the .svn folder no longer appeared and is ignored when using Find!
Instead of searching for files in a directory (your solution's directory, in this case), you could limit your search to the files that are part of the project or the solution. Those in the _svn directories will thus be ignored.
I found in Visual Studio 2017 especially when using Angular Cli that the generated javascript files or other build files can be added to your project sometimes unknowingly. This can cause several headaches including adding a bunch of files to the searches and really slowing things down, especially intellisense because it is searching all of the generated files on top of the source files.
The easiest way I have found to correct this is to simply right click on the build folder (i.e. {Project}/dist) and select Exclude from Project. This will remove the folder from the project but the generated contents will still be available for runtime, it is just hidden from the UI.
If you need to still see the files, you can show hidden directories and files by selecting Show all Files or
click on the Icon:
on the top of the Solution Explorer.
Basically you want to exclude all build folders from your project/solution.
I don't think you can set this (after all, you are asking for "Entire Solution" search), but often you can remove the folder from the project / hide the directory in filesystem (for Web Site project type).
If you are not using VS2019 or VS Code (for which the solution has already been found in other answers), as a workaround you can use the search in Far Manager, it supports masks to exclude certain files or folders from the search.
I'm using subversion and Visual Studio 2008 (and Tortoise)
I've got a number of folders in visual studio projects that I want to rename.
Whenever I've tried this in the past I've ended up with conflicts and had to create my new folder, copy all the existing content in to it, check it in and delete the old folder.
Has anyone come across a more straightforward way to do this, or have a set reliable process for renaming folders in Visual studio and Subversion?
thanks in advance,
Chris.
TortoiseSVN has a feature to help with moves and renames performed outside SVN, after the fact.
Rename the folder as you would normally. Then right-click the root folder and select TortoiseSVN -> Check for modifications. In that list you'll see "oldfoldername missing" and "newfoldername unversioned". Ctrl-click on both of them, then right-click and select "repair move".
This way, you can rename folders and files with the benefit of VS's refactoring tools, but without messing up SVN.
There are two solutions. The first one:
You right click on the folder in in Visual Studio, and pick "Exclude from project"
You rename the directory with Subversion / TortoiseSVN / whatever (of course, you have to rename the folder with the rename command of a subversion client, otherwise you will end up in trouble)
You add the folder to the in Visual Studio project again
Second approach: You download some SVN plugin for Visual Studio such as VisualSVN or AnkhSVN and use them to rename the folder safely in Visual Studio.
Tortoise SVN has a rename feature built right in. Right click the folder, click Tortoise SVN, click Rename. You'll of course have to check in your change.
Using VisualSVN, I can just change the folder name in Visual Studio.
Without it, I have to remove the folders from the project in VS, SVN Rename the folders via Tortoise, and then readd the newly renamed folders to the VS project.
Using TortoiseSVN right-click on folder you want to move and while holding button down drag to new location. TortoiseSVN will then show you a menu with options....that should do it :-)
Cheers
Mike