Azure - error on starting with multiple web role projects - azure

If I have more than one webroles(projects, not instances) in my application, I get this error: (I only get it if I attach a web role. It works fine wit as many worker roles projects as I want)
Microsoft Visual Studio
Windows Azure Tools for Microsoft Visual Studio
There was an error attaching the debugger to the IIS worker process for URL 'http://127.0.0.1:5100/' for role instance 'deployment(21).CloudPOC.WebRoleToHostDataService.0'. Unable to start debugging on the web server. The web server is not configured correctly. See help for common configuration errors. Running the web page outside of the debugger may provide further information.
Click Help for more information.
OK
What is wrong here? I can't understand it and I need a webservice project!

Make sure you are starting the Azure project rather than the Web Project itself. You might have set the Web Role as the startup project, and if you do that you'll find that IIS runs the Web App rather than the Azure Dev Fabric, meaning any Dev Fabric specific stuff (like config settings per role) aren't available causing problems.
What you're meant to do is let the Azure Dev Fabric (Compute Simulator) fire up all your roles for you, and it'll also work out if it needs to open a web browser etc.
So right click on the Azure Cloud project, set that as the Startup Project, and try again.
Hope that helps,
Andy
EDIT thought of something else!
Make sure your web.config is compiling to allow debug="true". If you have added a new WebSite to your solution, it won't be so by default:
<system.web>
<compilation debug="true" targetFramework="4.0" />

I had similar issue which got resolved with following steps.
Make sure you have correct version of .net framework 4.0 is intalled. (.Net Framework 4.0.30319 is the latest version)
Uninstall if there isany other .Net 4.0 framework in present on your system by going to Add And Remove programs.
Go to %windir%\Microsoft.NET\Framework64 physical location and remove unwanted .Net framework 4.0 folder

I've also had this problem and it happened when I upgraded my app to 4.0... I ran without debugging and got the following error:
There is a duplicate 'system.web.extensions/scripting/scriptResourceHandler' section defined
and after researching that error, I found this:
http://forums.asp.net/t/1571308.aspx/1
which says there's currently a bug w/ vs2010 and 4.0... I took the answers recommendation and commented out the extensions section and it worked for me... Another possible solution.

Related

Page keeps loading forever

Im using IIS 8.5 on Windows Server 2012 R2 so I add my Web Api but when I try to view the site it stays in a loading state like this:
Do not show any message or error just stays loading, I think that i miss some configuration or feature in my IIS but I don't know which one.
Edit: I use .Net framework, it is a REST .net web api like this reference, the IIS have installed .Net versions 3.5 and 4.5, it's IIS not the express and the default IIS website runs fine.
I would really appreciate any help.
Try to reduce the timeout settings to a minimum level, say 10 seconds.
See if it throws a Timeout error.
Without much information from your side its hard to judge.
Perhaps it could be an external service you are trying to access(Web service) or a DB connection?
Please check if the application pool you assigned to your solutions runs under the correct version of .net framework and in integrated mode. I had similar issues when trying to run an mvc app in classic mode. Check this out.
EDIT 1 - Reconfiguring IIS
If problems persists then try the ASP.NET IIS Registration tool. Execute the followig command as administrator:
aspnet_regiis -i
At the end of this post the different locations for aspnet_regiis are described. You should select a .NET Framework version corresponding to that of your project, run aspnet_regiis and assign the proper application pool to your app.

Asp.Net Core 2.0 on Azure results in a 502.5

I have a small web app developed with Asp.Net Core 1.1 deployed on Azure and it works well. I just migrated the project to use Asp.Net Core 2.0 and tried to deploy it on Azure. The deployment went fine but when I open the site, I get a 502.5 error. When I check my Azure log stream, I get the following error:
This error occurs when a CGI application does not return a valid set
of HTTP headers, or when a proxy or gateway was unable to send the
request to a parent gateway. You may need to get a network trace or
contact the proxy server administrator, if it is not a CGI problem.
Useless to say that it works well on my development machine with the same code. Note that I'm also using Entity Framework Core 2.0 although I deactivated the database creation on Azure (to check if it was not the cause).
For information, the way I migrated from 1.1 to 2.0 is by changing the target framework settings to "netcoreapp2.0" and by using the NuGet package "Microsoft.AspNetCore.All". Just to be sure, I also deleted my publish profile and recreate one.
Is it possible that Asp.Net Core 2.0 is not yet available on Azure ? I'm fairly new to Asp.Net Core, so I don't know when new releases are made available on Azure.
EDIT
When I try to run my app with dot net CLI via the debug console as proposed by natemcmaster, I got the following issue:
Unhandled Exception: System.IO.FileLoadException: Could not load file
or assembly 'Microsoft.AspNetCore.Hosting.Abstractions,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)
I downloaded the DLL on my desktop and check the version with Dot Net Peak and indeed, the DLL is 1.1.2, although I created the project with Visual Studio and directly publish it, so is it an issue with Visual Studio ? Or Nuget ?
the issue was actually coming from the fact that, at first, my web app was using .net core 1.1, which deploys all the DLL in the "wwwroot" folder of the web application. However, with asp.net core 2.0, it does not do that anymore as the DLL are picked up from a global store. However, as Visual Studio does not clean the destination folder before a publish, I ended up with a situation where the 1.1 DLL were in my wwwroot, so the web site was picking up these ones instead of the 2.0 ones in the store folder.
This is explained in more details here: https://github.com/Azure/app-service-announcements-discussions/issues/2#issuecomment-313816550
Others have explained the reason why this is happening. I'd like to provide another – arguably easier – solution to the problem.
Just change the settings so that you remove files that are already on Azure – see below:
Check for log files either in the portal or by remotely accessing D:\home\LogFiles.
Sometimes, the logs won't indicate what is going wrong. Another good way to investigate further is to try launching your ASP.NET Core app from the Debug Console. If you are missing a shared framework version or there is another startup error, this will be more visible from the Debug Console.
Go to
https://(your web site name here).scm.azurewebsites.net/DebugConsole/
Your site will be in D:\home\site\wwwroot. You can launch it by executing:
cd D:\home\site\wwwroot
dotnet MyWebApp.dll
If you app still fails to launch, make sure that D:\home\site\wwwroot\web.config is available and configured to use ASP.NET Core Module. https://learn.microsoft.com/en-us/aspnet/core/hosting/aspnet-core-module
In my case, It was caused by having a space in the Project Name.
I can readily add a space, publish => 502.5.
Remove space, publish => good to go.
Hard to believe but I am duplicating it readily with above.
Also using "Remove Additional Files at Destination" per #Sam's Answer
See https://github.com/Azure/app-service-announcements/issues/14
"The rollout is expected to complete by Friday June 30th."
In my case the issue occurred because AppService at that time supported 2.0.0-preview2-006497 but I had 2.0.0-preview3-006890 installed which was used on build.
So I added global.json to use preview 2 SDK and it worked then
I don't know if this could help someone one day but in my case, I was using :
-Microsoft.AspNetCore.All 2.0.5
Downdrage to Microsoft.AspNetCore.All 2.0.3 resolve my problem
This happens when your version of ASP.NET Core cannot be matched on the server.
The simplest solution is to change your settings to deploy the app as self-contained, so it doesn't matter if Azure can match the framework version. Also, delete the files already on Azure, so you don't have issues when upgrading, as explained by #Sam.

Migrating Umbraco 4.7.1 from IIS6 to IIS7

I have taken over an Umbraco (version 4.7.1) installation from a previous coworker. The server hosting the application must be shut down and therefore I'm migrating the application to a new server.
The old server is running IIS6, but the the new server is running IIS7.5. When I try to open the site on the new server, I get a "Object reference not set to an instance of an object" exception. The YSOD does not provide much info on what's going wrong (see below).
When I run the application locally in Visual Studio it works like a charm. Do any of you have a clue to what is going wrong?
Can I suggest that you take a clean web.config from the Umbraco 4.7.1 archive and try that first. You can download v4.7.1 from this unofficial archive http://code.leekelleher.com/umbraco/archive/
Merge your customisations into the web.config e.g. connection string and give that a go as I suspect your web.config is not migrated to IIS7.
I wrote a blog post a few years ago about migrating web.config files from IIS6 > IIS7 which may be of use if the above advice doesn't help:
http://www.prolificnotion.co.uk/use-appcmd-to-migrate-web-config-from-iis6-to-iis7/
Have you checked that your application pool is running the correct version of the .Net Framework? Also check the pipeline mode you are running - mine run in Integrated mode not Classic.
In the <system.webServer> node of your web.config locate the <modules> node and ensure you have the runAllManagedModulesForAllRequests attribute set to true as that has caught me out a few times. It should look something like this:
<modules runAllManagedModulesForAllRequests="true">
I suspect the latter advice is the one that will do it for you.
Simon
Just riffing on some of #Pronotion's suggestions ... I have occasionally had issues installing apps on new server instances and have had to reinstall IIS. It's a single command line: aspnet_regiis -i
Also from your screenshot, it looks like you are running a .Net 4 app pool. Umbraco 4.7.1 should be running under .Net 2 Classic app pool as far as I remember.

Debugger can't connect when starting local azure project

Ok, first of; here's what I did:
Install AZURE tools
Reboot
Start Visual Studio - new Azure project
Add web role (asp.net MVC 4 beta web role)
Hit F5 (debug)
It starts up the storage emulator and the compute emulator and starts to load in runtimes, and then I get a popup saying that the debugger couldn't connect.
Then after some googeling I'm suggested to try to run the application without running the debugger to see if I can acces the application. When I do I get this:
So I figure that IIS does not have permissions to access some file/directory. So I go to IIS and look up the application pool running the app, and it tells me that the identity in use is NetworkService, then I go give NetworkService full permissions to the entirety of the folder IIS has set for the application (which also happens to be the path to the project dir). Still I get the same error. Now I'm more or less out of ideas, but I try one last thing, which is to also give IUSR full permissions to the same dir, but this did not help either.
How can I go about resolving this problem? I haven't tried actually launching my project to Azure yet, cause if I can't even get it to work in development I don't see much point. Any and all help would be appreciated.
I ran into the same error today after uninstalling .NET 4.5/Visual Studio 11 Dev Preview, then installing ASP.NET MVC 4 Beta (this is before Feb 29th when the updated VS 2011 Preview drops).
Since I uninstalled .net 4.5, you just need to do an "aspnet_regiis -i" to ensure the .net framework (4.0) is set up with IIS 7.x this worked for me.
Edit: This will work if you uninstall/then manually install Visual Studio 2012 RTM as well.
I had a similar error yesterday. For me the problem was that the output of the build was empty in the target folder.
I tried to answer a similar question https://stackoverflow.com/a/9411422/182371:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log
file for the error messages. Mode details at
https://stackoverflow.com/a/8432621/182371
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0', right
click --> Explore.... Make sure that this folder is not empty and
contains all the files required to start a web project successfully.
As for the Access Denied error:
it could be just an IIS default setting to disable browsing. To resolve that, just navigate to that web site in IIS, find Directory Browsing icon, and press Enable. You will at least see the files inside that directory.
Also try not only 127.0.0.1:81, buta specific document inside that folder, like 127.0.0.1:81/Default.aspx
Take into account the fact that there's sometimes some mess with the ports. You see that in the error message it's port 82, but in your browser it's port 81. So make sure you're using the right port. Or, even better, in your service definition try to use some non-standard port for this to avoid remapping.
I've met the same issue. In the end, I had to reinstall IIS 7.
I got this exact same error and tried a re-install of IIS and the Azure SDK - nothing worked.
Eventually tracked it down to the "IIS URL Rewrite Module 2". I went to the Control Panel and chose Repair and it resolved it. If you have a section in your web.config then this might be the cause.
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk when upgraded from 2011.

Debugging Azure: Error attaching the debugger to the IIS worker process

I have a web application asp.net to deploy to Windows Azure. I try to run it on local first. But when debugging, I catch this error from VS2010:
"There was an error attaching the debugger to the IIS worker process
for URL 'http://127.255.0.0:82/' for role instance
'deployment16(6).WindowsAzureProject2.WebApplication3_IN_0'.
Unable to start debugging on the web server ......."
I've search so hard to find the solution for this problem but there's nothing seems work for me. I'm a newbie in Windows Azure, it's really a big trouble with me.
I had similar problem with Windows 8, debuging a cloud application with Visual Studio 2012 RTM and Azure SDK 1.71, when trying to launch the application into the compute emulator. It was a very simple app, but I used Azure diagnostics. At the end these are two things I have changed that have work for me, both turning on Windows 8 features (so go to Win8 and open 'Turn Windows Features On/Off'.
Activate the checkboxes for:
Internet Information Services Hostable Web Core
Internet Information Services > World Wide Web Services > Application Development Features > ASP.NET 4.5
Internet Information Services > World Wide Web Services > Health and Diagnostics > Tracing
Internet Information Services > Web Management Tools > IIS Management Scripts and Tools
That worked for me, it makes sense, as I'm using Visual Studio 2012 and trying to get some trace information using diagnostics in Azure.
I hope this will work for you or give some tip about the problem. In the case of being useful information, remember to vote as response or as value tip.
Thanks,
Mike
This usually happens when there's a problem with the project to be deployed to the emulator (WindowsAzureProject2 in your case).
Try the following:
Check %UserProfile%\AppData\Local\dftmp\IISConfiguratorLogs\IISConfigurator.log file for the error messages. See more details in this answer.
Make sure your project can be started without the emulator. It's a web project, so just try to start it as a regular web project. Or publish it to the separate folder and try to create a website in IIS of it.
Check your *.csdef and *.cscfg files to make sure all the configuration is correct.
Make sure that the build output of your project is not empty. You can do this by going to IIS, find the site with the name similar to deployment16(6).WindowsAzureProject2.WebApplication3_IN_0, right click --> Explore.... Make sure that this folder is not empty and contains all the files required to start a web project successfully.
BTW, there's a similar question: Debugger can't connect when starting local azure project
Follow step 11 from http://www.microsoft.com/en-us/download/details.aspx?id=35448. Worked for me on Windows 8 with Oct 2012 SDk
I just have today the same problem trying to Debug locally with Azure Storage Emulator in Windows 7. So in the Azure project properties, in Web tab, I checked the radio button 'Use IIS Express' and it debugged without problem. I hope this helps someone.
I encountered this exact same problem when I upgraded an existing Azure solution to the Azure SDK 2.1. After some hunting around I uncovered that the upgrade had automatically set the "Local Development Server" setting to "Use IIS Web Server".
Changing the "Local Development Server" setting to "Use IIS Express" fixed the problem immediately.
To access this setting right-click the Azure cloud project file in your solution, select the "Properties" option, tab down to "Web" and you'll see the following setup.
Also, make sure you run Visual Studio as administrator
Please check the version of emulator you have installed. If your code is created in older sdk and you have a new emulator installed it will give you this error.
Check the version of Azure APIs in your project, go to Project > references and right click on Azure dlls to check the version, same sdk version must be installed on the system, higher are optional as azure 2.x are not backward compatible.

Resources