How do I reset Visual Studio 2013 completely - asp.net

Okay so I'm trying to create a new website, and the first time I created the site I accidentally saved it to the wrong folder. Well instead of just copying the folder to the correct location and having to deal with that headache I decided to just delete the old folder and make a new site in the correct place. Now it keeps giving me numbers at the the end though. I named the site PNI (and I like that name and want to keep it) so when I made it the second time it named it PNI(2) I tried deleting that and resetting then environment, removing the old site names from the "recent" list, but it named the site PNI(3). How can I reset VB so that it will stop counting my sites?

I can think of 2 places you might need to check to clear out old sites
In VS, go to menu Tools > Options and then click the Projects and Solutions node and look at the path in Projects location. Go to that path and delete any folders you see for the previous PNI sites you have created.
Some of the configuration data may be saved in your local applicationhost.config file (if you set up these sites and used IIS Express). Typically one of these paths will get you there:
%userprofile%\documents\iisexpress\config\applicationhost.config
%userprofile%\my documents\iisexpress\config\applicationhost.config
Look for the <sites> node, and delete any <site> nodes under it which look like your PNI site.

Related

How do you point the current branch at the working directory in Bazaar VCS?

I am trying to set up Bazaar for our sites but am having trouble achieving the exact setup I want. Basically, I want one folder that contains all the information for each site, such as:
/var/www/site1
/var/www/site2
/var/www/site3
...
I would like to set up the trunk and any branches for each site within these folders. I would like the folder itself to point to act as a working directory, such that whatever branch I happen to be on is mirrored in the site folder, such that our server can get to it.
Any ideas on how to go about this?

How do I prevent IISExpress & My Web Sites folders from cluttering up my My Documents folder?

I noticed recently IISExpress & My Web Sites folders are getting added to the My Documents folder on my Windows 7 machine. I recently installed VS2012, so I'm guessing that's the culprit, but I haven't been able to find anything on line that explains how to change these defaults, if possible.
Microsoft cluttering up my 'Documents' folder with all their programs' (junk) folders drives me insane as well. I have conceded somewhat by creating a Data folder under my Documents folder, where I am pointing all MS apps (and others apps such as Firefox's profile folder) to for all their (generally unwanted) folders, and with a subfolder created for each program/suite. At least this way I can easily back up all settings when I back up my 'Documents' folders.
Anyway, VS2012 installs IIS Express, which is what is causing these folders to be created. I have found two solutions for dealing with the unwanted folders.
Uninstall IIS Express. You can do this from the normal Windows 'Uninstall a Program' part of Control Panel.
Change the folder location that IIS Express uses, as follows. Be warned: anyone doing this risks causing problems with their computer if you don't know what you are doing, so you do so at your own risk. Please make appropriate backups along the way as well too!
a) Close Visual Studio.
b) Create a new folder for the IIS Express sub-folders:
eg. D:\My Documents\Data\Microsoft\IISExpress
c) Move the existing unwanted IISExpress subfolders (config, Logs, TraceLogFiles) from your My Documents > IISExpress folder to the folder created in step b).
d) Create a new folder for the My Web Sites folder, I suggest also under the folder created in step b).
eg. D:\My Documents\Data\Microsoft\IISExpress\Websites
Under this folder, create a website for the default IIS Express website (in case it "auto-magically" reappears it's ugly head again later on).
eg. D:\My Documents\Data\Microsoft\IISExpress\Websites\Default
e) Go to the newly located config folder at:
eg. D:\My Documents\Data\Microsoft\IISExpress\config, and:
i. Open the file applicationhost.config in your text editor (eg. Notepad).
ii. Find the node sites > site > application path > virtualDirectory path for WebSite1, and change the physicalPath value from %IIS_SITES_HOME%\WebSite1 to the IIS Express default website folder you created in step d).
Eg. %IIS_SITES_HOME%\Websites\Default.
Note that %IIS_SITES_HOME% points to your 'Documents' folder (this appears to be a "feature" of IIS Express, I can't find a way to change it, and it appears to be auto-configured when IIS Express starts up, which it does by using the applicationhost.config file).
Do the same for any other sites created by IIS Express.
f) Create a new registry entry pointing IIS Express to the new folders you created (partly explained by MS here: http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme). FYI the registry key doesn't previously exist, as IIS Express uses a default of my Documents unless this key exists:
i. Open the Windows 'Run' box, eg. (Windows Key) + R
ii. Type regedit
iii. Navigate to key: HKEY_CURRENT_USER\Software\Microsoft
iv. *Right click* the Microsoft key (that you have just navigated to), and choose: New > Key
v. Type IISExpress
vi. *Right click* the IISExpress key that you have just created, and choose: New > String Value
vii. Type CustomUserHome, and hit the Enter key to save it.
viii. Double-click the CustomUserHome string to enter a value for it, and for the Value Data: field, type in the path to the new IIS Express folder you created in step b), for example: D:\My Documents\Data\Microsoft\IISExpress. Press OK, and you can now close the Registry Editor.
g) Reopen Visual Studio, and it should start using the new folders, as well as not create the folders in your Documents folder anymore. Yay!!!!!
FYI, when I did this all, I actually did it in a slightly different order (creating the registry key first), but this order was the easiest way to explain it all. Whether you create the key first or last shouldn't matter, as long as you do all the steps. Good luck!
A Tricky solution
Make a copy of your C:\Users\<user>\Documents\IISExpress folder
first
Create a symbolic folder called IISExpress inside the C:\Users\<user>\Documents folder using the following command
mklink /J C:\Users\<user>\Documents\IISExpress D:\IISExpress
Move all the content from your copied IISExpress into D:\IISExpress
Thats all
If you're just looking to declutter your Documents folder, one simple workaround is to set the unwanted folders to hidden so it's no longer visible.
You can do this by right clicking on the IISExpress folder > Properties and checking the hidden property at the bottom. The folder will still remain in your Documents folder but won't be visible to you. If for some reason you want to access these folders again, you can toggle hidden item visibility in File Explorer's View tab.

Backing up ASP.net website code files - to a backup folder under the website folder

I want to backup my existing ASP.net web app before updating it.
Therefore I create a backup folder inside the website (ie same level as App_Code, web.config). Call it something like Backup_20110910
Then I move all the current website files/folders (excluding web.config, app_data) into the backup folder.
Then I extract the zip of the latest code in the now clean folder.
Is there any potential problems with this approach? As after all, you are increasing the number of csharp files in your website folder, could there be conflicts etc.
I wouldn't back up within the folder structure, there's a possibility that someone then finds your backup folders and browses to them, running the older code. If you zip it then you suddenly have files someone can download too. Even more amusingly if, as a lot of people do, when you change web.config you rename the old one to web.config.bak a lot of security scanners look for that because now it can be downloaded, as it's no longer a .config file, but a .bak.
Backup outside the web root, not within and all of those worries will go away.
There won't be an issue - except that it might become confusing to have identical folder structures within the current folder structure - it's always wisest to keep backups completly seperate from the current build

Where does WebMatrix save the site configuration?

I have a website saved in Dropbox folder and I successfully worked on it for days without any problems with publishing. When I opened that site today in WebMatrix on another computer, I had to configure publishing settings again off course. I did that and tried to publish the site with only one file modified, but I was surprised when I saw all files in the publish dialog marked for upload.
One thing came to my mind - to copy site configuration from first to second computer so that second computer has information about already uploaded files and continues to publish just the modified ones, but I don't know if the site configuration is stored in file or registry or something else...
So, before I start digging I decided to ask the wise ones here :)
I found it in following location:
C:\Users\Username\Documents\IISExpress\config\PublishUI
When you try to make a new publish setting there is a link where you can say you want to import old settings. This looks for files with an extension called .PublishSettings or .XML, so I would start by searching your pc for files with that extension. I would imagine the .xml file would have your sites name in it's filename, so that is worth a shot as well :)
This should be enough. If not I am looking forward to hearing what others say or you can dig up yourself.

way to excluding static folders like Images in publish website feature in Visual Studio 2010

In my website when deploying production most of the time I only need to deploy bin folder and just marker files if new pages added.Since my website contains gigabytes of images folder and static stuff not updates frequently, it takes ages to complete a one publish cycle in visual studio website publish feature is there workaround to overcome like excluding these static folders when website publishing
Thanks...
You could use the Web Site Copy Tool - deploying a web site using this tool only updates the files that have been changed.
After you connect to the remote site, each file will have one of the following statuses.
Unchanged
The file has not changed since the last time the file was copied.
Changed
The file has a timestamp that is newer than the timestamp taken when the file was last copied. If the same file has been changed in both the source site and the remote site and you synchronize these files, the tool prompts you to indicate in which direction you want to copy.
New
The file has been added since the last time the site was copied.
Deleted
The file has been removed since the last time the site was copied. These files are shown only if you select Show Deleted Files. If you synchronize a file that has been deleted in one site, the tool will prompt you to indicate if you want to delete the file from the other site.
See this article for further information
I don't know if there is another way. But if you make the folder hidden in the file system, then it would not be published.

Resources