IISExpress 8 Cannot read configuration file redirection.config - iis-express

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.

Related

VS2015 annoying message about IIS Express

I use devenv.com to build my projects from the command line. For various reasons I do not use msbuild for that.
The problem I have with VS2015 (not VS2013) is that I sometimes get a dialog like this:
The only way known to me to make it go away is open the VS 2015 GUI and build the solution there. It needs to be done just once, but it is annoying in the first place, because the command line build is stuck until OK is pressed. Plus this could happen again.
A few notes about my setup:
IISExpress. Please, do not suggest moving to IIS.
We do not use the local applicationhost.config from the .vs folder. The global one from %USERPROFILE%\Documents\IISExpress\Config is used instead. We enforce it for all the projects in all the solutions by including <UseGlobalApplicationHostFile>True</UseGlobalApplicationHostFile> in each and every project (through a common targets file).
My command line build script knows to create the web application site in the global applicationhost.config, so in VS 2013 the script could be used even if no sites were initially configured - they are configured on the fly, just like VS 2013 GUI does. However, this no longer works in VS2015 - it opens this bloody dialog.
What additional command line configuration needs to be done to avoid this dialog?
When you open VS 2015 for the solution, the first thing it does is to repopulate the applicationhost.config file inside the local .VS folder. But if you rebuild your project using Devenv.com command line, it will not automatically regenerate the .vs config file correctly.
So I agree with Lex Li, we might ignored a few inconformity. You can try to closed Visual Studio and then deleted the entries for your site in the applicationhost.config. Then opened project in Visual Studio and reconfigured everything before trying to run it. Or using devenv.com to build a new projects from the command line.
I just copied the applicationhost.config file from the project directory ...\.vs\...\configfolder to the IISExpress config folder located under %USERPROFILE%\Documents\IISExpress\config.
So I overwrote the global config applicationhost.config file, but in my case it was OK as it is the only VS project on my computer.
Careful when doing this when you've got more projects on your computer as connections may break.

Visual Studio 2008 Solution has wrong "Opened URL" path for Web Application

I have a project solution I am migrating from another computer, and the project opens the wrong "Opened URL".
When viewing the Properties for the Web Site, the following path is correct and working on the old computer.
file:///C:/Collection/Server Workspace/store.domain/Main/store.domain
When the same solution is transferred via TFS to my computer, the Opened URL path adds an additional "store.domain" at the end of the path:
file:///C:/Collection/store.domain/Main/store.domain/store.domain
Editing the path inside Visual Studio isn't an option, its greyed out and not editable. Editing the text of the solution file shows no duplicate "store.domain"s either.
I'm sure I'm missing something simple, perhaps with IIS?
You need to check in the web site from the old computer to have the correct URL stored in TFS Version Control. Then get latest version for that web site on your dev machine.
Solution: The solution file on the old computer only worked when inside the folder with all of the files. The same solution file on the new computer, needed to be in the parent directory.
So the fix was to move the solution up one directory, for whatever reason. This allowed the phantom /store.domain folder to line up correctly.

Visual Studio 2013 debug can't find config file

Have loaded an old project in Visual Studio 2013. Ran a few times with no problems. Was looking through folders on my machine earlier and found a folder where I host my local sites called sitename-site. Thinking it might be an old copy I deleted and emptied my recycle bin out of habit. Now when I try to run the project it says it can't find the config file, which it seems to think is in this folder I deleted when there is still a web.config file in the directory that holds the actual site.
Any ideas what's going on and how I can fix it?
Thanks
Still not sure why vs decided to create a random new folder and put my web.config in there but have managed to get the project working again by setting the server to Local IIS in the Web section of the project properties.
Hopefully this will be useful to anyone else with a similar problem.

Error HRESULT E_FAIL has been returned from a call to a COM component VS2012 when debugging

I have a problem debugging a project migrated from Visual Studio 2010 to 2012. Every time I go to debug it I get the error message:
"Error HRESULT E_FAIL has been returned from a call to a COM component".
Compiling and running the application in a local IIS server works fine - just cannot debug.
The other change other than moving to VS2012 is I am now using Team Foundation Server for source control and issue tracking - but I cannot see how that would affect it.
I can narrow it down to the following
The project file - it has been migrated from VS 2003 as a website project and has been chopped and changed up the different versions
Crystal Report runtime library/ some other library
Anyone with any ideas?
I had the same problem with a c++ project in Visual Studio 2019.
The following solution worked for me:
Close Visual Studio.
Go to the project's root folder and delete the .vs directory.
Start Visual Studio and open the solution.
The build should now work.
I have been getting this a lot lately. I've been having to create a new file and move the code to the new file to get around it.
I fixed it by deleting the solution's suo file (as far as I can tell, it just stores info like what files are open in the IDE and stuff, and deleting it does no real damage).
My file was seemingly corrupt. (The IDE wouldn't remember what files were open when restarting. It was 1.7MB in size, which seems large, even for my 40 project solution, which rarely has more than 50 files open at once.)
Edit: I just recently had to do this in VS2017 but for another reason, it was taking longer to build and took 5+ minutes to stop a debug session, deleting that pesky suo file fixed it right up, now anytime VS acts weird deleting SUO is my first port of call.
I removed the csproj.user files and it worked for me.
In some other cases, to fix this error, I go to Web tab in the project properties and check "Use Visual Studio Development Server" and "Auto-assign Port". After that I need to rebuild the project and restart VS
This solved my problem:
Start —> Run —> regsvr32 %SystemRoot%\System32\msxml3.dll
Start —> Run —> regsvr32 %SystemRoot%\SysWOW64\msxml3.dll
Before this I tried the above solution from Simon, but didn't work for me!
Perhaps combining these two solutions did the job!
Sorry to revive a dead thread but i solved this on VS2017 by deleting the project template cache and item template cache folders in
%localappdata%\Microsoft\VisualStudio\[BUILD]
Then resetting the visual studio settings via
Tools>Import and export settings>reset all settings
Also ive heard turning off "Lightweight solution load for all projects" can help.
Doh! In case anyone else gets this error when trying to attach to an IIS Website.
Triple check that your hostname is correct, I had forgotten a '/' in (e.g.) http://my.testsite.com
Try this before re-installing Visual Studio like I did.. Terrible error message..
I wanted to add that I encountered this error when opening designer file in WinForms app. My issue was that one of the references in the project was referencing itself. Apparently this can happen as mentioned here
https://social.msdn.microsoft.com/Forums/office/en-US/00aede04-d8cd-4475-8114-4b4792261052/winforms-designer-error-hresult-efail-has-been-returned-from-a-call-to-a-com-component
I removed the reference and it is working fine.
Maybe this page helps:
Scenario Two:
The Microsoft Visual Studio 2010 IDE crashes while creating OR debugging a web application project.
This above error occurs because of corrupted Cache of Visual Studio 2010. In order to resolve the issue just delete the project Cache from the below location:
C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache
C:\Program Files(x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplatesCache
Then run devenv.exe /setup to re-build the cache.
I tried all of the above solutions none work for me, I found the solution here
Open ActivityLog.xml by going into
C:\Users\{UserName}\AppData\Roaming\Microsoft\VisualStudio\15.{Id}
Check if error states that
"CreateInstance failed for package
[ReferenceManagerPackage]Source: 'mscorlib' Description: Could not load type
'Microsoft.VisualStudio.Shell.Interop.' from assembly
'Microsoft.VisualStudio.Shell.Interop.11.0'
Then run this gacutil command through VS Cmd prompt (admin mode):
Navigate to
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies
Run gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
It seems that to bring up the Add Reference dialog in Visual Studio 2017 the Microsoft.VisualStudio.Shell.Interop.11.0.dll needs to be regsitered in the GAC. You can follow these steps to register this assembly in the GAC:
Open the Develop Command Prompt for VS2017 (ensure you run the as administrator otherwise the GAC registration may fail)
Change the current directory to the PublicAssemblies folder for your Visual Studio 2017 installation. Mine was:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\PublicAssemblies
Run the following command to register the assembly in the GAC:
gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\PublicAssemblies>gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0
Copyright (c) Microsoft Corporation. All rights reserved.
Assembly successfully added to the cache
Now restart VS2017 and try to add a reference to your project again and you should see the Add Reference dialog appear.
For more clarification please follow below link
https://camerondwyer.com/2017/05/03/how-to-fix-the-operation-could-not-be-completed-error-adding-reference-to-visual-studio-2017/#more-2286
I found the solution below on https://developercommunity.visualstudio.com/content/problem/260196/add-a-reference-raise-error-error-hresult-e-fail-h.html address.
It worked for me in VS 2019:
1 Open "Developer Command Prompt for VS 2017" as Admin
2 CD into "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies"
3 Run "gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll"
After a restart, it all worked well.
I had the same issue after an upgrade from VS2013 to VS2015.
The project I was working at referenced itself. While VS2013 didn't care, VS2015 didn't like that and I got that error. After deleting the reference, the error was gone. It took me around 4 hours to find that out...
Just delete packages folder.That helped me
Root Cause:
Microsoft.VisualStudio.Shell.Interop.11.0.dll is missing from GAC.
Solution:
1. Go to start menu and Open Command Prompt for Visual Studio
2. Enter command gacutil -i Microsoft.VisualStudio.Shell.Interop.11.0.dll
3. If in case your system unable to find this dll file then you may download it from Nuget package manager and then can provide the path of dll
All set! hit enter and you're done!
In my case, it seems it was because I stashed some files, but some related windows remained open.
Closing all windows and rebuilding solution fixed it for me.
I wrote a simple program to open different folder while clicking on some specific buttons. I made the file properties as "content" and "copy if newer" to make deployment. So if I installed the exe file in the other software it actually install all of its resources and run the program fine.
So, this is all about my program. While developing this sometimes if I run the program to check, it showed the error
"HRESULT E_FAIL has been returned from a call to a COM component"
and I could not open the designer view. But Somehow I got an easy solution for me. I am not sure whether it will work for other or not.
Here is the solution:
Copy the whole application folder to another location. click on the application file from there.
it will not work since it is just a copy and you will not see the designer
From the solution explorer delete the form1.vb ( or may be a different name if it was changed during developing)
In the solution explorer>right click>add an existing item> browse the file Form1.vb from where the folder is copied ( orginal location)
run the program in the new location. It will work
The problem with this solution if you want to add something and after running the program you find the same error, you have to copy the whole application folder in another location again and follow the above steps
Not sure about the exact reproduction steps for the error (HRESULT E_FAIL has been returned from a call to a COM component), but the solution for me was:
Close Visual Studio and Repair it through Control Panel.
Restart system
After the restart, the error was gone.
The error occurred for me after I installed the latest Windows 10 SDK. I was getting the error while building a C++ project using SDK 8.1. In Project properties, I switch to latest 10 SDK. rebuild. That worked. Changed back to 8.1. Rebuild. No error.
Steps to resolve the issue:
1.Open your solution/Web Application in VS 2012 in administrator mode.
2.Go to IIS and Note down the settings for your application (e.g.Virtual directory name, Physical Path, Authentication setting and App pool used).
3.Remove (right click and select Remove) your application from Default Web Site. Refresh IIS.
4.Go back to VS 2012 and open settings (right click and select properties) for your web application.
5.Select Web.In Servers section make sure you have selected "Use Local IIS Web Server".
6.In Project Url textbox enter your application path (http://localhost/Application Path). Click on Create Virtual Directory.
7.Go to IIS and apply settings noted in step 2. Refresh IIS.
8.Go to VS 2012 and set this project as startup Project with appropriate page as startup page.
9.Click run button to start project in debug mode.
This resolved issue for me for web application which was migrated from VS 2010 to 2012.Hope this helps anyone looking for specific issue.
My machine configuration is:
IIS 7.5.7600.16385
VS 2012 Professional
Windows 7 Enterprise (Version 6.1 - Build 7601:Service Pack 1)
This happens in our TFS build server some times (Gated check in). It is about workspace folder. I don't know why but workspace folder access sometimes corrupt. What I am doing to fix issue is deleting TFS build workspaces and deleting relevant workspace folders. TFS build machine then create new workspaces for itself and problem is fixed.
Tousif Ahmed's solution should work for local builds. Copy application folder to another place should do the same thing what I am doing in TFS build machine.
In my case, it appears that this message can be issued by Intellisense in Visual Studio 2013. The screenshot below shows the error at the bottom of VisualStudio 2013 after the first load of a customer project.
I started googling what causes this error, and decided to try deleteing the user.vxproj files as mentioned above. I found however that the project built with no issues, then after exiting and re-loading the project, I no longer received the error. So I'm assuming in my case, it was some corruption due to moving the project from the customers directory tree structure to my local development disk tree structure. The key here is that in my case, the problem was transient. I did NOTHING and the problem appeared to resolve itself. (Not generally a desirable thing as I didn't fix anything so it might come back).
I recently spent about 3 hours trying to fix this issue on my ASP.NET app running on local IIS. I had 'Override application root URL' specified and I specified the url with an ending forward slash (/) such as http://my.dev.com/. If I saved the project options and came back in it would show the overrided root url as http://http://my.dev.com. Once I removed the last forward slash it started to behave ok and the error went away.
HRESULT E_FAIL has been returned from a call to a COM component
In my case, it was because i had differents projects with same GUID in my solution. (Project was created by copy/paste)
My problem manifested with opening Win10 appxmanifest file (no pun intended). Simply installing Windows 10 tools and SDK (go to New->Project->Select Windows->Install Tools) fixed it.
Add on development initiated on x86 architecture or 64 bit system then it will run on 32bit system also.
but if you Add on development initiated on 32 bit system and then you want to do changes on source code in 64 bit
Note: if you are connected SAP Licence on server system then set the port and set server name through service manager otherwise System will give error:
Connection Context :- Retrieving the COM class factory for component
with CLSID {632F4591-AA62-4219-8FB6-22BCF5F60090} failed due to the
following error: 80040154 Class not registered (Exception from
HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
I fixed the same issue by deleting ComponentModelCache folder
Close Visual Studio (if you haven’t done so already out of despair)
Open a file explorer window and navigate toyour AppData folder. You can get there by:
In the search bar, type %APPDATA%/.. and press enter
Alternatively, navigate to C:\Users\\AppData
Go into Local\Microsoft\VisualStudio\<version> where is 12.0 for Visual Studio 2013.
Delete the ComponentModelCache folder.
From here: http://withmartin.net/how-visual-studios-component-model-cache-can-be-a-pain/
I faced the same issue in Visual Studio 2017,
Do follow these steps:
Start —> Run —> regsvr32 %SystemRoot%\System32\msxml3.dll
Start —> Run —> regsvr32 %SystemRoot%\SysWOW64\msxml3.dll
Clean the Project.
Restart visual studio.
Step 1 and 2 were copied from Besnik Kastrati post.
I find this answer
click Ctrl+Alt+J
click (...) in the top
now you can add dll from Browse , .Net or another
After clicking the OK button click at (add to references in selected Project in solution explorer) (this is a green plus "+" button)
I got this error when trying to install a nuget package that I had previously downloaded and installed in another project.
Clicking Clear all NuGet Cache(s) under Tools > Options > NuGet Package Manager solved this for me
I encountered this error after installing VS2019 but while trying to open a large solution (20+ projects), with both vcxproj and csproj projects, that target VS2015. The csproj all loaded fine, while the vcxproj all failed with the OP's error. Deleting the .vs folder did not work.
What did work was setting VC++'s "Fallback Location", under the "Browsing Database Fallback" settings.
Tools (menu)
-Options...
--Text Editor
---C/C++
---Advanced
----Browsing Database Fallback
-----Fallback Location
I set mine to D:\VC++\v16. Where I use v140 for VS2015 and v141 for VS2017. Also set "Always Use" and "Do not warn".

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