there was an error attaching the debugger to the role instance - azure

I am getting an Exception when I am trying debug my application on Emulator (Web Role).
you can see exception by clicking following link
Configuration which I am using Windows 7 pro, VS 2012 Pro, Azure SDK 1.8

Hope it might help others.
I Also had the similar problem and I restarted PC and **Run Visual Studio as Administrator**.
And let Visual Studio start the emulator with same privilege resolved the issue.
I was using Visual 2013 and Web API application under IIS Express.

Do you have IIS added? Most likely it's already installed but you've to enable it via Add Windows Compoenents on Control Panel...

I had this same issue all of a sudden, luckly I remember changing the ServiceDefinition.csdef file. I rolled this back to an earlier version and the debugger ran again correctly. The only thing I changed in the 'broken' version was instance size from small to medium.

Go to visual studio installer(search it from window's start)
and update the visual studio.
After updating, hit modify
button, after that on right side you will find a box named
debug (or something like that), select that box
Then hit install.
Restart your visual studio and debugger will start working.
In my case it worked perfectly.

Related

Visual Studio 2015 can't start IIS Express

When I am trying to run an ASP.Net Core project in Visual Studio 2015, a Microsoft Visual Studio dialog appears "The project doesn't know how to run the profile IIS Express".
Does anyone know anything about this message, or how to fix it? I've searched Google and the MSDN. There's nothing in the build logs, or the Windows event log.
This dialog showed up for me when I had migrated a project from dotnet RC1 to RC2.
Before the fix I could still run it using dotnet run and from Visual Studio choosing the profile other than "IIS Express".
I had misread this guide and forgot the .Web
\DNX\Microsoft.DNX.targets –> \DotNet.Web\Microsoft.DotNet.Web.targets
After fixing this and restarting Visual Studio(not sure if needed) I could run the project using the IIS Express profile.
Should also be noted that as per the comments, adding .Web in the top level node is required in the xproj. <Project Sdk="Microsoft.NET.Sdk"> should be <Project Sdk="Microsoft.NET.Sdk.Web">.
In my case the issue was solved after added the ASP.NET and web development tool extension to my VS instalation.
To clarify the answer from hultqvist, it is a problem with the xproj. To fix it, edit the xproj directly and change this
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets"
Condition="'$(VSToolsPath)' != ''" />
to this
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets"
Condition="'$(VSToolsPath)' != ''" />
That is, insert Web twice.
There is an associated issue in the aspnet tooling repo.
I had the same issue and found a very simple solution for Visual Studio 2017. In Visual Studio 2017 go to Solution Explorer then right click on your project file. In the menu you will see "Set as StartUp Project". If you can select it then select it. Now run your project again.
I had a similar issue but with "MyProjectName" instead of IIS Express.
In my case, I was trying to start as a standalone application, so I cleaned the launchSettings.json
I inadvertently changed the "commandName" parameter from "Project" to "MyProjectName" and that caused the popup to show up.
Resetting it back to "Project" solved my issue, silly me 😁
I had a similar issue, In my case ASP.NET and web development is enabled but Development time IIS support is not checked in the optional sections.
Once I enable the Development time IIS support solved my issue.
You can get this error with RTM if <BaseIntermediateOutputPath gets corrupted or is incorrect in your .xproj file.
I had this same issue and after digging around for a while I discovered that I had dotnet preview v1.0.0-preview2 installed under Programs Files (x86) and a non-preview version in x64. I think VS is launching the x86 (preview) version but expecting to see the full version. To fix this, I did the following.
from programs and feature uninstall every visible dotnet core. (note: this did not remove the x86 preview)
go to https://www.microsoft.com/net/download/core#/sdk and install BOTH x86 and x64 SDK packages
open command line and from the root directory check run: dotnet --version (at the time of writting it was 1.0.4
fire up .net core project in VS 2017 and run.
When I did all of the above, I was able to start up the site in IIS Express from VS.
This happened to me after a failed update of visual studio 2017 15.9.4
Setup completed with warnings and when I checked the problems saw that .NET core SDK 2.1 installation is failed.
I will try to install it manually.
Otherwise currently the only solution I found is to uninstall visual studio and re-install it.
In visual Studio 2017, i fixed this error by doing the following two steps.
I went to add or remove a program in windows, and deleted everything ending with ".net". I then reinstalled them in the visual studio installer. Then loading the project again produced a new error, which condiosluzverde provided the solution to here:
How Can I Fix the Microsoft Visual Studio Error: "Package Did Not Load Correctly"?
Same thing happened to me, my project was working fine. I didn't do any RC1 to RC2 update & this popup appeared from nowhere.
I fixed the problem by updating visual studio. You can also consider repairing VS.

Visual Studio 2015 Preview - Keep IIS Express Running

I'm trying to get a decent development experience with Visual Studio 2015 Preview.
To do that I'd love to have my IIS Express running all the time instead of requiring me to start debugging.
Anyway to do that? Tried command line:
IISExpress.exe /path:pathmyproject/wwwroot
IISExpress.exe /site:SiteName
and
IISExpress.exe /path:pathtomyproject
First two give me:
Unable to locate project.json
Third one
HTTP Error 403.14 - Forbidden
Not exactly an answer, but if you can view in browser instead of Debug.
The command for view in browser is: CTRL+ SHIFT + W (or right click on project and select View -> View in broswer.)
IIS Express will start but will not close when you exit your browser.
Hope this helps, this is what I do (specially now that build/compile is no required with roslyn).
Similar to VS 2013, if you disable Edit and Continue IIS Express will continue to run when you stop your debug sessions.
Open the menu item Tools/Options, look for the Debugging/General option. Scroll down and uncheck "Enable Edit and Continue"
in the Debug menu > Start without debugging (Ctr + F5)
Visual Studio 2015 Update 3 adds the support to keep IIS Express Running
For ASP.NET Web Application projects, when "Enable Edit and Continue" checkbox is unchecked, the IIS Express process will no longer stop working every time you stop debugging.
Visual Studio Update 3 RC Release Notes
"Enable Edit and Continue" checkbox does not exist in visual studio 2015 update 2!this is best solution for this problem
I just unchecked Edit & Continue option under project properties -> Web -> Debugger.
I'm using VS2015. It is working for me.
This problem occurred to me when trying to run a cloned project. The solution that worked to me was installing Microsoft.NET Core 1.0.1 VS 2015 Tooling Preview 2.
Go to Tools --> Extensions and Updates --> click Updates
Look for Microsoft.NET Core 1.0.1 VS 2015 Tooling Preview 2 and install the update if it is available.

Visual Studio 2012 Project Properties Editor is Disabled

I have problem with my visual studio. Something went wrong with my project properties and I always see everything disabled. It hapens even if I create new console application.
Any ideas? I restarted all visual studio settings, restarted computer, uninstalled extensions, searched the web but nothing helped.
I used Repair in add or remove programs and it is working fine now. Wonder what went wrong. I dont like this "it worked yesterday" problems.
The same symptom occurs while running your program in Visual Studio using the debugger.
If the project properties are greyed out, first check if you are debugging. If you are, finish debugging, then look again at the property pages.

Wrong build being deployed on Android device using Visual Studio 2012 Xamarin.Android

I am using Visual Studio 2012 and Xamarin.Android Beta release to develop an Android application. When I try to deploy the android application for debugging purposes onto an Android device, it deploys the previously built application on the device and not the recent changes I made and deployed (i.e No refresh of build). However, if I use Xamarin Studio to do the same, it deploys the correct build everytime (i.e refreshes the build with new code changes).
Any idea why this is happening?
Thanks in advance!
I had a similar issue: With Visual Studio 2019 the debug version of my driver was deployed while building the release version.
The cause of my problem was, that in the Properties -> Driver Install -> Package Files I had an absolute path pointing to the debug version of my driver in the column File. This setting is valid for all configurations (not separated for debug/release), and when entering macros, they are immediately expanded to absolute paths.
I fixed this by editing the .vcxproj file with my favourite editor and changed the path back to $(TargetPath).
I had the same problem. My solution was to add "deploy" to the build configuration:
BUILD => Configuration Manager... => (select "Debug" from left-hand combo-box) => (tick "Deploy" in grid)
Courtesy of this xamarin forum post.
I have no idea why it does this, I had this issue before. I also noticed that the device log was somewhat behind (ie, at 3.30pm, the last record on the device log was 11.00am).
Uninstalling the app from the device and re-deploying it seems to correct it.
Note: I had this issue in VS, didn't check with XS.
I would look at the difference in your deployment settings in VS and XS (I think it may have something to do with the Fast Deployment option).
Similar question (though for iOS Simulator) here.
I had a similar problem (though on an Android emulator).
What didn't work for me:
restarting the computer
restarting Visual Studio
deleting bin / obj folders
going into Configuration Manager (Debug / Release / Configuration Manager) and ticking everything there - everything was ticked
changing the version of the app in the manifest
What worked for me?
Uninstalling the app from the emulator and then running Debug again.
It was an Android emulator, so I uninstalled by clicking on the app icon and holidng for long, and then dragging it to "Uninstall App". On an iOS simulator it should be similar.

Visual Studio 2012 hangs when opening site.master

I am using Visual Studio 2012 Ultimate 11.0.60315.01 Update 2 under Windows 7 Pro. I have been doing some non visual development with it for a while with no issues. I have just now created a fresh web forms application. As soon as I go to open the Site.master in "Design View" in the HTML editor VS freezes.
The freee results in me being unable to click elsewhere in the IDE (Menu's, Solution Explorer) etc. so it does not look as if the IDE has hung, rather that it has just stopped responding. The same behaviour is evident if I run devenv.exe /SafeMode. CPU usage is minimal and I have plenty of RAM available.
Any suggestions on how I diagnose and resolve this issue?
Running VS as administrator seems to alleviate the problem.

Resources