I know there are a few topics similar to this but none have my main issue in mind. I don't want to run Visual Studio 2017 as Administrator. Why should we be forced to run it this way? In doing so you lose a few abilities:
ability to simply drag files to the solution explorer to add them to your project.
Cleanly stopping a debugging session by closing IE or stopping the debugging within VS (and it will close IE for you).
There may be others
For posterity the error is:
Unable to start debugging on the web server. IIS does not list
a web site that matches the launched URL.
I have already followed the advice thusly:
Start >> Control Panel >> Click Programs
Click Turn Windows features on or off.
In the User Account Control dialog box, click Continue
Expand Internet Information Services, expand Web Management Tools, and then expand IIS 6 Management Compatibility
Click to select the IIS Metabase and IIS 6 configuration compatibility check box, and then click OK.
I do not wish to use the IIS Express included with VS but the real local IIS I have installed.
This did not solve the issue. I have yet to find a solution that will allow me (us) to run Visual Studio 2017 and use local IIS without running it as administrator. Can anyone provide a solution?
I'll reference this article as similar but it doesn't resolve the base issue: Debugging website on local IIS without administrative privileges
Refer: Why run Visual Studio as "Run as Administrator"?
Its mentioned with MSDN reference that Administrator permissions are required If we need for
Debugging applications that a run under a different user account, such
as ASP.NET websites.
Related
I know there's a way to, in Visual Studio, test a change by getting the page running in the browser, and then by just refreshing the browser page rather than by rerunning the application. But although it was working before, it isn't working now, and I'm fairly new to MVC, so I don't remember what I was doing to make it work. Instead, I'm having to actually re-run the application each time.
Specifically, I 1) run from VS, 2) copy the URL from the webpage I just launched, 3) stop debugging from VS (and the browser closes), 4) paste that URL into a new browser window and hit enter, 5) get "This webpage is not available" from Chrome and "This page can't be displayed" from IE.
I'm using VS Express 2013, and was also using that when it was working. I've tried with both IE and Chrome, and I've rebooted my computer and cleared my cache. What did I do wrong / how do I fix it? Thanks!!
Install IIS locally on the machine you run visual studio on. Create a new site in IIS and point it's path to the path of your MVC project. Change the application pool for it to use .net 4 and set the identity on the application pool to your user account.
Then give it a binding of something like localdev and a host header in your hosts file, then just build the site and go to http colon localdev in the browser.
It will reset the app pool automatically when the build changes.
The way I build sites is I virtualize. I use Oracle VirtualBox and install windows server 2008 r2 (or windows 7 x64) to a virtual machine in virtual box. Then I install Sql Server 2014 and Visual Studio 2013. Then I install Toirtoise SVN and Visual SVN extensions and get the source code from our sub version server and set up websites in IIS similar to how we set them up in production. Then when I want to debug code I just attach the debugger to ws3p.exe.
I searched SO for an answer before, but couldn't find one until after I'd posted mine (doh!). This question has the answer I wanted. Default MVC5 Application will not run out of debug mode in browser VS Express 2013
The issue was that I couldn't edit code (I could edit cshtml) when the debugger was still running. You can disconnect the running debugger and still keep the IIS session active if you uncheck Project Properties / Web / Enable Edit and Continue.
I am working with visual studio 2013 in c#. My application contains three project in the same folder: client side, database side and web service side.
When I run the application from within visual studio, it runs very well and all the features of the application are functioning. When I run the exe file located in the bin/debug folder, it runs only when VS is open. If VS is closed it runs only the client side and a message is shown
impossible to connect to the server.
How can I solve this?
When VS is open, it runs the server/web service, and your client. Running it from the commandline will require starting your server and web service side manually, and then starting the client.
If you don't have IIS manager installed you can launch IIS directly from iisexpress.exe.
It should be in C:\Program Files (x86)\IIS Express\iisexpress.exe, so just go ahead and run it.
Then you should be able to run your application.
To start IIS from the IIS manager go to Run (press Windows+R), and type in inetmgr.
This will open IIS manager, from there you can start it (forgive me for not being too specific, I don't have it currently installed. I believe you have a Start button at the side-panel. I hope someone in the comments could chime in or just edit this answer. If not I will install & update later).
After it is on you should be then able to run your executable successfully.
If your command-line can't find inetmgr, see my other answer here.
However if you do want to have the IIS manager you can install it + other IIS features easily:
Go to Computer → Uninstall or change a program.
At the side click on "Turn WIndows features on or off".
Inside "Internet Information Services" have your pick of whatever you want.
When you run in Visual Studio 2013, by default it uses its IIS Express as a webserver. You can set it to use IIS instead. (If you don't already have IIS installed, you'll need to install it using add/remove Windows components etc--google for more info on that if needed. Make sure you drill down to include ASP.NET under the IIS bits and pieces.)
To use IIS instead of the Visual Studio development webserver, right-click the project in Solution Explorer, and click the Web tab:
Select External Host in the dropdown, and enter a URL such as http://localhost/WebApp1. This is the virtual name by which IIS will access the files in your project folder. Earlier versions of Visual Studio included a button to create the virtual directory, but in 2013 you must create it yourself by running IIS Manager:
Enter the same virtual name you use in the project settings, and the physical path of your project:
Finally, right-click the newly created virtual directory and choose Convert to Application.
The website/webservice will now run under IIS, so will be available independently of Visual Studio.
What is the difference between using Visual Studio 2012 "Run as Administrator" mode and otherwise? Why do developers prefer using VS in administrator mode? What are the advantages/privileges that one gets?
I may be naive enough to ask this one but I am just curious. Thanks.
From MSDN: User Permissions and Visual Studio
You can do nearly everything in the Visual Studio IDE as a normal
user, but, you need administrator permissions to complete the
following tasks:
Installing Visual Studio.
Upgrading from a trial edition of Visual Studio.
Installing, updating, or removing local Help content.
Developing solutions for SharePoint 2010.
Acquiring a developer license for Windows Store.
Adding classic COM controls to the Toolbox.
Installing and using add-ins that were written by using classic COM in the IDE.
Using post-build events that register a component.
Including a registration step when you build C++ projects.
Debugging applications that run with elevated permissions.
Debugging applications that a run under a different user account, such as ASP.NET websites.
Debugging in Zone for XAML Browser Applications (XBAP).
Using the emulator to debug cloud service projects for Windows Azure.
Configuring a firewall for remote debugging.
Profiling an application.
Deploying a web application to Internet Information Services (IIS) on a local computer.
Changing how you participate in the Visual Studio Customer Experience Program.
Windows Vista introduced User Account Control which means that you are running all programs as a standard user even if you are an admin. There are certain things that you in VS that requires you to be running as an admin, not a standard user. For example running Windows Azure emulators, asp.net dev server, etc.
You can run VS as a standard user but sooner or later you will run into issues.
Is there a way to set up Remote Debugging (Msvscom.exe) on a machine that does not have Visual Studio installed?
I would like to attach to the service running on the VM so I can debug an issue in the code. I've done this before but both machines have had VS installed.
The Dev box is running Visual Studio 2010/Windows 7. The VM is running Windows 7 without Visual Studio.
I'm going to resurrect this because anyone who's tried to do this knows it's a complete pain in the ass every time, and that it changes slightly with every possible combination of host/remote system you can have.
Visual Studio Remote Tools Links:
Visual Studio 2010 remote debugger. (Working as of 21/Oct/2016)
Visual Studio 2013 remote tools (working as of 21/Oct/2016)
Visual Studio 2015 remote tools x86 - Direct download link
Visual Studio 2015 remote tools x64 - Direct download link
Visual Studio Tools (Thanks Robo Burned)
Visual Studio 2017 Remote Tools x64 - Direct download link (Thanks Isaac Baker)
Visual Studio 2017 Remote Tools x86 - Direct download link (Thanks Isaac Baker)
Visual Studio 2019 Remote Tools - download link
This is the setup I succeeded with today:
Host (Dev) Machine:
Windows 7 Ultimate SP1 x64. Running Visual Studio 2010, .NET Framework 4.
Remote Machine:
Industrial/Factory Floor PC running Windows Embedded Standard 32-bit. It looks/feels exactly like Windows 7. Running SP1. Visual Studio is not installed. Has the .NET framework 4.
Network:
Both machines are on the same subnet. I access the remote machine via RDP and run my application that way.
Microsoft-Proprietary Follicle-Deterioration Implementation:
Make note of your dev machine's user name and password. For some reason you have to create exactly the same user name and password on the remote machine. Because Microsoft.
How I did it:
I downloaded the Visual Studio 2010 remote debugger from the link provided by #sJhonny. I had to switch off of Visual Studio 2013 in that article and over to 2010. If you care to go over the 2010 article with a fine-tooth comb to find the download, the link is right next to the "No one ever finds this helpful" link at the top. If not, just follow my link above.
Install that on the remote machine and run the configuration wizard. I left the defaults for the wizard:
"Run the 'Visual Studio ....." was checked off
Username is LocalSystem and password is blank
Allow only computers on the local network....
Run the Remote Debugger on the remote system and you'll see
Msvsmon started a new server named 'username#machinename...'
in the interface. So far so good. Run the application on the remote machine. On the dev machine, Ctrl+Alt+P in visual studio will open "Attach to Process" (It's also under the tools menu). I got a popup about my dev machine's firewall not being configured properly and was asked if I wanted to allow the connections etc... Say yes obviously.
Enter the 'username#machinename' combination into the qualifier box... press Refresh and pray a little. Pray a little more a lot harder and you should see a list of the processes running on the remote machine. Select your process and attach to it.
But my breakpoints don't work!? Of course they don't... because using the breakpoints in the same directory as the application on the remote machine would make too much sense. If you were lucky enough, you got warned about a breakpoint cache and got shown a dialog with a path.
The dialog mentions something about it being correct relative to the remote machine. It's lying. It has nothing to do with the remote machine except that it forced you to create a brand new user over there with the same name as your current user because Microsoft. To get your breakpoints to work, follow the path on your dev machine (customizable in Tools>Options>Debugging>Symbols: Cache symbols in this directory) and copy your application's .pdb files over to that directory. You have to copy them over with every new build, unless there's an option to do it automatically; I haven't checked because I have yet to stop celebrating my remote debugging success.
Everything should work now.
certainly there is.
You can install msvsmon without installing visual studio.
I've done this myself on several machines.
the tricky part lays in authorization- the user running VS on your local machine needs special priviliges on the remote machine.
ms has some articles explaining the details- http://msdn.microsoft.com/en-us/library/bt727f1t.aspx,
Update:
Here's the links for 2017 which are not obvious to find either.
Visual Studio Remote Tools Links x64 direct link
Visual Studio Remote Tools Links x86 direct link
Taken from:
how-to-implement-remote-debugging-in-visual-studio-2005
Let's consider an example to understand this situation clearly. Molly
Clark and Adam Barr are both employees at Adventure Works. Adventure
Works has a Microsoft Windows NT domain named adventure-works.com.
Adam is having trouble with some software that Molly wrote. Molly
would like to debug this software on Adam's computer. Molly and Adam
follow these steps:
Adam doesn't have the remote debugger on his computer. To set up the remote debugger, Molly decides to share out the Program
Files\Microsoft Visual Studio 8\Common7\IDE\Remote Debugger directory
on her computer. She creates a file share called Remote.
Adam runs \MollyComputerName\Remote\x86\Msvsmon.exe.
After the remote debugger starts, Adam clicks Permissions on the Tools menu to configure the remote debugger by using the Permissions
dialog box. He gives Molly permission to debug.
Note Adam could also configure the remote debugger by passing the /allow option when the remote debugger starts.
Molly starts Visual Studio 2005.
To open the Attach to Process dialog box, Molly clicks Attach to Process on the Tools menu.
Molly connects to Adam's computer by entering adventure-works.com\Adam#AdamComputerName in the Qualifier box.
Under Available Processes, Molly selects the worker process that her application is using and then clicks Attach.
Molly opens a browser and provides the URL to the remote application. The execution stops where the breakpoint is placed in
the application.
There's also another way which I prefer (if you have fast internet connection).
You don't have to download or install anything on remote desktop connection.
You can share your disk C: while connecting via Remote Desktop Connection.
On the remote desktop go to location (depending on your local location)
\\tsclient\C\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Remote Debugger\x64
(optional) Create shortcut to folder or msvsmon.exe on desktop
Run it remotely from your local disk via shared disk. (start can take few seconds depending on your connection quality)
Option2: Copy Remote Debugger\x64 or x86 folder to the remote location and use it.
I was able to get it working with asp.net core 2.1, the only difference from the answers above was that the process you attach to is dotnet.exe.
I'm trying to run the performance wizard on an ASP.Net website. However, whenever I try to start it I get the following error.
"The website contains unexpected information or you do not have permission to access the metabase. You must be a member of the Administrators group on the local computer to access the IIS matabase. Therefore, you cannot create or open a local IIS website. If you have Read, Write, and Modify Permissions for the folder where the files are located, you can create a file system website that points to the folder in order to proceed"
I am an Administrator on my machine. Tried googling but came up with nothing. Anyone run it before and know how to deal with it?
Update 2019: The link from msdn that answers this question is now a dead link, but can be found on wayback machine here:
https://web.archive.org/web/20160223061509/http://blogs.msdn.com/b/profiler/archive/2010/07/23/tip-fixing-vsperfaspnetcmd-metabase-errors.aspx.
This page says:
The information in the error is correct and it is worth checking to make sure that you are running from an elevated command prompt, but it does miss a common configuration issue. In order to query for information from the IIS metabase, certain IIS components need to be installed
To check this in Windows 7:
Open ‘Control Panel\Programs\Programs and Features’ (or run ‘appwiz.cpl’).
Choose ‘Turn Windows features on or off’.
In the ‘Internet Information Services’ section, make sure that the following options are selected.
The non-default options include:
IIS 6 Scripting Tools
IIS 6 WMI Compatibility
IIS Metabase and IIS 6 configuration compatibility
ASP.NET,
Windows Authentication
I was getting this error in Visual Studio 2012 on Win 8.1 64-bit and I already had the IIS 6 compatibility items installed.
To fix the issue, I had to make sure that Visual Studio was getting run as an Administrator. (Right click shortcut -> Properties -> Shortcut -> Advanced -> Run as administrator)