_This issue has been moved from a ticket on Developer Community._
[regression] [worked-in:16.3.x]
After I updated my VS installation none of my asp.net projects will run InProcess. They all report HTTP Error 500.30 ANCM In-Process start failure. If I change the application to run Out Of Procees the application runs just fine with no errors.
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
This happened to us when we upgraded to 16.4 when we did the change you did it worked but slowed down.
What resolved it for us was changing the package reference from
<PackageReferenceInclude="Microsoft.AspNetCore"Version="2.2.0" /> to <PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />#### Brecht Vanhaesebrouck on 12/6/2019, 03:58 AM:
I've also encountered this issue and came to the same solution as TKelly
I had to remove several packages to get our application to run InProcess.
From our web application we removed
"Microsoft.AspNetCore.CookiePolicy" Version="2.2.0"
"Microsoft.AspNetCore.HttpsPolicy" Version="2.2.0"
"Microsoft.AspNetCore.Mvc.TagHelpers" Version="2.2.0"
"Microsoft.AspNetCore.Session" Version="2.2.0"
From a helper application we removed
"Microsoft.AspNetCore" Version="2.2.0"
"Microsoft.AspNetCore.Identity" Version="2.2.0"
"Microsoft.AspNetCore.Mvc.Core" Version="2.2.5"
"Microsoft.AspNetCore.Mvc.Razor" Version="2.2.0"
"Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.2.0"
This looks like a runtime issue, I鈥檓 going to move this to GitHub so our team can look at it further there. The next comment should include a link to the GitHub issue that was created!
(no solutions)
What resolved it for us was changing the package reference
Can anyone post their full csproj before working around this issue? Are you upgrading your app to 3.0 or is this still a 2.2 app, just being run after you've installed 3.0?
It's look like this other bug https://github.com/aspnet/AspNetCore/issues/17614
change
<PackageReferenceInclude="Microsoft.AspNetCore"Version="2.2.0" />
to
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
works for me
With InProcess Hosting trying to run IISExpress, the error is "The configuration file 'appsettings.json' was not found and is not optional" as Directory.GetCurrentDirectory() from .SetBasePath(Directory.GetCurrentDirectory()) points to "C:\Program Files\IIS Express". This only started to happen after upgrade to Visual Studio 16.4 and the change mentioned by shahabfar above works fine for now (though I am not sure of the actual impact of changing that reference).
for me, @shahabfar solution doesn't work. new project is working, but my current in progress dev. project don't
full csproj :
XML
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup Label="Globals">
<SccProjectName>SAK</SccProjectName>
<SccProvider>SAK</SccProvider>
<SccAuxPath>SAK</SccAuxPath>
<SccLocalPath>SAK</SccLocalPath>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
<Prefer32Bit>true</Prefer32Bit>
<NoWarn>NU1701;1702</NoWarn>
<DocumentationFile>ECS.PR.Extra.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Content Remove="app.poste.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Remove="Properties\LocalizationForm.de.resx" />
<EmbeddedResource Remove="Properties\LocalizationForm.resx" />
</ItemGroup>
<ItemGroup>
<None Remove="ECS.PR.Extra.xml" />
</ItemGroup>
<ItemGroup>
<Content Include="src\externe\jquery-validation-unobtrusive\jquery.validate.unobtrusive.js" />
<Content Include="src\externe\jquery-validation-unobtrusive\jquery.validate.unobtrusive.min.js" />
<Content Include="src\externe\jquery-validation-unobtrusive\LICENSE.txt" />
<Content Include="src\externe\jquery-validation\dist\additional-methods.js" />
<Content Include="src\externe\jquery-validation\dist\additional-methods.min.js" />
<Content Include="src\externe\jquery-validation\dist\jquery.validate.js" />
<Content Include="src\externe\jquery-validation\dist\jquery.validate.min.js" />
<Content Include="src\externe\jquery-validation\LICENSE.md" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BuildBundlerMinifier" Version="3.0.415" />
<PackageReference Include="CAC.AccesProfil.Client" Version="1.3.2" />
<PackageReference Include="CAC.Contexte" Version="1.3.1" />
<PackageReference Include="CAC.Trace" Version="1.2.0.1-dotnetcore" />
<PackageReference Include="LazyCache.AspNetCore" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.CodeAnalysis.Razor" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Serilog" Version="2.9.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Http" Version="5.2.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.Diagnostics.EventLog" Version="4.6.0" />
<PackageReference Include="System.Runtime.Caching" Version="4.6.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.6.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.6.0" />
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\Versements\" />
</ItemGroup>
<ItemGroup>
<None Include="Areas\OutilsEssais\Pages\clicSEQUR\Create.cshtml" />
<None Include="Areas\OutilsEssais\Pages\clicSEQUR\Delete.cshtml" />
<None Include="Areas\OutilsEssais\Pages\clicSEQUR\Details.cshtml" />
<None Include="Areas\OutilsEssais\Pages\clicSEQUR\Edit.cshtml" />
<None Include="Areas\OutilsEssais\Pages\clicSEQUR\Index.cshtml" />
<None Include="Areas\OutilsEssais\Pages\Configuration\Index.cshtml" />
<None Include="Areas\OutilsEssais\Pages\Configuration\_CodeNtPartial.cshtml" />
<None Include="Areas\OutilsEssais\Pages\Configuration\_OptionsDeveloppement.cshtml" />
<None Include="Areas\OutilsEssais\Pages\ContenuCache\Index.cshtml" />
<None Include="Areas\OutilsEssais\Pages\ContenuCache\_ContenuCache.cshtml" />
<None Include="Areas\OutilsEssais\Pages\Debug.cshtml" />
<None Include="Areas\OutilsEssais\Pages\_ViewImports.cshtml" />
<None Include="Areas\OutilsEssais\Pages\_ViewStart.cshtml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ECS.SV.Helpers\ECS.SV.Helpers.csproj" />
<ProjectReference Include="..\ECS.TR.Commun\ECS.TR.Commun.csproj" />
<ProjectReference Include="..\ECS.TR.Contrats\ECS.TR.Contrats.csproj" />
<ProjectReference Include="..\JwtAuthenticationHelper\JwtAuthenticationHelper.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="MessagePack">
<HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\messagepack\1.7.3.4\lib\netstandard2.0\MessagePack.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Content Update="CAC.config">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Target Name="SetParametersDeploy" AfterTargets="Package">
<MakeDir Directories="$(PackageLocation)" />
<Copy SourceFiles="@(Parameterization)" DestinationFolder="$(PackageLocation)" />
</Target>
</Project>
for me, @shahabfar solution doesn't work. new project is working, but my current in progress dev. project don't
full csproj :
<Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup Label="Globals"> <SccProjectName>SAK</SccProjectName> <SccProvider>SAK</SccProvider> <SccAuxPath>SAK</SccAuxPath> <SccLocalPath>SAK</SccLocalPath> </PropertyGroup> <PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> <Nullable>enable</Nullable> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PlatformTarget>x64</PlatformTarget> <Prefer32Bit>true</Prefer32Bit> <NoWarn>NU1701;1702</NoWarn> <DocumentationFile>ECS.PR.Extra.xml</DocumentationFile> </PropertyGroup> <ItemGroup> <Content Remove="app.poste.config" /> </ItemGroup> <ItemGroup> <EmbeddedResource Remove="Properties\LocalizationForm.de.resx" /> <EmbeddedResource Remove="Properties\LocalizationForm.resx" /> </ItemGroup> <ItemGroup> <None Remove="ECS.PR.Extra.xml" /> </ItemGroup> <ItemGroup> <Content Include="src\externe\jquery-validation-unobtrusive\jquery.validate.unobtrusive.js" /> <Content Include="src\externe\jquery-validation-unobtrusive\jquery.validate.unobtrusive.min.js" /> <Content Include="src\externe\jquery-validation-unobtrusive\LICENSE.txt" /> <Content Include="src\externe\jquery-validation\dist\additional-methods.js" /> <Content Include="src\externe\jquery-validation\dist\additional-methods.min.js" /> <Content Include="src\externe\jquery-validation\dist\jquery.validate.js" /> <Content Include="src\externe\jquery-validation\dist\jquery.validate.min.js" /> <Content Include="src\externe\jquery-validation\LICENSE.md" /> </ItemGroup> <ItemGroup> <PackageReference Include="BuildBundlerMinifier" Version="3.0.415" /> <PackageReference Include="CAC.AccesProfil.Client" Version="1.3.2" /> <PackageReference Include="CAC.Contexte" Version="1.3.1" /> <PackageReference Include="CAC.Trace" Version="1.2.0.1-dotnetcore" /> <PackageReference Include="LazyCache.AspNetCore" Version="2.0.1" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.0.0" /> <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.6"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.CodeAnalysis.Razor" Version="3.0.0" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> <PackageReference Include="Serilog" Version="2.9.0" /> <PackageReference Include="Serilog.AspNetCore" Version="3.1.0" /> <PackageReference Include="Serilog.Sinks.Http" Version="5.2.0" /> <PackageReference Include="System.Configuration.ConfigurationManager" Version="4.6.0" /> <PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" /> <PackageReference Include="System.Diagnostics.EventLog" Version="4.6.0" /> <PackageReference Include="System.Runtime.Caching" Version="4.6.0" /> <PackageReference Include="System.ServiceModel.Http" Version="4.6.0" /> <PackageReference Include="System.ServiceModel.Primitives" Version="4.6.0" /> </ItemGroup> <ItemGroup> <Folder Include="Pages\Versements\" /> </ItemGroup> <ItemGroup> <None Include="Areas\OutilsEssais\Pages\clicSEQUR\Create.cshtml" /> <None Include="Areas\OutilsEssais\Pages\clicSEQUR\Delete.cshtml" /> <None Include="Areas\OutilsEssais\Pages\clicSEQUR\Details.cshtml" /> <None Include="Areas\OutilsEssais\Pages\clicSEQUR\Edit.cshtml" /> <None Include="Areas\OutilsEssais\Pages\clicSEQUR\Index.cshtml" /> <None Include="Areas\OutilsEssais\Pages\Configuration\Index.cshtml" /> <None Include="Areas\OutilsEssais\Pages\Configuration\_CodeNtPartial.cshtml" /> <None Include="Areas\OutilsEssais\Pages\Configuration\_OptionsDeveloppement.cshtml" /> <None Include="Areas\OutilsEssais\Pages\ContenuCache\Index.cshtml" /> <None Include="Areas\OutilsEssais\Pages\ContenuCache\_ContenuCache.cshtml" /> <None Include="Areas\OutilsEssais\Pages\Debug.cshtml" /> <None Include="Areas\OutilsEssais\Pages\_ViewImports.cshtml" /> <None Include="Areas\OutilsEssais\Pages\_ViewStart.cshtml" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\ECS.SV.Helpers\ECS.SV.Helpers.csproj" /> <ProjectReference Include="..\ECS.TR.Commun\ECS.TR.Commun.csproj" /> <ProjectReference Include="..\ECS.TR.Contrats\ECS.TR.Contrats.csproj" /> <ProjectReference Include="..\JwtAuthenticationHelper\JwtAuthenticationHelper.csproj" /> </ItemGroup> <ItemGroup> <Reference Include="MessagePack"> <HintPath>C:\Program Files\dotnet\sdk\NuGetFallbackFolder\messagepack\1.7.3.4\lib\netstandard2.0\MessagePack.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <Content Update="CAC.config"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </Content> </ItemGroup> <Target Name="SetParametersDeploy" AfterTargets="Package"> <MakeDir Directories="$(PackageLocation)" /> <Copy SourceFiles="@(Parameterization)" DestinationFolder="$(PackageLocation)" /> </Target> </Project>```
I don't see a reference like:
in your code, so you probably experience some related issue, but not exactly the one we had.
it's a very similar issue, because same behavior. I tried vs 16.5 preview, not better, rolling back right now to 16.3.x
Uninstalling only 16.4 is not sufficient, need to uninstall dotnet 3.1 too. The bug likely come from .net core 3.1 itself. After rollback I think the real bug is in error handling, .net crash internally and do not show exception correctly.
@anisite apologies for the struggles you are having. Let's try to figure this out.
After rollback I think the real bug is in error handling, .net crash internally and do not show exception correctly.
Can you clarify this point a bit?
@NCSharp you said:
With InProcess Hosting trying to run IISExpress, the error is "The configuration file 'appsettings.json' was not found and is not optional" as Directory.GetCurrentDirectory() from .SetBasePath(Directory.GetCurrentDirectory()) points to "C:\Program Files\IIS Express". This only started to happen after upgrade to Visual Studio 16.4 and the change mentioned by shahabfar above works fine for now (though I am not sure of the actual impact of changing that reference).
Where are you seeing this error come from? That error seems fishy. Could you capture some additional diagnostics via: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.1#enhanced-diagnostic-logs
@anisite apologies for the struggles you are having. Let's try to figure this out.
After rollback I think the real bug is in error handling, .net crash internally and do not show exception correctly.
Can you clarify this point a bit?
@NCSharp you said:
With InProcess Hosting trying to run IISExpress, the error is "The configuration file 'appsettings.json' was not found and is not optional" as Directory.GetCurrentDirectory() from .SetBasePath(Directory.GetCurrentDirectory()) points to "C:\Program Files\IIS Express". This only started to happen after upgrade to Visual Studio 16.4 and the change mentioned by shahabfar above works fine for now (though I am not sure of the actual impact of changing that reference).
Where are you seeing this error come from? That error seems fishy. Could you capture some additional diagnostics via: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.1#enhanced-diagnostic-logs
I uninstalled 16.4 and .net core 3.1 so I am sorry I can't reproduce it anymore. However I can tell you that:
Project is set to target .net core 3.0 but indeed we are still using some 2.2 libraries. However it seems indeed fishy that when I installed .net core 3.1 and VS 2019 16.4 a .dll is probably taken from the new framework and contains a different implementation for GetCurrentDirectory..
Directory.GetCurrentDirectory() -> is now returning the project path; with .net core 3.1 it was returning "C:\Program Files\IIS Express".
That seems very fishy. There was a bug in that behavior in 2.2, but was fixed in a patch quickly in ANCM. Can you see what versions of Microsoft.AspNetCore.Server.IIS dll and the aspnetcorev2_inprocess.dll loaded when you hit the start of program main? Should be visible under the modules tab in VS.
@jkotalik I think you are right, I found a "project reference" with a 2.2 Microsoft.AspNetCore.X reference on it... Removing it seems to correct the problem, but, I can't confirm entirely for now. My team and I have postponed 3.1 migration after christmas, when it will be more "mature", I think it's unusual to crash with only "privatelib" error with no stack trace, no stdout, no event viewer log, nothing... it's a little unclear, no ?
Directory.GetCurrentDirectory() -> is now returning the project path; with .net core 3.1 it was returning "C:\Program Files\IIS Express".
That seems very fishy. There was a bug in that behavior in 2.2, but was fixed in a patch quickly in ANCM. Can you see what versions of Microsoft.AspNetCore.Server.IIS dll and the aspnetcorev2_inprocess.dll loaded when you hit the start of program main? Should be visible under the modules tab in VS.
This is what I got in modules tab when the error happens.. (with inProcess hosting model, with Out of Process works fine).
As I stated, I'm specifically looking for the vesrsions of Microsoft.AspNetCore.Server.IIS and aspnetcorev2_inprocess.dll. Are those modules/dlls loaded?
As I stated, I'm specifically looking for the vesrsions of Microsoft.AspNetCore.Server.IIS and aspnetcorev2_inprocess.dll. Are those modules/dlls loaded?
No, except for the modules from the printscreen there is only one other dll loaded, the specific project one, but that should not affect this.
@NCSharp can you try attaching the Native debugger as well? The aspnetcorev2_inprocess.dll module is a native library so you won't see it if you only have the Managed Code debugger attached. You can attach to the process with the "Mixed" debugging option (or launch under the mixed debugger via Project Properties). If you can get that attached, you should be able to find aspnetcorev2_inprocess.dll in your module list.
Update to this thread, we found a regression in the SDK which caused this mismatch in dependencies. Information is available here https://github.com/aspnet/Announcements/issues/398. Workarounds are mentioned there and I'll update this thread when we we release a formal fix.
We have upgraded our .net core project from 2.1 to 3.1.0 and are using Visual studio 2019 (16.4). I was able to get the application running in local IIS but is failing to run on IIS in Demo/QA environments, throwing a generic error, "HTTP Error 500.30 - ANCM In-Process Start Failure". After logging enabled found the error as below. I checked all the appsettings Json files and they were not modified compared to the working version. Also made sure that there are no old package references. Any help is appreciated.
"Application: w3wp.exe
CoreCLR Version: 4.700.19.56106
.NET Core Version: 3.1.0
Description: The process was terminated due to an unhandled exception.
Exception Info: System.FormatException: Could not parse the JSON file.
---> System.Text.Json.JsonReaderException: '"' is invalid after a value. Expected either ',', '}', or ']'. LineNumber: 11 | BytePositionInLine: 3.
"
@ppadarthi It sounds like this is an unrelated issue (at least from first glance). Please file a new issue with the details. If it turns out to be related, we'll figure that out later :).
We have a fix for this in the upcoming 3.1.2 release of .Net Core, which will be shipping later this month. At that time you should be able to resolve the issue by updating your SDK & PackageReferences to the 3.1.2 versions. I'll update this thread once 3.1.2 goes public.
3.1.2 released on 2/18/20. Please download from https://dotnet.microsoft.com/download.