Closed tom-cognify closed 6 years ago
Can you run the published app from the command line on that server?
no, I get the same error if I try to run at the command line
What does your csproj look like?
Hi, Make sure you have all config files in the directory. I was having the same issue with the deployment of a windows service.
I have the same error and configuration:
Windows 2012 R2 with iis and Microsoft .NET Core 2.0.0 - Windows Server Hosting (and .net core runtime 2.0.0), running a web app using c# over .NET 4.6.2 compiled using visual studio 2017 enterprise all with lastest updates.
That error does not happen using the same configuration in windows 10.
Thanks in advance for your help
Removing codegen reference from csproj also solves a similar issue.
When I remove these lines all work fine for web projects .net for mvc6 (but the same lines work fine with other web projects with .net core for mvc6)
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.DotNet.Xdt.Tools" Version="2.0.0" />
</ItemGroup>
<Target Name="RemoveHandlersFromWebConfig" AfterTargets="_TransformWebConfig">
<PropertyGroup>
<_SourceWebConfig>$(PublishDir)App.config</_SourceWebConfig>
<_XdtTransform>$(MSBuildThisFileDirectory)App.$(ConfigurationName).config</_XdtTransform>
<_TargetWebConfig>$(PublishDir)$(TargetFileName).config</_TargetWebConfig>
</PropertyGroup>
<Exec Command="dotnet transform-xdt --xml "$(_SourceWebConfig)" --transform "$(_XdtTransform)" --output "$(_TargetWebConfig)"" />
<Exec Command="del $(PublishDir)App*.config" />
</Target>
<_XdtTransform>$(MSBuildThisFileDirectory)App.$(ConfigurationName).config</_XdtTransform>
<_TargetWebConfig>$(PublishDir)$(TargetFileName).config</_TargetWebConfig>
</PropertyGroup>
<Exec Command="dotnet transform-xdt --xml "$(_SourceWebConfig)" --transform "$(_XdtTransform)" --output "$(_TargetWebConfig)"" />
<Exec Command="del $(PublishDir)App*.config" />
</Target>
We're closing this issue as no response or updates have been provided in a timely manner and we have been unable to reproduce it. If you have more details and are encountering this issue please add a new reply and re-open the issue.
I upgraded a ASP.NET CORE 1.1 app that targets the full framework 4.6.2. Everything works fine in development running under IIS Express on win10. When I publish to our Windows 2012 R2 servers, the app fails to start and I'm getting this error in the sdout logs.
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=0.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication() at Microsoft.AspNetCore.Hosting.WebHostBuilder.Build() at CaseLogic.Web.Program.BuildWebHost(String[] args) at CaseLogic.Web.Program.Main(String[] args)
I did install the .NET Core Windows Server Hosting bundle for 2.0 and I went through the troubleshooting guide for IIS deployment on the docs site, but not seeing any guidance on this error.
Thanks