Last post Apr 06, 2010 05:51 AM by bcanonica
Apr 05, 2010 11:19 PM|paparazzi|LINK
I've inherited a Web Application project where half the programmers are ASP.NET Developers who use Visual Studio 2008, and the other half are "HTML Developers" who mostly write static HTML and cut JPEG and GIF images. The HTML Developers use simple text
editors such as Notepad++ or Adobe Dreamweaver to write their HTML code.
Both groups of developers commit their completed source code and binary graphic files to an SVN (Subversion) repository.
For this particular project, the client is demanding that the website be deployed as a compiled DLL, so we use Visual Studio's "Publish Website" feature to compile all of the code and copy it to the live web server.
(Normally, for projects like this, I prefer to use the Web Project-style and *not* to compile the website into a DLL. For us, there is no business reason to hide the source code, and it is simply easier for the HTML developers who are not using Visual Studio
to work on the website if it is not pre-compiled)
The problem I'm having is that if one of the HTML developers adds a new file to the website and checks-in the file to SVN, that file is not automatically added to the Web Application in Visual Studio and not automatically copied to the live server during
a Publish Website operation. It is necessary for one of the Visual Studio Developers to manually find the file in the Solution Explorer, right-click on the file and select "Include in Project".
A typical scenario is as follows:
1) An HTML Developer creates a new GIF image, buried deep in the directory structure, like /images/buttons/main-page/click-me.gif
2) The HTML Developer adds and commits the GIF image to the SVN code repository.
3) The Visual Studio Developer performs an SVN UPDATE and gets the latest versions of all the files, including the new GIF image, copied to his local machine.
4) At this point the VS Developer should remember to manually click on "Show All Files" in the Solution Explorer, navigate to the folder where the newly-added GIF image is, and right-click on the GIF file and select "Include in Project". However, it is all
too easy for the developer to forget to do this, especially since if he runs/debugs the website within Visual Studio, everything will look great on his local machine and the GIF image will be displayed correctly.
5) The last step, of course, is for the VS Developer to publish the code to the live site, but because he forgot to include the GIF file in the project, the GIF image will not be copied to the live website and will be broken when viewed in the browser.
I could choose the "[Copy] all Files in Source Project Folder" option when publishing, but this will also copy the (normally hidden) ".svn" folders, which is slow, ugly, and insecure.
My question: is there a way to get Visual Studio to automatically "Include in Project" any new files that have been added by an SVN UPDATE?
web Application svn subversion include in project
Apr 06, 2010 05:51 AM|bcanonica|LINK
You could use a build deployment to add all files in a given directory to your build folder like below. This is probably as close as you are going to get without writig a VS plugin.