Can't create or open web applications - visual-studio

I'm using VS 2013 Pro and having big problems. Opening an exsiting Web application and creating new web applications throws errors, rendering VS completely useless.
I will try to describe the problems, details about what might be causing the problem and what I've tried to fix the problem.
The problems
1) When I try to open an existing web application, I get an error saying:
Creation of the virtual directory http://localhost:1234/ failed with the error: Unable to access the IIS metabase. You do not have sufficient privilege to access IIS web sites on your machine.
2) When I try to create a new web application, I get an error saying:
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
Details
During the weekend the internal IT department, made a change to the network. The "My Documents" folder i stored on a network drive. The IT department changed the path of the "My Documents" folder. Visual Studio has some setting files which are stored in "My Documents" and it might not have updated the path to the folder, causing the error.
What I have tried
Ran Visual Studio as Administrator
Repaired Visual Studio from "Add/remove programs"
Uninstalled and reinstalled Visual Studio
Uninstalled Resharper
Tried this Can't create new projects nor items: Visual Studio 2010 dialog initialization exception
Running c:\windows\microsoft.net\framework\v2.0.50727\aspnet_regiis.exe -ga ASPNET (gave the error: An error has occurred: 0x800706fc The trust relationship between the primary dom
ain and the trusted domain failed.)
Nothing has fixed the problem. Please heeeeelp!!!

Solution 1:
Control Panel -> Programs and Features -> Turn Windows Features on or off... inside that, we had to select Internet Information Services -> Web Management Tools -> IIS 6 Management Compatibility -> IIS Metabse and IIS 6 configuration compatibility.
Solution 2:
Edit the web application's project file with a text editor and change this line from True to False:
<UseIIS>True</UseIIS>
Solution 3:
Grant IIS AppPool identity permissions to the %systemroot%\inetsrv\config
Solution 4:
run in command prompt:
aspnet_regiis -i or aspnet_regiis.exe -ga

Related

Visual Studio Encounters 403 Error Connecting to DevOps Project

One of my developers is receiving the following message from Visual Studio 2017 Enterprise when trying to connect to one of our DevOps projects and we've tried everything we can think of and everything we've found from searching Stack Overflow and the internet in general just hasn't worked.
Here's the error from Visual Studio:
We could not add the account
The browser based authentication dialog failed to complete. Reason:
The server understood the request, but is refusing to fulfill it.
What we've tried
Deleting the folders Team Foundation, VisualStudio, VisualStudio Services, VSCommon, and vshub located in %userprofile%\AppData\Local\Microsoft
Deleting everything from Windows Credential Manager.
Authenticating via browser (success).
Repository is hosted on dev.azure.com.
From what I understand, this is an HTTP 403 error which means the user successfully authenticated and that they just don't have permissions to view the requested resource. Permissions in DevOps are identical to other users that don't have any issues. We have 1 group for the developers and if you're in that group, you have all necessary permissions so I'm confident their permissions are identical to the other devs that aren't having any issues.
I think I understand what this error means for websites in general, however I seem to be at a loss for what either Visual Studio or Azure DevOps wants us to do specifically to alleviate this error.
The browser based authentication dialog failed to complete.
Once it was a known issue in old VS2015 and VS2017, but I can't reproduce it on my latest VS2017 15.9.23. Here're some tips you can follow to resolve that issue:
1.Update VS2017 to latest 15.9.23 version.
2.Navigate to VS installation path C:\Program Files (x86)\Microsoft Visual Studio\2017\VsEdition\Common7\IDE and run devenv.exe /resetsettings and devenv.exe /resetuserdata to reset the VS settings and userdata. From Joyce Lin.
3.Check your registry settings and empty the China endpoint if it exists. Check this one. Now try to log in the VS...
4.If the issue persists after #3, you can:
Open Visual Studio
Click Help > Send Feedback > Report a problem
An instance of Visual Studio Feedback will open
Attempt to sign in using your MS account
If sign in is successful, check if you are signed into Visual Studio
Hint from Nathan Timblin.
Hope all above helps :)

Visual studio 2015 / TFS Access is denied

When I try to add new item to project in visual studio 2015 I always get this message
Access is denied.
The file is created and added to the project, but it is not added to Source Control, although the project is in source control. However, when I try to manually add the file to source control by right-clicking in Solution Explorer -> Add to source control, the file is added to TFS.
I have upgraded to windows 10 and installed Visual Studio 2015. I'm working on existing solution in C:\Projects\ and the solution was created and added to source control before I upgraded.
EDIT: If I run VS in admin mode, the error is gone
Access is denied. returns very little information. For more detail info, you can repro the error and run a procmon trace using Process Monitor tool filtered on DEVENV.EXE. Detail for how to use the tool: http://www.mztools.com/articles/2008/MZ2008024.aspx
Normally, this error message can be corrected with the followings:
Add your Windows account to the Administrators group on the local PC
Run your Visual Studio in Administrator mode.
Check if your project folder is set to read only.

The Web Server Could Not Find the Requested Resource visual studio debugging

Issue
I have a .net 4.0 Web Application running in visual studio 2012, every time I go to debug the site i'm receiving the following error:
The Web Server Could Not Find the Requested Resource
What I've tried
I've followed microsoft's website with solutions: msdn
From a command prompt window, run the following command: systemroot\Microsoft.NET\Framework\ versionNumber \aspnet_regiis -i
I've also attempted to remove the .csproj.user files
Since we use Source Control i've deleted all items, the site and apppool and reconfigured from scratch.
AppPool is set to allow 32-bit applications
All to no avail...Anyone have a solution that might solve this visual studio debugging nightmare for me?
Steps:
Close all solutions in Visual Studio
open IIS7 (run > inetmgr)
Click your top node (computer name)
Open the "ISAPI and CGI Restrictions" option
check if your .Net version has the correct restriction (for example, if you're working with 4.0 is should be on "Allowed")
I was getting the same error when i was running the ASP.NET project from the IIS. I resolved this issue by configuring IIS.
Go to run
type appwiz.cpl and press enter.
Look for "Turn windows features on or off" and click on it
now windows will open for Turn windows features on or off
look for Internet Information service and select that option.
go to world wide web service under the Internet Information service branch
expand Application development feature
Select all the ASP and .net version. and click on OK.
now try running the application from asp.net , it will work :)
I had the same symptoms but a completely different problem. I had attempted to install Url Scan and it didn't seem to work correctly as I could not find the .ini file to edit settings within. I had forgotten that I had installed it, but it appears by default it will prevent debugging from working.
Uninstalling Url Scan solved the issue for me. To uninstall it I had to right-click on the .msi file and choose Uninstall. Url Scan did not show up under the "Add or remove programs" section.

Unable to use IIS7 with Visual Studio 2010, MVC2.0 and NET4

Here is my environment
Windows7, Visual Studio 2010, MVC2.0 and NET4
My default web site is configured to use ASP.NET v4.0 application pool.
Here is an easy way to reproduce my problem
Create a new MVC2 application
Open the properties Window
Go to the Web tab
Check "Use IIS Local Web Server"
Click on "Create Virtual Directory" button
I get this error message
To access local IIS Web Sites, you must install the following IIS components:
In addition, you must run visual Studio in the context of an Administrator account
For more information, press F1
Notice the blank line after "...the following IIS components:"
I am running VS2010 as administrator
Pressing F1 does not bring any help
I checked my Windows eventlog files and found that my metabase was corrupted
(I thought we get rid of this in IIS7 but it looks like it is still here...)
I used this Microsoft article to restore it from an old version and now everything is working
Hope this can help somebody else
Have you tried running VS as administrator?
Right click your VS shortcut and select "Run as Administrator"
I had the same error message, in my case with VS2008, Windows 7 + IIS7, when trying to add an existing web site to a solution. I think this is one of those error messages where what it states can be a big red herring, i.e. it doesn't necessarily have anything to do with running as an administrator or not having components installed.
In my case, the web site had an HTTP binding in which the hostname was set to "localhost". Once I cleared that, it worked fine. Don't ask me why I put "localhost" in there, it just seemed to make sense at the time.
My internet hunting also turned up this brief entry, which did not work for me.

Error message "unable to open web site" with VS 2008 on Vista

I am trying to open a project in VS 2008 and my domain account it in the administrator group. I get this message:
"Unable to open the Web site
'http://locahost'. To access Web
sites on thie local IIS Web server,
you must run Visual Studio under an
Administrator account in order to have
access to the IIS metabase.
Alternatively, instll FrontPage Server
Extensions (FPSE) and then grant FPSE
access to users who will run Visual
Studio"
Any body know what I need to do to fix this problem. I have tried modifying the shortcut to run as administrator but shouldn't have to do that if I am an admin on my machine.
I uninstalled IIS and then reinstalled using only the bear minimums and it worked.
What worked for me:
- Windows 7 IIS Manager
- Delete other websites in the list under 'Sites'
- Right click the site
- Edit Bindings
- The 'host name' property was empty. Once I typed the name of the website there, I was able to load my site through Visual Studio 2008.
Open Control Panel-> Programs and Features->Turn Windows features on or off. Under the list of features open Internet Information Services tree and then open Web Management Tools and then select IIS 6 Management Compatibility checkbox. Click OK button and install the selected feature of IIS.
link: http://geekswithblogs.net/technetbytes/archive/2011/10/11/147255.aspx
Right click over the shortcut, and in Properties in the Compatibility tab, select Run As Administrator.
Also confirm IIS is installed. It is not installed by default on Vista. You have to go and Add/Remove Windows Components.
See here.
You might not have IIS setup properly on the local machine, I would verify your IIS configuration before continuing. You can always create a website or webapplication that runs through cassini instead and provide a folder path vs a IIS path.
P.S. Even if you are a machine administrator, with vista if the access restrictions are on you must still always specify that you wish to run the application under an administrator context.

Resources