We are working on a project with the new ASP.NET 5 (vNext), EF7 and AngularJS and plan to deploy the WebApp on Azure.
I've created a new Web Application on Azure and published our project via Visual Studio 2015. After publishing I'll get a 500 - Internal Server Error when I try to test our application.
I've already set <customErrors mode="Off" />
in the web.config
in wwwroot
without success.
I've then logged in via FTP and the "DetailedErrors" also do not contain any useful information.
The eventlog.xml contains following exception:
<Events><Event><System><Provider Name="ASP.NET 4.0.30319.0"/> <EventID>1309</EventID><Level>2</Level><Task>0</Task> <Keywords>Keywords</Keywords><TimeCreated SystemTime="2015-07-28T10:54:43Z"/> <EventRecordID>280293125</EventRecordID><Channel>Application</Channel> <Computer>RD000D3A202052</Computer><Security/></System><EventData> <Data>3005</Data><Data>An unhandled exception has occurred.</Data> <Data>7/28/2015 10:54:43 AM</Data><Data>7/28/2015 10:54:43 AM</Data> <Data>9df086471c304ebfa4ddddf9ca2a2b92</Data><Data>1</Data><Data>1</Data><Data>0</Data><Data>/LM/W3SVC/2082809257/ROOT-1-130825544829782705</Data><Data></Data><Data>/</Data><Data>D:\home\site\wwwroot\</Data><Data>RD000D3A202052</Data><Data></Data><Data>2108</Data><Data>w3wp.exe</Data><Data>IIS APPPOOL\appname</Data><Data>InvalidOperationException</Data><Data>Couldn't determine an appropriate version of runtime to run. See http://go.microsoft.com/fwlink/?LinkId=517742 for more information.
at AspNet.Loader.RuntimeLocator.LocateRuntime(MapPathHelper mapPathHelper, Boolean& isCoreClr, String& relativeAppBasePath)
at AspNet.Loader.Bootstrapper.LoadApplication(String appId, String appConfigPath, IProcessHostSupportFunctions supportFunctions, LoadApplicationData* pLoadAppData, Int32 loadAppDataSize)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at System.Web.Hosting.ProcessHost.System.Web.Hosting.IProcessHostLite.ReportCustomLoaderError(String appId, Int32 hr, AppDomain newlyCreatedAppDomain)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Web.Hosting.ApplicationManager.CreateAppDomainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters) at System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException)
It says that it couldn't determine an appropriate version of the runtime.
In the project properties the solution DNX SDK version is set to:
The frameworks set in project.json
:
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
How can I get more information on the error?
There is a problem with the resource you are looking for, and it cannot be displayed. The first solution to a 500 internal server error is to refresh the page. If the error persists, you may try clearing the cookies, deactivating faulty plugins or themes, fixing the . htaccess file, or contacting your hosting provider.
IIS error The error 500.19 is an internal server error often occurring on a server using Microsoft IIS software. It indicates that the configuration data for the page is invalid. To solve the issue, delete the malformed XML element from the Web. config file or from the ApplicationHost.
"500.0 – Internal Server Error" is an IIS Error code meaning that the web service is unavailable. This means the error is with the API, not your client.
I was able to re-create your problem. Turns out that the publish wizard selects a runtime by default that doesn't match the selected DNX runtime of the app. You can fix this by going into the publish settings and selecting the correct Target DNX Version in the dropdown. In your case: the beta4 core-clr version.
After file > new project - my project.json
looked like:
"frameworks": {
"dnx451": { },
"dnxcore50": { }
},
NOTE - it's using core
- the core clr
- not the full CLR. While setting up the publishing for this app - It jumped over the default settings here:
NOTE - by default it selected the dnx-clr
, not core-clr
. Beta5 version is correct though.
Publishing resulted in an Internal Server error:
I found the error description here:
NOTE: this requires the new Azure 2.7 SDK to be installed.
The interesting part of this message is:
<Data>DirectoryNotFoundException</Data>
<Data>Unable to find the runtime directory 'D:\home\site\wwwroot\..\approot\runtimes\dnx-clr-win-x86.1.0.0-beta5-12103'.
Possible causes:
1. The runtime was not packaged with the application.
2. The packaged runtime architecture is different from the application pool architecture.
... </Data>
So I switched to the correct Target DNX version and it worked:
NOTE - the coreclr
version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With