Thursday night, I was working on a project built in ASP.NET Core 2.1 (being prepared for ASP.NET Core 2.2) running on my local IIS 10.0 (not IIS Express) and was able to run it without any issue. Friday morning, after heading into the office, I was met with the following error every time I try to run my solution in Visual Studio:
Unable to start process C:\Program Files (x86)\dotnet\dotnet.exe. The web server request failed with status code 502, Bad Gateway. The full response has been written to [file_name].html.
When I open the [file_name].html, I'm given the response:
HTTP Error 502.5 - ANCM Out-Of-Process Startup Failure
When I open the Event Viewer, I'm given the response:
Application 'MACHINE/WEBROOT/APPHOST/DEFAULT WEB SITE/[Path]' with physical root '[Path]' failed to start process with commandline '[Path]\bin\IISSupport\VSIISExeLauncher.exe -argFile IISExeLauncherArgs.txt', ErrorCode = '0x800700c1' : 0.
I have:
Turned off and on the IIS through Windows Features, making sure the correct Internet Information Services features were checked
Created an Application Pool where [.NET CLR version] is set to "No Managed Code" and [Managed pipeline mode] is set to "Integrated"
Uninstalled and Reinstalled: IIS Url Rewrite to IIS
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.1.504 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.1.504 (x84)
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.2.104 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core SDK - 2.2.104 (x84)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.1.8 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.1.8 (x86)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.2.2 (x64)
Uninstalled and Reinstalled: Microsoft .NET Core Runtime - 2.2.2 (x86)
Uninstalled and Reinstalled: Microsoft .NET Core 2.1.8 - Windows Server Hosting
Uninstalled and Reinstalled: Microsoft .NET Core 2.2.2 - Windows Server Hosting
Restarted my computer after ever re-installation
What else can I try because none of my other projects are working either.
In my case this issue occurred when I manually cleared the bin folder (which deleted the necessary files in the IISSupport folder) and tried to load the application which was set up as an application under my localhost in IIS.
To solve all I needed to do was to run the application through Visual Studio, which added the necessary IISSupport folder and files to the bin.
I got this fixed by re-installing the Visual studio. Still I'm not sure if this is the best way to fix this.
I've also tried all the approaches mentioned in this question but nothing fixed the issue.
I found the solution.
In the root folder of my team's project, there was an empty "file" file titled "The". For the sake of things, our project is called "The Project" with a space between the words. I removed this file and everything built fine.
My guess is that getting the latest files from our Teams server must have generated a half-formed file and messed with the build of my project.
In my case, my project was setup as a website in IIS and the file "bin\IISSupport\VSIISExeLauncher.exe" was missing in the project's directory.
I simply selected "IIS" when debugging the project in Visual Studio 2019 and it generated the missing file. It also generated 2 text files (IISExeLauncherArgs.txt, pidfile.txt) in the IISSupport folder, made changes to my web.config file, and my project ran successfully.
After that I was able to access the local website that was setup in IIS without running it in Visual Studio.
In my case, the issue is in launchSettings.json.
First, make sure which profile you are running while click run button.
my case is 'IIS Express',
Then open the file, go to =>Profiles, make sure the command name in IIS Express profile.
my case is IIS. more details about command name.
And check iisSettings in above section.
my case is using IIS as command, so I check iis => applictionUrl and sslPort.
the issue is here, the application url is using a different domain name.
which is different from the launch URL. once i republish the website on my local dev box using the launch url domain, it works fine. BTW, we use host file to fake those domain names.
if you have other team members working on the same project, make sure you all use same settings of the dev web site. or developers can just edit it locally, do not check in the settings if it could not work on other developer's machine.
in my case i solved the error deleting the .vs folder on the project root and i restarted visual studio.
I had an issue with failed to start process with commandline on the remote IIS. I had to add the web.config to the project and ensure it would be published. The default file looks like below:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- To customize the asp.net core module uncomment and edit the following section. For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
<system.webServer>
<handlers>
<remove name="aspNetCore" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
</system.webServer>
</configuration>
I replaced %LAUNCHER_PATH% with dotnet and %LAUNCHER_ARGS% with .\MyProjectNameHere.dll like
<aspNetCore processPath="dotnet" arguments=".\Web.Api.V3.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess">
Related
I'm trying to install a dotnet core application in IIS on a machine with windows server 2012 R2 installed, but I'm getting Error 500.19 with the following characteristics:
According to my searches, I already tested the following solutions:
I used a xml validator to validate both webconfig and applicationHost;
I uninstalled all versions of dotnet core and installed just the 2.1.1 bundle (with hosting and runtime);
I copied the project to another machine, with windows 10 installed and with dotnet core 2.1.1, and it works, but not in the machine I want;
I checked all the IIS features following this link;
I changed ApplicationPool to No Managed Code;
I also noticed that doing dotnet --version on command line it was not working, I fixed that (now it's working as supposed, saying that I need SDK to do this operation).
Following is my IIS information:
And next is my webconfig:
So, any idea why I'm still getting this error.
I appreciate some help =).
Thanks in advance.
UPDATE
I noticed that removing a line on my web.config I can access some functionalities of IIS without giving me the Error 0x8007000d. This is the line:
<aspNetCore requestTimeout="00:10:00" processPath="dotnet" arguments=".\Glintt.BedSide.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
So the problem is obviously here. Any idea why this line generates this error?
You need to install .NET Core 2.2 Runtime & Hosting Bundle for Windows.
This version for example: .NET Core 2.2 Runtime & Hosting Bundle for Windows
I am trying to run my asp.net core application (1.0 , 1.1 or 2.0) using IIS instead of IIS Express. However, when I try to do that I get the following error message:
Unable to start process c:\Program files\dotnet\dotnet.exe. The web
server failed with status code 500, Internal Server Error
It does work with IIS express
P.S tried reinstalling the dotnet core and starting VS ad administrator
applicationhost.config has a lot of information in it, but the section I needed to change was under the sites tag. The physical path was set to the directory where the project was located on my other computer. I changed the path to match the path on my current computer and all worked fine. Not sure why this path isn’t relative one it exists within the solution. This is the line that I needed to change.
<virtualDirectory path="/" physicalPath="C:\Users\ericl\Source\Repos\ASP.NET Core Contacts\Contacts\src\Contacts" />
As an alternative it also works to close Visual Studio delete the whole .vs folder and reopen the project in Visual Studio. This causes the config file to regenerated with the proper values.
for more details
I have a .NET Core web application which I deploy as an Azure Web App.
This has been working perfectly until last night when I applied the Visual Studio 2017 upgrade (v15.2).
The .net core version was upgraded from 1.1.1 to 1.1.2. When I deploy to Azure the website fails to start with a 502.5 error.
After investigating I can see .NET Core 1.1.2 is not deployed to the Azure image.
I cannot install the new framework to the web app instance (understandably permission is denied on the Program Files directory). I cannot 'downgrade' through the nuget package manager as it reports the version is 'Blocked by the project'. I cannot see a way to define the version of Microsoft.NETCore.App in the csproj file as it seems this is 'automagically' controlled by the root <Project Sdk="Microsoft.NET.Sdk.Web"> element.
I have tried attempting a self contained deployment (shipping the framework with the web app) but can't get this working either.
Short of waiting for the new version to be deployed to Azure (I can't find any information on their schedule for this) does anyone have any ideas on how to get the web app working again?
Is there any way to force it to run under 1.1.1?
Update 5/12/2017: we have accelerated the deployment of 1.1.2 and 1.0.5 to App Service and it is now complete. So the workaround below should no longer be needed by anyone.
Original solution
The best workaround is to set this in your .csproj file:
<TargetFramework>netcoreapp1.1.1</TargetFramework>
Instead of it being set to netcoreapp1.1. We will have 1.1.2 deployed to Azure App Service by Tuesday, at which point the workaround won't be necessary.
Note that if if you set it to netcoreapp1.1.1, once 1.1.2 is available it will auto-roll forward to that. So setting it to netcoreapp1.1.1 does not keep you 'stuck' to that version. This is true as long as you use Portable mode (i.e. rely on the framework that's on the OS). If you use standalone and deploy your own framework, then you would be stuck to it (but then you would not have had this issue in the first place and would not have needed to do that!).
We are having the same issue after the Visual Studio 2017 Update.
A workaround is to edit the web.config for your site in Kudu after it has been deployed.
Add --fx-version 1.1.1 at the start of the arguments value for the aspNetCore entry under system.webServer
e.g
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="--fx-version 1.1.1 PATH_TO_DLL" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
Until they get around to deploying 1.1.2 to the web app images I managed to fix this by forcing the project to reference Microsoft.NETCore.App 1.1.1
Edit the csproj file:
<ItemGroup>
<PackageReference Update="Microsoft.NETCore.App" Version="1.1.1" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
... etc
I'm trying to publish the template project "ASP.NET Core Web Application (.NET Framework)" from Visual Studio 2015 to IIS.
I use the Visual Studio publish to File System feature.
I'm using Windows 10.
I followed the guide from here.
I set up a website in IIS and changed the Application Pool .NET CLR Version to No Managed Code
I instaled the .NET Core Windows Server Hosting bundle
I restarted my machine.
I get this error:
I added a logs folder, but no logs get created.
Any ideas on how I can solve this?
EDIT:
Output of running the .exe from powershell:
PS C:\TestCoreWebsite> .\Web_CoreWebNetFramework.exe
Hosting environment: Production
Content root path: C:\TestCoreWebsite
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.
Then I navigate to http://localhost:5000 and the sample site works.
Found the solution:
In the root web.config change:
processPath="%LAUNCHER_PATH%"
to:
processPath=".\Web_CoreWebNetFramework.exe"
I ran the following command in cmd
C:\fullpath\dotnet C:\fullpath\PROJECT.dll
on the command prompt, which gave me a much more meaningful error:
"The specified framework 'Microsoft.NETCore.App', version '1.0.1' was
not found. - Check application dependencies and target a framework
version installed at: C:\Program
Files\dotnet\shared\Microsoft.NETCore.App - The following versions are
installed: 1.0.0 - Alternatively, install the framework version
'1.0.1'.
I Installed the correct net core and the project worked correctly
With VisualStudio 2017, open up the .csproj file and add to the first block:
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
Usually the result will be:
<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<RuntimeFrameworkVersion>1.0.4</RuntimeFrameworkVersion>
</PropertyGroup>
For whoever faces the same issue as mine(running well in VS but got above issue when deploying into Local IIS), I missed Setting Environment Variable and It works after I added the Setting Environment Variable
Ref: How to add Setting Environment Variable in IIS
I was trying to deploy my app into different environments then i started following this how to:
Deploying an ASP.NET Web Application to a Hosting Provider using Visual Studio or Visual Web Developer: Web.Config File Transformations - 3 of 12
was perfect until I clicked in Preview Transform, I received this error:
Microsoft Visual Studio
Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
(I created just one transformation Web.DebugQA.config and of course the default ones, debug and release)
my Web.DebugQA.config looks like this:
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
<system.web>
</system.web>
<appSettings>
<add key="EnvironmentName" value="QADev" xdt:Transform="SetAttributes(value)"
xdt:Locator="Match(key)" />
</appSettings>
</configuration>
but then I install this plugin:
SlowCheetah - XML Transforms
and I solved my preview transform error, but then when I was trying to publish using the QADev transform I got this error:
The "ImportParametersFile" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.Web.XmlTransform, Version=1.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at Microsoft.Web.Publishing.Tasks.ImportParametersFile.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__20.MoveNext()
WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
I'm using Visual Studio Pro 2012.
I fixed this by repairing "Microsoft ASP.NET and Web Tools 2013.1 - Visual Studio 2012" from Control Panel --> Programs and Features.
The file Microsoft.Web.XmlTransform.dll was missing from the path C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web.
I had a similar error, although it was caused for different reasons.
I solved it copying the following DLL from another PC with VS2012 installed:
Microsoft.Web.XmlTransforms.dll
from: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
I hope this helps
I had same problem in VS2012, could not 'Preview Transform' for the PublishPackage tranforms e.g. Web.Staging.config complaining about Microsoft.Web.XmlTransform
I got it working by adding the Package https://nuget.org/packages/Microsoft.Web.Xdt to my Mvc 4.5 project. This package is still in pre release.
PM> Install-Package Microsoft.Web.Xdt -Pre
This package contains the Microsoft.Web.XmlTransform.dll
I still get an error during building complaining about "Could not load file or assembly Microsoft.Web.XmlTransform". The Mvc project has still built ok.
I did try adding the Microsoft.Web.XmlTransform.dll to the Gac using the gacutil but that did not fix the problem.
However I use Team Foundation Service build server and it works and creates the correct Web.config after applying the Web.Release.config and then the Web.Staging.config.
I tried below two things but it did not work for me.
1) copying the Microsoft.Web.XmlTransforms.dll DLL to location C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web
2) And repairing "Microsoft ASP.NET and Web Tools 2013.1 - Visual Studio 2012"
Then I uninstalled Microsoft Azure tool V2.6 from control panel -> Programs and Features. And then I can able to publish my site.
This may have been fixed in Visual Studio 2012 Update 2 (and Visual Studio 2013).
Web.config "Preview Transform" gives an error
...
Posted by Microsoft on 3/1/2013 at 2:46 PM
Thanks for reporting the issue! It will be fixed in Visual Studio 2012 Update 2. Please install it when it becomes available.