Skip to content

WARNING - updating to Microsoft.AspNetCore.App (2.1.1) completely breaks IIS #3250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
karelz opened this issue Jun 21, 2018 · 17 comments
Closed

Comments

@karelz
Copy link
Member

karelz commented Jun 21, 2018

From @Bridgeway on June 21, 2018 9:17

Tempted by the Updates option in "Manage Packages for Solution" in VS 2017, I thought it would make sense to upgrade from the 2.1.0 preview final release version.

However after doing so, I noticed several packages that were removed during the upgrade were not re-installed and after this whenever running by clicking the green arrow next to IIS Express I got 502.5 at first from Chrome with no ability to debug web application at all, then the browser just flashed up and and the app stopped.

So it seems at the moment it is best to stick with the 2.1.0 preview version.
Hopefully this post will save others loads of wasted time :(

Copied from original issue: dotnet/corefx#30573

@karelz
Copy link
Member Author

karelz commented Jun 21, 2018

From @BjornSigurd on June 21, 2018 14:33

I confirm. Got the "502.5" error in Chrome after having upgraded from 2.1.0 to 2.1.1.
Downgrading from 2.1.1 to 2.1.0 solved the problem.

@BjornSigurd
Copy link

FYI: The Application log in Event Viewer shows the following error:
Application 'MACHINE/WEBROOT/APPHOST/XXXX' with physical root 'C:\Dropbox\kh\Code\XXXX\src' failed to start process with commandline 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\Extensions\Microsoft\Web Tools\ProjectSystem\VSIISExeLauncher.exe -argFile "C:\Users\BjornSigurd\AppData\Local\Temp\tmpAD46.tmp"', ErrorCode = '0x80004005 : 0.

@jonthegiant
Copy link

Confirmed, seems to relate to #3241

@cni13
Copy link

cni13 commented Jul 5, 2018

I updated the SDK to 2.1301 and update the NuGet packages, but now I get a build error in VSTS with the implicit SDK reference to Microsoft.AspNetCore.App. The migration guide (2.0 -> 2.1) says that you should omit the version number, but this leads to the situation that the build uses v2.1.0 instead of the available 2.1.1. This results in the following build error:

NU1107: Version conflict detected for Microsoft.AspNetCore.Hosting. Reference the package directly from the project to resolve this issue. FileStorage.Api -> Microsoft.AspNetCore.AzureAppServicesIntegration 2.1.1 -> Microsoft.AspNetCore.Hosting (>= 2.1.1) FileStorage.Api -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Hosting (= 2.1.0). Errors in C:\agent\_work\20\s\FileStorage.Api\FileStorage.Api.csproj NU1107: Version conflict detected for Microsoft.AspNetCore.Hosting. Reference the package directly from the project to resolve this issue. FileStorage.Api -> Microsoft.AspNetCore.AzureAppServicesIntegration 2.1.1 -> Microsoft.AspNetCore.Hosting (>= 2.1.1) FileStorage.Api -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Hosting (= 2.1.0).)

I guess I have to explicitly set the version of the package, although the migration guide told me not to.
See https://docs.microsoft.com/de-de/aspnet/core/fundamentals/metapackage-app?view=aspnetcore-2.1

@cocowalla
Copy link

Also results in a package version error if you try to use Entity Framework Core 2.1.1 without specifying a version for Microsoft.AspNetCore.App.

Warning	NU1608	Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.EntityFrameworkCore.SqlServer (= 2.1.0) but version Microsoft.EntityFrameworkCore.SqlServer 2.1.1 was resolved.	MyProject	C:\MyProject\MyProject.csproj	1	

Warning	NU1608	Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.0 requires Microsoft.EntityFrameworkCore.Tools (= 2.1.0) but version Microsoft.EntityFrameworkCore.Tools 2.1.1 was resolved.	MyProject	C:\MyProject\MyProject.csproj	1	

Error	NU1107	Version conflict detected for Microsoft.AspNetCore.Hosting. Reference the package directly from the project to resolve this issue. 
 MyProject -> Microsoft.AspNetCore.AzureAppServicesIntegration 2.1.1 -> Microsoft.AspNetCore.Hosting (>= 2.1.1) 
 MyProject -> Microsoft.AspNetCore.App 2.1.0 -> Microsoft.AspNetCore.Hosting (= 2.1.0).	MyProject	C:\MyProject\MyProject.csproj	1	

As @zuckerthoben said, ignoring the migration advice and specifying a version for Microsoft.AspNetCore.App seems to be the way to fix this.

.NET Core 2.1 and Microsoft.AspNetCore.App have been out for a while now - it would be nice to update the migration guide to stop others following its problematic advice and wasting time.

@Eilon
Copy link
Contributor

Eilon commented Jul 10, 2018

@natemcmaster / @JunTaoLuo / @davidfowl / @DamianEdwards - any ideas on this?

@natemcmaster
Copy link
Contributor

@cocowalla you are running into a known issue with the 2.1.0 package and 2.1.300 SDK. I recommend installing the latest .NET Core SDK on your machine, however, VSTS has not yet updated their images to 2.1.301 (see https://github.com/Microsoft/vsts-image-generation/issues/168). So, the only available workaround is to put the Version attribute on the PackageReference.

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.1" />
  </ItemGroup>

⚠️ please be aware that when you add Version="2.1.1" to your project, you will need to have the 2.1.1 runtime installed on your deployment servers for your app to work. Your app will still compile, even if the 2.1.1 runtime is not installed, but your server may fail to start (HTTP 502.5) because the 2.1.1 runtime (or higher) must be present

cref dotnet/AspNetCore.Docs#7540 and #3292

@Eilon Eilon closed this as completed Jul 13, 2018
@BjornSigurd
Copy link

I will completely skip 2.1.1 and wait for 2.1.2.
I am using Visual Studio for productive development, not technical hassle... ; )

Please make sure that all the SDK/version etc stuff works smoothly.
For instance, in my 'Control Panel' > 'Programs' folder, I now have an older .Net Core SDK with a higher version number than the SDK following following todays Visual Studio upgrade to VS version 15.7.5.
Personally, I think smooth installation should be prioritized above new or improved functionality.

@natemcmaster
Copy link
Contributor

I will completely skip 2.1.1 and wait for 2.1.2.

FYI - 2.1.2 became available earlier this week. It includes a few security patches, so you may want to take a look. (See https://blogs.msdn.microsoft.com/dotnet/2018/07/10/net-core-july-2018-update/)

I am using Visual Studio for productive development, not technical hassle... ; )

Deeply sorry. We learned too late that our original design was not equipped to handle servicing events. We've spent the last week discussion alternatives that we can reasonably implement soon to solve this issue. (cc @nguerrera)

For instance, in my 'Control Panel' > 'Programs' folder, I now have an older .Net Core SDK with a higher version number than the SDK following following todays Visual Studio upgrade to VS version 15.7.5.

This is a known issue. Please use https://github.com/dotnet/core-setup/issues/4188 for further discussion on the pros/cons of installers which remove old versions. (I personally agree, which is why I opened the issue, but there are some implications we have to think through.)

@BjornSigurd
Copy link

Ok, so you say that upgrading from 2.1.0 to 2.1.2 using NuGet Package Manager will be plug&play?

I have the latest VS version (15.7.2) which installed 'Microsoft .NET Core SDK - 2.1.202 (x64).

@natemcmaster
Copy link
Contributor

Actually, I would recommend keeping your PackageReference set to 2.1.1. I realize this is a confusing behavior, and it's something we're trying to address soon (see ongoing discussion here #3307).

The shortest answer I can give as to "why" is that the PackageReference to AspNetCore.App is special. The version acts as a minimum version. So, if you download and install the 2.1.2 runtime, your application will roll forward and run on 2.1.2 because it is the highest patch higher than 2.1.1. It doesn't work the other way around. If you update your PackageRef to 2.1.2 and your machine only has 2.1.0 or 2.1.1, .NET Core won't run the application.

@BjornSigurd
Copy link

What does "your machine only has 2.1.0 or 2.1.1" mean? (If you talk about the SDK, I have 2.1.202 which I assume is a 2.1.2 version).

@natemcmaster
Copy link
Contributor

So, the 2.1.202 SDK only includes the 2.0.9 runtime (confusing too, I know.1) The 2.1.* runtimes are included with the .NET Core SDK starting in 2.1.300. The latest SDK is 2.1.302. This includes the 2.1.2 runtime.

1 Starting with SDK 2.1.300 and going forward, the SDK . will match the . of the runtime it includes.

@BjornSigurd
Copy link

BjornSigurd commented Jul 13, 2018

So, if I

  1. Install the 2.1.302 SDK
  2. Use NuGet Package Manager in my VS project to upgrade to .Net Core 2.1.2

I will be all good?

PS. And when deploying my 'Self-contained' application to the production server, I only need to install 2.1.302 SDK on the production server? Or, is this SDK install not necessary on the prod server if 'Self-contained' means "100% self-contained"?

@natemcmaster
Copy link
Contributor

Yes, 2.1.302 SDK + the 2.1.2 packages will work.

Self-contained is 95% self-contained. The other 5% is machine pre-requisites depend in on OS. for example, you need libcurl3 and others on Ubuntu, or the C++ 2015 Redist for Windows 7 SP 1. Windows 10 or Windows Server 2016 have all the prerequisites by default. See https://docs.microsoft.com/en-us/dotnet/core/windows-prerequisites for details.

@BjornSigurd
Copy link

BjornSigurd commented Jul 14, 2018

Thank you for your good and understanding explanations.

2.1.302 SDK + NuGet Package Manager update to 2.1.2 seems to work fine.

Also, deployment of self-contained application (to Windows Server 2016 Datacenter) works fine by just using a plain application file copy.

@karelz

This comment has been minimized.

@dotnet dotnet locked as resolved and limited conversation to collaborators Nov 2, 2018
@dotnet dotnet deleted a comment Nov 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants