I'm currently developing with the Azure SDK on Windows 8.
I have installed the Azure SDK for VS2010 and VS2012 and have both of them on the machine. Unfortunately, whenever I click to debug my Azure web and worker roles on my local machine the storage and compute emulators boot up and then promptly cause my machine to reboot itself.
This happens in both versions of Visual Studio and I have absolutely no idea why this is happening. Any help would be much appreciated.
I do receive the following output though - I haven't changed anything since it last worked:
Windows Azure Tools: Warning: Certificate identification setting 'Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption' for role 'VizageAPIWorker' specified in the service configuration file is not declared in the service definition file in the Certificate or as part of an SSL endpont
UPDATE:
A blank project compiles and runs with no errors whatsoever
UPDATE
Same project on a Windows 7 PC also causes this problem
Really sorry about that, I've fixed this with the latest version of the nuget package:
New Relic x64 for Windows Azure 1.0.0.27 - http://nuget.org/packages/NewRelicWindowsAzure
I am working on a way to avoid having to reboot at all (rebooting could add roughly 4 minutes to new deploys). The main issue is that the default configuration for an Azure cloud server marks the service "W3CSVC" as manual so issuing an iisreset alone will stop IIS completely - I'd like to replace the call with NET START as detailed here: https://github.com/newrelic/nuget-azure-cloud-services/issues/7
I have seen this problem even when you don't have any SSL endpoint configured in your application, is that your problem? Also if your problem is related with above error, creating a very simple "helloworld" web or worker role, should not cause this problem.
Now if you don't have any SSL endpoint in your application and still see the error:
Then this problem is just machine specific and could caused by specific setting in your machine.
Sometimes rebooting machine, re-installing/modifying application etc just let this problem go away...
Try running Process Monitor to log, file & registry access to see what was being accessed when the crash occurred.
After above test, if your application SSL endpoint specific configuration cause your application and machine to recycle, then it sure could be an issue related to how networking and security components are configured in your machine or exhibit any problem. This could be very specific to your machine and removing factors one by one could help you resolve your problem. This problem is more specific to Windows Azure components in your machine and your machine configuration. You might hit jackpot by finding it soon or may spend countless hours to troubleshoot.
Problem Solved.
It's a strange one and I'm still not sure if I am at fault. But here's a brief explanation, my instance has the New Relic Windows Azure NUGET package installed on it for monitoring purposes. Unfortunately it seems when you deploy this to the azure emulator it triggers a restart of your machine. I noticed this after delving down into the System Event logs and finding the following:
"The process C:\Windows\system32\shutdown.exe (????-PC) has initiated the restart of computer ?????-PC on behalf of user ????-PC\????? for the following reason: No title for this reason could be found
Reason Code: 0x800000ff
Shutdown Type: restart
Comment: Reboot after installing the New Relic .NET Agent"
Removing the New Relic Agent NUGET package stop the reboot from occurring. I am still waiting to hear back from someone at New Relic to see if it's just me being stupid or a genuine bug.
Related
I am trying to setup some web applications to run locally on IIS 7. I have gone through everything on
https://msdn.microsoft.com/query/dev14.query?appId=Dev14IDEF1&l=EN-US&k=k(vs.debug.error.http);k(TargetFrameworkMoniker-.NETFramework,Version%3Dv4.5)&rd=true
Many other posts mention also doing
aspnet__regiis.exe -i
Which I have done several times.
In the IIS manager I can see my site, I can start the app pool find (as well as recycle and stop), but whenever I go to localhost I get a 503. If I try to run the debugger the app pool just dies. One site mentioned that having Visual Studio installed first can cause problems so I uninstalled that and re-installed but that was ineffective (it's also installed/uninstalled through a company web store so I don't know how "clean" it gets after the install).
I've tried manually creating the site, etc in IIS Manager still with no results
Under the Add or Remove Windows Features in Programs I have enabled everything under IIS as well so everything should be installed
:( Oops.
500 Internal Server Error
An error occurred while starting the application.
This message came out when I added database functionality to my asp.net core app and deployed it to iis. When I developed it in Visual Studio, everything went well. But after deploying, this error messages appeared.
I tried to use dotnet myapp.dll to run my app in the deploy folder, and found out it worked well. It is likely that the problem is relation to iis. I tried to add <compilation debug="true">..</compilation> to web.config, but it seems useless. What is problem are actually, or is there any other way to see the detailed error info to help find out what's happened?
Change stdoutLogEnabled="false" to true and then check the logs at stdoutLogFile=".\logs\stdout". The error(s) there might tell you something.
Check that you set up right Environment Name using ASPNETCORE_ENVIRONMENT environment variable as so use correct settings like connection string. On your machine by default you have "Development" environment.
You may use Error Handling middlewares for showing exceptions like
app.UseDeveloperExceptionPage();
Had the same issue. Here is the guide that helped me. Note, that I did not want to install the "Runtime" on the web server, but rather deploy all the necessary files as a stand alone app. Below are the steps in a more abbreviated form:
On your local PC, Determine which version to publish based on your server. I was targeting Windows Server 2008, R2 which meant i needed to publish win7-x64. Open a command prompt in your project directory and run the command below:
dotnet publish -c release -r win7-x64
This creates a publish folder containing hundreds of dlls, an .exe, and web.config located here: bin\Release\netcoreapp2.0\publish
On the web server with IIS, go to this landing page. Click the link for your desired version. Find the link for the Runtime and Hosting Bundle. Click to download and run.
Restart IIS by running this from an elevated command prompt:
net stop was
net start w3svc
Copy all of the files in your local publish folder to your desired application folder on the IIS server.
On the server, Open IIS, and create a separate AppPool and Application like normal. For the AppPool, under Basic Settings, change the .NET Framework version to No Managed Code. Make sure your Application in IIS points to your desired folder and the proper AppPool.
Test your web application in a browser.
In my case, I got this because I hadn't actually installed the latest 'DotNetCore.2.0.0-WindowsHosting.exe' on the windows server I was running it on... so it was working fine on my local machine in debug and error five hundy'ing on the server.
I had other non trivial to fix issues with the upgrade also... I'd advise avoiding it if you can.
Mark333's comment below solved my problem.
Quoting for easy reading:
"I'm using the normal publish provided by Visual Studio. And, I just
found out using the latest version of Hosting Bundle will fix the
issue. +1 on this
microsoft.com/net/download/dotnet-core/runtime-2.1.0-rc1"
I had to install for 1.1 since my app is a little older, but Hosting Bundle fixed it. In my case we deploy to a Docker image for our official environment, but when I want to do some testing locally I publish it and let my local IIS serve it up.
My problem was solved installing .netcore latest: https://dotnet.microsoft.com/download/thank-you/dotnet-runtime-2.2.2-windows-hosting-bundle-installer
https://learn.microsoft.com/pt-br/aspnet/core/host-and-deploy/iis/index?view=aspnetcore-2.2#install-the-net-core-hosting-bundle
Worked like a charm!
I had installed DotNetCore.2.0.5-WindowsHosting.exe on a Windows 2008 R2 Standard machine and encountered the same http 500 error. Logging didn't help (blank logs were generated - and Event Viewer logs were the generic ErrorCode = 0x80070002)
I had to do two things to solve my problem:
Give Read rights to the ApplicationPoolIdentity user (EG: IIS APPPOOL\AppPoolIdentityName) to the website directory and the application directory
I had to install IIS ASP Core under Server Manager (this felt weird, but it worked!)
I had the same issue.
My problem was that my connection string to db was not set in appsettings.production.json
And the internal server error 500 was to vague error message.
Changing the stdoutLogEnabled = true did nothing to me so i was not seeing any information about the error.
Make sure the App Pool has permissions to the folder where your app resides.
I experienced this issue. The problem was due to my local Sql Server instance. Remote connection were not allowed. So I manually restarted the SQL instance and my App restarted working fine.
I had similar issue after istalling dotnetcore-windowshosting using chocolatey while doing AWS ec2 instance bootstrapping.
When I checked my IIS modules AspNetCoreModule was missing.
This solved my issue. https://github.com/aspnet/IISIntegration/issues/434
I had to uninstall chocolatey package, restart machine and install it again.
Hope this helps!
In my case, I created a .NET 5 single file output, and I was getting:
500 - Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.
The problem turned out to be that the EXE file was for some strange reason recognized as a virus by the protection software (CrowdStrike Falcon). Re-building without "single file output" option solved that problem.
There is an article called "Configuring IIS, ASP.NET, and SQL Server" which I highly recommend.
I followed the steps described there and my asp.net core app now communicates with my SQL database (after being published to IIS):
https://www.codeproject.com/Articles/674930/Configuring-IIS-ASP-NET-and-SQL-Server
It also happens when you install dotnet-hosting-bundle/dotnet runtime beofore IIS.
In this case re-install dotnet-hosting-bundle/dotnet runtime.
To be able to see the excetion's detail I just needed to change the ASPNETCORE_ENVIRONMENT to "Development" in the "IIS Express" profile in the launchSettings.json file. I aldo needed to create the corresponding appsettings.Development.json file to set the variables and data needed in my App. When the environment is Development net core send the detail exception by defaul. As we can read here in the official documentation.
There is a weird issue I am facing. I created my first windows service looking through various blogs and tutorials.
Then created setup for that adding installer etc. It works fine while installing , un-installing via Visual Studio but it fails when i deploy it .
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\bhuvint\Documents\Visual Studio 2010\Projects\CPNS Library\ServicePackage\CommonPushNotificationWindowsService.application resulted in exception. Following failure messages were detected:
+ You cannot start application CommonPushNotificationWindowsService from this location because it is already installed from a different location.
+ You cannot start application CommonPushNotificationWindowsService from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application it is already installed from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application. You can start it from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application or you can uninstall it and reinstall it from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application.
I have already un-installed the service and trying to install it from the deployed service in the same pc to test. But it fails with above error.
I feel i have deployed the windows service the wrong way. Could you guys please suggest how to deploy a windows service ?? (I have looked through net. All suggest building it and installing it from visual studios. But how to publish it is the thing which i need.)
Please help asap.
Possibly you built the setup project before uninstalling the preovious service. In that case you can't use the new setup to uninstall the service, since the setup won't be the same and can't be able to access the service installed.
You should try to go to a previous version of your project and uninstall the service and for the future unistall the service each time you're building your setup project.
This happened to me several times.
Run visual studio in debug mode, and in your properties of your service project goto tab build events in Post-Build event command line and add a -d so you can run your service without installing it, it will run as an console app
The LocalService account acts as a non-privileged user on the local computer, and presents anonymous credentials to any remote server. Use the other accounts with caution, as they run with higher privileges and increase your risk of attacks from malicious code.
If your service application will not install correctly, check to make sure that the ServiceName property for the service class is set to the same value as is shown in the installer for that service. The value must be the same in both instances in order for your service to install correctly.
NoteNote
You can also look at the installation logs to get feedback on the installation process.
You should also check to determine whether you have another service with the same name already installed. Service names must be unique for installation to succeed.
STUPIDITY PERSONIFIED
As i told i was deploying my service. So this published code had a "setup.exe" file to it. Now I had already created a setup project for the windows service , which i was using for the installing , uninstalling . And i din't know (These words needs courage !!) that msi file created is required to install the windows service. So as i got through the folder structure of the setup project. I came across the .msi file . And hence the problem got solved. The Main problem was :
Me not knowing to use setup projects
And I confused setup.exe with the published windows service with the setup of windows service.
I am really sorry for stealing bandwidth off your precious time. Thanks to all for the valuable inputs.
I have a problem when I try to Run published Application. When I Run Release or Debug Version from VS (key F5) everything work well. So I try to publish my application (no problem). After this I Installed application by oneClick installer. Instalation was finished without problem, but when I try to run this installed application, I only see message: Program has Stop Working.
Please, does anybody know where should be a problem? It´s really wierd, I suppose, when the application run correctly from VS, then it Should run after installing to!? Or am I wrong?
Or is there some option to reset Publish settings in Visual Studio?
Thanks a lot!!!
It depends how you have ClickOnce setup, but the main reason this happens is the ClickOnce system encounters an error while checking for updates or running the .application from the remote location.
It should give you the option to see a log of the problem (or at least the nasty temp file it threw it in).
From here you can determine the problem ClickOnce is having.
Most Common Problems I would Suspect:
The User's having trouble communicating thier auth token / credentials to the web server the ClickOnce app is on.
There's another web-related issue downloading the app manifest or .application from the server
Group / Local Policy Problems
Broken install in on local machine's ClickOnce somewhere causing it to have problems overwriting on disk or finding an appropriate location to setup the clickonce package.
Broken install in on local machine's ClickOnce causing a GUID Conflict (I.e. your app and the broken install can't be upgraded, but share the same GUID)
Antivirus / Firewall blocking access to the web component from the executable clickonce deploy.
These are all the problems I've encountered with ClickOnce and the reasons we've primarily moved away from it to a Wix style installer.
I've written many versions of windows services and installed them on a 64-Bit system with 32 GB running Server 2008 R2 Enterprise.
I create the services using this recipe:
http://msdn.microsoft.com/en-us/zt39148a.aspx
"Walkthrough: Creating a Windows Service Application in the Component Designer"
I create the .msi and corresponding setup.exe on my Win 7 laptop (c#, vs2010 SP1, .NET 4).
NORMAL BEHAVIOUR
after testing a Windows service on my laptop, I copy the .msi and setup.exe to a folder on the win2008 R2 Enterprise server (using copy and paste via remote desktop); I use the server's Control Panel to uninstall, right click the .msi and choose Install, then walk through the Setup Wizard. No problem. Works most of the time.
ABNORMAL BEHAVIOUR
The install runs for perhaps 15 minutes or longer; it never finishes; eventually a dialog states
"(?) Installer is no longer responding."
with options to [Retry] or [Cancel].
At this point, the progress bar is a short as it could possibly be and at the far left, beneath the "P" of "Please wait...".
Clicking Retry does not help. It's been over 30 minutes and counting since I clicked Retry and the progress bar has not advanced even a pixel.
MORE INFORMATION
(a) the service installs without any problem on another server, a Win 2008 R2 web edition.
(b) as mentioned above, the Windows service both installs and works properly on my Win 7 development and testing environment.
HISTORY / SPECULATION
a couple of weeks ago, I was unable to install a service from the win 2008 R2 Enterprise server. I could not find it in Control Panel/Uninstall even though the .msi claimed it to be installed and the service also continued to appear in the services.msc console. Even disabling the service did not help. For that reason, I cloned the code, changed the service name slightly, and successfully installed that service which has been running for while without issues.
Today, a similar event happened, the only difference being that I can see that service in Control Panel Uninstall. Because it would not uninstall, I tried my same cloning trick but this time it failed.
Next step: using the above walkthrough, I created a do nothing Windows service and made it useful by importing my client classes into it from the original c# project file.
The re-built from the ground up Windows service works as designed on my laptop but refuses to install on the R2 Enterprise server.
Any ideas?
Please and thank you.
P.S.: i posted this at so because imho it's more likely something that a developer is likely to encounter prior to handing off her/his code to a sysadmin.
BTW, I could not find anything related at so; ditto via Google.
in this particular case, it is some very weird server rights condition
MORE INFORMATION
although my server account is not Administrator, I'm a member of both local and domain Administrators for this 2008 R2 box.
I had tried many ideas, including creating the example in the walkthrough and trying it. No luck.
The boxe's Administrator was able to install my service using installutil.exe so I tried installutil.exe but it would only work for me using the Administrator's credentials.
For that reason, I suspected it might be a rights issue, so I tried with my credentials installing the walkthrough example on the H:\ drive. Success. Next, I tried installing the troublesome Windows service on C: in a different location. Again, success.
What is strangest about this issue is that many times I had no problem then suddenly a problem arose to block my development efforts.
A sign that a Windows service will install is when a dialog asking permission to continue appears almost immediately after starting the install. Another clue that success is possible is being able to successfully uninstall any previous version via Control Panel.
I appreciate everyone's efforts to help me with this. Thank you.
I've had similar experiences with my own MSI's (not just for services), as well as third party MSI's on Win2k3 and Win2k8. I never (ever) got to the bottom of it without a 'fresh' re-install of the operating system.
Just like you, I too speculate that there's something lost in (a combination or all of) the internals of the OS (registry, file-system, system restore).
I know this is not what you want to hear but (if at all possible) a clean install of the OS might do the trick for you.