Visual Studio 2013 using old Website name - visual-studio

So in Visual Studio 2012 I renamed a website in a solution from "oldname" to "newname". I have opened this solution in Visual Studio 2013 and somehow it is using "oldname" for the website instead of "newname". This is not is NOT an ASP.NET website application just an ASP.NET website.
I have searched the content of all files in the solution directory and cannot find "oldname". I am 100% positive that that "oldname" is not in the .sln file and the website does not have a project file of course.

Check %userprofile%\documents\iisexpress\config\applicationhost.config file. It suspect it should have the old name. Rename the website in the file, close your solution and open it back again.

This is how I managed to do it with my solution in Visual Studio 2015:
Close your solution > navigate to .sln-folder > .vs (hidden) > config
Look for error prone names (possible multiples) in the sites section. I removed every <site></site> where there were naming conflicts. In my case I had this for example:
After removing the <site></site>-sections from the current applicationhost.config-file I was able to re-add website projects with my new and correct name!

It's an old thread but I tried just modifying the applicationhost.config file and closing the solution but it still didn't take.
If this happens to you just remove the site from your solution and then add an existing one from your local IIS instance and you'll see the renamed version there.
You may want to confirm its location before removing the site.

Related

tfs 2010 with an upgrade visual studio 2012 want to download a Deploy.wdproj that was deteled with the last upgrade

I upgraded a visual studio 2012 web form application to Visual Studio 2012 and added the upgrade to tfs 2010. As part of this upgrade process, I removed a web deploy project from the solution file since I do not need the web deploy 2010 project anything. The application is now being deployed as a publish website.
The problem is When I obtain the updated solution file from TFS, it keeps saying 'projects have been recently added to this solution. Do you want to get them from source control? If I click yes, it wants to open -Deploy.wdproj that is not supported by the application.
If I click yes, nothing else happens. Should I get rid of this message?
According to your description and error message, this seems due to the project that was deleted from source control but still referenced in the .sln. The .sln was not aware of this. Please checkout the .sln file, and update the reference.
Another solution is unbinding and binding again the solution file.
1. Unbinding the solution file from TFS
Unbind the solution file (.sln) from TFS. Go to the menu File =>
Source Control => Change Source Control.
2. Cleaning the solution file by deleting globalsection
Clean the solution file (.sln) by opening it in a text editor. Remove
all occurences of GlobalSection(TeamFoundationVersionControl) =
preSolution. Including the mentioned starting tag and the ending tag
EndGlobalSection.
3. Bind the solution file to TFS again
Finally bind the solution file (.sln) to TFS again. Do this in visual
studio by going to the menu`File => Source Control => Change Source
Control
Take a look at this similar question: Every time I open my VS solution I get “Projects have recently been added to this solution. Do you want to get them from source control?” Hope this helps.

Rename project folder in Visual studio and Team foundation server

My Visual Studio 2013 solution has a project "Test". I can rename it in solution explorer, but I also want to rename the project folder in disk and also reflect the change in Source Control(TFS). How can I easily do this?
Thank you
#CodeCaster, Thank you. Based on your advice, I have done some quick experiment, and worked it out. First step is rename the folder name in TFS; the new folder will appear in local workspace and all contents of the folder moved to this new folder. The old folder stays there with rest content which not belong to source control. You can delete it manually.
Or
Using TFS Power Tools to rename from Explorer.
I followed those steps to preserve the version history of the files inside of TFS:
Rename/move project file (.csproj) in source control explorer in VS (alternatively, this also works from within VS Solution explorer, simply select "rename")
Rename/move project folder in source control explorer in VS
now the project should be unavailable in VS, solution also gets closed
remove project from VS
add project (new path) to VS
fix project references in other projects
adjust namespaces if desired
adjust assembly name and default namespace in project settings
Don't know of an easier way. Was searching for this myself, and this should be the way to go.
I think you can rename it from the TFS Database.
Try going into tbl_Project of the Tfs_DefaultCollection Database, which you can find on the SQL Server Instance used by tfs. You can know which one is that by going into the TFS Console, click on Application Tier, then find the details of the Server under the Data Tier Summary. Run an update query against the project you want to rename.. I haven't tested this but just assuming it should work (some educated guess)..
I am using TFS 2015 Express and rename project is grayed out.
You can still rename the project using the TFS Site for the project.
Here is a link that shows how to do it.
https://www.visualstudio.com/en-us/docs/setup-admin/rename-team-project
I was facing a similar issue while trying to rename a folder in Visual Studio 2015.This is what I tried.
Right click on the project file
Open with Notepad
This will generate your current solution file
Change the occurences of your prev file name. (Find and Replace with the desired name)
Save it and close
Change solution explorer name and rename the folder to your desired name.
This should work.

Completely deleting Visual Studio website solutions

When I create a new website project in Visual Studio 2013, even after completely removing the directory in Visual Studio 2013/Projects and also Visual Studio 2013/Website, VS 2013 still thinks it exists. As a result, it appends an incrementing index to the end of the solution name:
How can I completely remove all traces of the solutions (like unloading a normal project)?
The reason VS thinks the website still exists is because it's looking at the IIS Express applicationhost.config file.
In VS 2015
Visual Studio 2015 uses an applicationHost.config per solution. There is a a .vs folder in your solution. So the solution has a .vs\config\applicationhost.config file
Prior Versions
Look under %userprofile%\documents\IISExpress\config\applicationhost.config. Your old website is still registered under IIS Express, so VS generates a unique name for the new one.
In my case, i have to remove the old registrations in the file [applicationhost.config] in the folder [.vs\config].
In addition to Jimmy's answer, sometimes when removing things between the elements in the applpicationhost.config file, I experience IISExpress issues. After hours of troubleshooting, renaming the applicationhost.config file or deleting it fixes that problem. Renaming or deleting the config file also fixes the problem stated in this question. (but be careful if you choose to delete it - make sure there's nothing you need in it)

IISExpress 8 Cannot read configuration file redirection.config

I'm running Windows Server 2008 R2 (x64) with IISExpress8 and when navigating to
c:\Program Files (x86)\IIS Express>iisexpress.exe
it says:
Filename: redirection.config
Error: Cannot read configuration file
Any ideas where to start?
I can't find anything...
I had a similar issue to #Myles J but renaming %userprofile%\Documents\IISExpress\config\applicationhost.config didn't work. What I had to do was the following:
Close Visual Studio.
Rename the %userprofile%\Documents\IISExpress\config directory.
Start Visual Studio again. The %userprofile%\Documents\IISExpress\config directory will be recreated with the default config files.
Copy the original applicationhost.config file over the autogenerated one.
Before anyone asks: the permissions on the folders were identical, the read-only flag was not set on the folder or its files, and I didn't modify applicationhost.config in any way.
After installing IIS Express, copy all files from
C:\Program Files\IIS Express\config\templates\PersonalWebServer
to
%userprofile%\Documents\IISExpress\config
Right click on your project file and Edit the project file and remove the URL from IISUrl and reload your project then it will work
I have just resolved this. It is a strange solution but it worked for me. Here are the steps I took:
Navigate to the folder containing the local IISExpress config files (normally My Documents>IISExpress>config on Windows7).
Find the applicationhost.config file. Rename it to something different e.g. applicationhost2.config.
Navigate to your web project in Visual Studio (I was using VS 2012). Right click on the web project and select Use IISExpress. Run the project. It should fail due to the renaming of the config file.
Change the name of the configuration file back to application.config. Ensure "Use Local IIS Web Server" is selected in the web project settings. Run the solution.
This worked for me.
If you do:
C:\Users\”username*****”\Documents\IISExpress\config
You find these file
applicationhost.config
aspnet.config
redirection.config
Delete above 3 file and then open the project.then the problem is solved. I tried, its working fine.
I have the exact same issue with Visual Studio 2013 on Windows 8.1
I map My Documents folder to SkyDrive, so the IISExpress folder was marked as "Online-only". Once I marked it as "Available offline" everything worked.
Visual Studio will only report the filename it looks for, not the full path. The problem for many users is that the IISExpress with the redirection.config can exist in multiple paths, including a OneDrive path which may not be synced.
To figure out exactly what file Visual Studio attempts to open, use the Microsoft (SysInternals) tool ProcMon. It lists all files and resources Windows tries to access. Add a filter for "Path contains redirection.config" and reproduce the problem in Visual Studio. Now you will see the actual path it tries to use.
In my case, I have multiple IISExpress folders. One that was synced to OneDrive and another one that was local. Visual Studio tried to access the OneDrive folder which was not synced to the local disk, and thus it failed.
In some situations simply renaming/deleting the applicationhost.config file isn't enough since VS won't always recreate it for you. I believe the following will fix it under all circumstances:
Close Visual Studio.
Make sure there are no IIS Express processes running, then delete C:\Users\XXXX\Documents\IISExpress\config\applicationhost.config (where XXXX is your Windows username).
On command line, execute c:\Program Files\IIS Express\iisexpress.exe. This will recreate the necessary configs. Press 'Q' straight away to end the process.
Open Visual Studio again and Start/Debug your web project. Everything should now be working.
Backup files at local IISExpress folder. It can be found at: C:\Users\”username*****”\Documents\IISExpress\config
Go to the location:
C:\Program Files\IIS Express\config\templates\PersonalWebServer
Copy the required files from this directory to the local IISExpress folder.
It worked for me after I copied over the files:
applicationhost.config
aspnet.config
redirection.config
In my case the 'My documents' folder for my work laptop was mapped to a network share. So when the work network was not available I was not able to open my solution.
Change:
These will have the value of my docs in network share. Change this to local
I. Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal
II. Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal
For eg:
Old value: \networkdrive\c$\Users\profile\Documents
New value: C:\Users\profile\Documents
See:
https://blogs.msdn.microsoft.com/chiranth/2015/04/01/error-while-runningstarting-a-website-under-iisexpress-in-visual-studio/
The issue is that the files in C:\Users\"Your Username"\Documents\IISExpress\config are encrypted.
Open this folder, Select all the files, Right click and select properties,
Click advanced, deselect "Encrypt contents to secure data, Click okay, click apply.
That will fix it.
Using Visual Studio 2013
I had to stop visual studio rename the whole config directory, Documents > IISExpress> Config then start a new web project, which fails but it recreates the config directory, then I rebooted and launched visual studio and everything worked!
I noticed this problem after copying a project between 2 computers, perhaps it was caused by a duplicate IISExpress port or something trivial.
Using VS2013 / Windows 7
Close solution. Open Windows Explorer and right-click on "My Documents\IISExpress\config" directory and select "Decrypt". Be sure "Apply changes to this folder, subfolders and files" is selected. Reopen VS solution.
In my case it happened when IISExpress was still active from a previous VS session and new instance of VS was run.
The solution was to stop (or kill) IIS Express instance.
Fix was really simple for me >> Restart Visual Studio
My setup:
Visual Studio 2015
Web projects use local IIS 8.5
I occasionally experience what I believe to be a VS bug where it converts some projects to use IISExpress (this is fixed by deleting the folder created in /This PC/Documents). This might be related.
You don't need to close Visual Studio or rename anything.
Open properties for %userprofile%\Documents
Select Security > Advanced, change owner to yourself (again if you are already owner).
Select "Replace owner on subcontainers and objects" and "Replace all child object permission entires with inherited permission entires from this object".
Ok.
For me, It's a simple lack of permission either give everyone permission
to "%userprofile%\Documents\IISExpress\config" this folder or Open VS in Admin mode
for me was removing the file Documents\IISExpress\config\applicationhost.config
Closing visual studio > Open > Debug
Thanks for the previous answer help go straight to the issue
After trying to solve an issue with a quick fix of changing IIS express inside visual studio from integrated to classic pipeline , I ended up not being able to use IIS express at all. I tried all techniques above...
I could not rename , copy the file. Uninstall of IIS express and re-install did not work.
I FINALLY downloaded the latest version of WebMatrix and installed IIS express 8, that did not work, but at least then i was able to finally delete the old directory and then I recreated itself.....
NOT FUN AT ALL.
I resolved this (with vs2013 and windows 7) by going to Documents > IISExpress> Config and renaming the application.config. After that, I restarted visual studio and opened my project and it worked.
I ran into this issue while trying to open another developer's solution after installing VS2013 (Update 3 RC). After following the advice here and deleting/renaming/etc. the config folder, VS re-created the files in the wrong location. It created nested config folders:
C:\Users[user]\Documents\IISExpress\config\config
I moved everything from ...\config\config into ...\config, and it worked as expected.
I found that deleting one of the sites from the applicationhost.config file resolve this problem for me.
I used the following command from the %ProgramFiles(x86)%\IISExpress directory:
appcmd list site
then
appcmd delete site rogueSiteName
Especially there was a site name with a bracketed number suffix (e.g. "MySite(1)") that I deleted. I'm not sure yet if VS2013 just had an issue with the brackets or that two sites pointed to the same directory. Either way deleting it made VS happy again.
Background
I had been struggling with this issue for a couple of days and nothing seemed to help - not even the instructions given in the top answers here.
I had also tried moving the config folder as mentioned in http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme. But although VS2013 recreated the directory structure and files in the new location the errors continued and running appcmd showed that it was still pointing at the old location by default.
Credits
Credit for where I found the commands to use goes to http://gyorgybalassy.wordpress.com/2013/12/02/cleaning-up-iis-express-configuration/
For ASP.Net Core just access your Properties section, then make a modification and save it.
Example: I modified the SSL port
You will get a notification that your launchsettings.json was modified. Accept that and you're good to go.
If it is ASP.NET Core project
Just try to change iis port in file launchSettings.json by path iisSettings:iisExpress:applicationUrl
It's 2020, I am reporting the same problem in Visual Studio 2019.
Cause: Multiple VS instances open with different web app (Blazor in my instance).
Solution: Close all VS instances and re-open the solution that you want to run.
On IIS 10 Express. Make sure that Visual Studio (VS) is turned off.
I first found out that %userprofile%\Documents\IISExpress\config\ was not working.
I first thought IIS Express had clashed with IIS from the windows OS.
I uninstalled it, yet no changes, then I uninstalled IIS 10 Express that was installed with VS 2019 through the control panel.
Then I went ahead to discover that this file is saved at the C:\Users\username\OneDrive\Documents\IISExpress, associated with one drive storage, so I advise you copy %userprofile%\Documents\IISExpress\config\ and paste in your windows explorer navigation to find directory.
go to one directory higher, and/or rename the config folder. Restart your VS and run the project again.
Mine was caused by OneDrive. Apparently my documents folder is being synced to it.
What I did is changed the location of the documents folder through regedit and navigated to this path:
HKEY_CURRENT_USER > Software > Microsoft > Windows > CurrentVersion > Explorer > User Shell Folders
and then changed the value of Personal
from: C:\Users\my username\OneDrive\Documents
to C:\Users\my username\Documents
After that I restart my computer and I was able to create a VS project.
I have the same issue,
First time, i think Visual Studio not permission access to %userprofile%\Documents\IISExpress\config so i run Visual Studio with Administrator, but it not working.
I try all answer above but still the error!
Finally, i look internet, i see my onedrive is stopping, i enable and sync data. Restart computer and worked.

Why does it say "Project with that name already opened in the solution"?

I recently migrated a VSS database to TFS 2008. Using Source Control Explorer, I got the latest version of a solution with 12 projects.
When I opened the solution in VS 2005, two of the projects were not found. I am not sure why these two projects were not found, but thought it easiest to just delete and re-add them to the solution.
When I do this, VS gives me a "A project with that name is already open in the solution." The project doesn't appear in solution explorer, and is not listed in the .sln file.
Any ideas?
I had this problem and I was able to solve it using the following steps:
Remove the project from the solution.
restart visual studio.
add the project to the solution as an existing project.
I had the same message... Seems like it comes from (.csproj) project file. Under first propertygroup there is a section named
<ProjectTypeGuids>...</ProjectTypeGuids>
which generally tells Visual Studio to handle that project in some specific way. Some Guids can be found here.
First make a backup copy of that file. Then removing that section can help you open the project as usual project. As it seems that the Visual Studio thinks that the project is not the type that is specified in the ProjectTypeGuids.
This did it for me:
remove the section <ProjectTypeGuids>...</ProjectTypeGuids> in each project
reopen each project, then save to overwrite the existing project file, finally exit
reopen the solution file
pray (optional)
If anyone uses AnkhSVN instead of TFS, it's also possible, that the .sln-file need the following lines:
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection
in the "Global" section.
Before anyone tries tempering with their solution- and project files, figure if you may have project dependencies outside the solution, such as IIS - and you forgot to start Visual Studio in Administrator-mode
For me, the project not loaded was because it was configured to use IIS on the local machine and I needed to start Visual Studio as an Administrator.
I have to say that removing the section <ProjectTypeGuids>...</ProjectTypeGuids> could create some problems.
In fact, such a section defines the type of the project and, if removed, could disable some features.
For example, if your project was originally defined as Smart Device (C#), after removing the aforementioned section the on-device debug may not working properly.
Delete .suo file. Build solution. Add Projects.
Unfortunately I don't know the why behind the obtuse error message, I can merely provide what steps I took to get it to go away.
In my case, I had reconfigured my local IIS (<UseIIS> not <UseIISExpress>) and it was no longer hosting the URL that was in the csproj <IISUrl> field.
Editing the .csproj file in another editor and changing that field to the new URL, followed by closing and opening the solution in VS resolved the issue.
I would try hand editing the project/solution files, they are text and pretty easy to read. You can edit the file in notepad. To open up the file as text in visual studio you need to first close the solution. Then do file->open and select the sln file, but instead of hitting the open button, press on the right side where there is an arrow and select open with.. from there you can select source code editor (text).
Somehow VS 2022 doesn't create a virtual directory anymore. I had to manually create the website in IIS
I had the same problem when i migrated a website to a web app project.
Unload the web app.
Add the existing website.
Reload the web app.
The following worked for me when I moved a project running vs2010 to another laptop.
I removed exactly the following and it worked:
<ProjecctType>Guid of sorts</ProjectType>
<SccProjectName>Svn</SccProjectName>
<SccLocalPath>Svn</SccLocalPath>
<SccAuxPath>Svn</SccAuxPath>
<SccProvider>SubversionScc</SccProvider>
For those looking for this while dealing with VSTO projects...
Be sure to have the Office Tools for Visual Studio installed in your machine before opening the project.
I solved it by changing Windows' regional settings. Instead of "English (Europe)", I used "English (United States)". Others have reported similar behaviors with changing for example from "Russian (Ukraine)" to "Russian (Russia)", etc.
-AlessandroSegala
Work For me.
Ref: http://answers.microsoft.com/en-us/windows/forum/windows_10-windows_install/customized-cultures-cannot-be-passed-by-lcid-only/26eb9d4b-7ddb-4774-8a40-7a7d84ba9277?auth=1&rtAction=1455534187354
In my case it was corrupted vbproj file. First line was missing:
<?xml version="1.0" encoding="utf-8"?>
After adding this line I had to close the solution, delete .vs folder and open again.
I got it in Visual Studio 2022 version 17.4.4.
You may also see:
Error HRESULT E_FAIL has been returned from a call to a COM
component.
when you try to reload your project.
One way to load the project (and deal with IIS directories later) is to edit the .csproj file and set UseIISExpress to true.
Replace:
<UseIISExpress>false</UseIISExpress>
with
<UseIISExpress>true</UseIISExpress>
Then you need to close your solution and open it again and the project should load.
I encountered this issue with web application projects.
When I tried to reload the projects, the VS2022 output said something like :
"The project is configured to use IIS. Unable to find the server
'{site_url}' on the local computer. Ensure that the local IIS is
configured to handle secure communications."
Which is pretty clear. Indeed, in my case, this was caused by my website https binding that just vanished for no reason (it happened to me several times, looks like a bug with Windows 11 & IIS 10). Things got fixed when I got my https binding back (projects could load norammly).
In VS 2022 to open a legacy web project I had to:
Remove from Solution
Change framework version from 4.6.x to <TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> in from csproj
Remove <OutputType>Library</OutputType> from csproj
Close Solution and open it again (!!!)
Add project to the sln again.

Resources