IIS Express does not restart in Visual Studio 2019 - asp.net-mvc

In general, there is a website(ASP .NET MVC 5) that I run in Visual Studio.
The first time everything starts clearly, and if you restart the debug session, then the second time it does not start. If you look at the tray, then IIS Express is absent there.
Only restarting Visual Studio solves the problem, but again, only 1 time and you have to restart the studio each time.
What could be the problem?

This happened exactly to me when I upgrade a solution from VS 2010 to VS 2017.
I searched for solutions and only found: remove the .vs directory from the solution, remove the IIS Express directory from the documents or reinstall VS.
The problem was that the solution has multiple web projects that can run. And in one of them, in the .csproj, there was this configuration:
<UseIISExpress>false</UseIISExpress>
<UseIIS>False</UseIIS>
When I set it to true, the problem was gone.
Regards.

Related

Visual Studio sometimes detects configuration issue on jenkins CI server

I have Jenkins CI server which builds various .net projects. The server is on Virtual Machine, connected to ActiveDirectory and Jenkins is running in the context of domain user which is also a local administrator.
Software used:
Windows 10 Professional
Visual Studio 2015 14.0.25431.01 Update 3
Jenkins 1.625.3
Solutions are build using devenv.com (currently msbuild is not an option), e.g.:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.com" "xxxxx.sln" /rebuild "Release|Any CPU"
My issue is, that quite often I receive an error, just after running devenv.com:
Microsoft Visual Studio has detected a configuration issue. To correct this, please restart as Administrator. For more information please visit: http://go.microsoft.com/fwlink/?LinkId=659046Build
It started to happen after one of Windows 10 updates. I found out, that when someone is log in to build server with the remote desktop using the same domain account, the builds run OK. After logout, the builds run OK for some time and then the errors are back.
Any clue what's going on?
It may be related to this apparent bug in a recent Windows update:
Connect: Visual Studio 2015 and SSMS 2016 RTM (VS 2015 shell) not running under "Run as different user" on Windows 10 Anniversary, Windows 2016 CTP 5
UPDATE 2017-09-08
As #Florian points out, the above link is broken. I can't even find the Connect issue cached on Google, Bing or archive.org.
The Connect issue Unable to start SSMS as another user (cached copy on archive.org) makes me think it would be worth checking whether the problem resolves after updating Windows 10 to 1703 (Creators Update) and ensuring that April 25, 2017—KB4016240 (OS Build 15063.250) has been applied. If this works, anyone running Jenkins on Windows Server 2016 will have to wait for Microsoft to publish 1703 and KB4016240 (or equivalent) for that OS.
Excerpts from Connect page "Unable to start SSMS as another user". I have bolded the error details, which match those in the original question (except for the LinkId in the supplied URL) even though the product is SSMS rather than VS:
Version: SQL Server 2016 CTP3
Operating System: Windows 10
Steps to Reproduce:
Right-click SQL Server Management Studio, select "More", then "Run as
a different user"
Actual Results:
Error message: "This task requires the application to have elevated
permissions" with two options: Restart under different credentials,
and Cancel the task and return to Microsoft SQL Server Management
Studio. Pressing either option closes the window with no further
result. Error information is:
Microsoft SQL Server Management Studio has detected a configuration issue. To correct this, please restart as Administrator. For more information please visit: http://go.microsoft.com/fwlink/?LinkId=647011.
When I go to that page and try the fix suggested there, I can't find
ieproxy.dll. The fix is for Windows 7 / Internet Explorer 8, and I'm
on Windows 10 with Internet Explorer 11, so that may be why it's not
there.
[...]
Posted by Microsoft on 4/28/2017 at 6:26 PM
Hi Jake, It turned out that this issue has been resolved (on the Windows side) very recently - like 3 days ago :)
If you are running Win10 "1703", just make sure you get the latest
updates (specifically, KB4016240) and you should be able to run
ssms.exe using "runas" just fine. This will work with any version of
SSMS.
Currently, the fix is not available on older versions of Win10 (e.g.
1607) or WS2016 (also 1607).
Thanks,
-Matteo
[...]
Posted by Microsoft on 4/27/2017 at 7:35 PM
Hi Jake, Yes, we are aware of this issue (in Windows 10).
We've engaged with the Visual Studio and Windows folks (which is there
the issue is) and hopefully will have a way to fix this issue in SSMS
(you should not need an updated SSMS, just an update in Windows 10).
I'm going to keep this issue open until I have more concrete updates
on it.
Thanks,
-Matteo
If the Windows updates do not solve the problem or are not available to you, I would suggest trying repair operations on Windows as well as Visual Studio.
I'm running into the same error after updating my Windows 10 to 1607, in that I cannot run Visual Studio as a different user. I'm not building solutions at the time though, but still running the VS program as I think you would be calling.
Using this command: runas /netonly /user:domain \ account devenv.exe
as outlined here Unable to launch Visual Studio 2015 as a different user works for me. Not as convenient but does the trick.

IIS Express will not start when running copy of project on different computer

I have created a brand new ASP.NET MVC 5 project in VS2015 Enterprise (update 3). It runs as expected on that machine. However, when I copy/paste the whole project to a different machine running VS2015 community edition (update 3), the site fails to load and I get the error message:
The program '[1648] iisexpress.exe has exited with code 0 (0x0).
Here's the kicker - Creating a new ASP.NET MVC 5 project in VS community edition and copy/pasting and running it in VS2015 enterprise in the same way, however, works normally without any configuration changes. I have recreated the files in the users\documents\IISExpress folder as pointed out by other SO questions, tried changing ports, but to no avail.
EDIT: IIS immediately fails on launching, by the way. It sounds like a config issue, but I'm not sure what to check in this case.
I got the same issue, what i did is just close all the visual studio instances and in your project folder clear the .vs file(mostly it's Hidden). after that open your project.

Start debugging after stop hangs on Visual Studio

I start debuging a mvc project. If I stop and start debugging again, visual studio hangs. If I change port and start debugging, it's fine.
The problem: I can't stop and start debugging until I change the port. How can I solve this issue ?
I have tested this in Vs 2013 Ultimate and Vs 2015 Community.
IIS Express version: 10
Clear site bindings on applicationhost.config and be sure you don't have same port numbers on projects.
For Vs 2015 applicationhost.config is at \ProjectDirectory\.vs\config.

TFS 2012 Uninstall does not remove the port 8080 bindings

Quick background. My client uses Visual Studio 2010 for their website. It was ported onto a new machine, and I had to do some extensive work to get all of the 3rd party controls and add-ons to work. They then requested source control, so using their MSDN license I pulled down and installed TFS 2012 on their machine. Everything installed correctly, and seemed to work until I went to add the existing VS2010 project to TFS2012, and I got an error that when traced back, basically told me that I would not be able to use TFS 2012 and VS2010 together. I weighed the choices, updating the project to VS2012, or uninstalling TFS 2012 and installing TFS2010, and decided the TFS route was the way to go, as I did not want to screw around with all the add-ons again. TFS2012 uninstalled fine, and TFS2010 installed fine.
When I went to start configuring TFS2010, I got an error ([ Application Tier ] TF255297: The Web site found has bindings that conflict with the bindings chosen for the Web site for Team Foundation Server. You must manually resolve the conflict between the bindings.) basically telling me the binding were not removed for the TFS2012 install. I looked in IIS and there is nothing in there using port 8080.
So my question is, how do I find out where the bindings are in use. I tried the netstat commands, and did not find anything using port 8080. I am kind of dead in the water here, so any help that is offered would be greatly appreciated.

Error after installing TFS 2012 - Update 2

I have one TFS 2012 environment with Update 1 and today I updated this environment to Update 2, the installation is completed with sucess, but my portal web access is not working and is returning the bellow error
Could not load file or assembly 'System.Web.WebPages.Deployment, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
Before the update, my environment was running smoothly but now after the installationd Updete 2 is not working
This error is about ASP NET MVC, all right?
Can you help me?
I did not installed update 2 yet myself but did you check your administration console? And check also your event viewer, maybe you'll find interesting information/errors there that can help you out.
I've installed update 2 but haven't encountered the issue you have. I did have some issues and ended up turning off the application pools for the Portal and disabling TFS on the server by using the TFSServiceControl quiesce command before installing the update.
One thing I have noticed is that TFS Update 2 installs a .Net 4.0 version of 'System.Web.WebPages.Deployment' into the GAC an the location:
C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages.Deployment\v4.0_2.0.0.0__31bf3856ad364e35
Assuming you are running x64 there is a .Net 2.0 version of this assembly in
C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies
Alternatively for x32 it should be in
C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies
I would suggest copying the .Net 2.0 version of this DLL from this location to the TFS Portal's bin folder and seeing if this resolves the issue.
This looks like a classic hunt and peck from the old days. I have no idea what types of installations this affects, but mine was a 2008 x64. Basically, I went to the web.config of the team (program files, long path, 11.0, web...\bin) and enabled error reporting.
Then I loaded it with IE in localhost addressing to get to the team project. Basically, it's looking for a bunch of .NET 2.0 DLLs. Copy each one it is looking for (find them doing a dir /s off the root, there are a few) to the local bin folder.
Thought these days had passed. Hope this helps someone.
I had exactly the same problem after upgrading TFS2012 RTM to update 4.
I was able to resolve the problem by amending the user of the Application Pool to a TFS Administrator user (it was set as Network Service I think).

Resources