Skip to content
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

Switching my ASP.NET Core app to netcoreapp3.0 and adding a global.json for 3.0.100-preview8-013656: all requests hang #13541

Closed
kierenj opened this issue Aug 29, 2019 · 14 comments
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.

Comments

@kierenj
Copy link

kierenj commented Aug 29, 2019

Describe the bug

I have a fairly simple ASP.NET Core app. It's been running fine, but I want to get the latest EF Core 3.0 preview, so I can use Cosmos DB. So, I switched to:

<TargetFramework>netcoreapp3.0</TargetFramework>

and added a global.json with:

{ "sdk": { "version": "3.0.100-preview8-013656" } }

(and of course installed the freshest version of 3.0 preview 8)

I'm running from VS 2019 16.2.3.

My app starts, but any requests (to the default endpoint, to swagger, to my file-serving endpoint, or another Web API endpoint) just seem to "hang" open: the browser page pauses, and curl sits there forever. If I break the debugger, there's no managed code running

Note that I did not update any NuGet packages at all, I only made the two changes shared above.

Removing the <PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="3.0.0-preview8.19405.11" /> dependency (and associated code) and doing back to <TargetFramework>netcoreapp2.1</TargetFramework>, the project immediate starts running correctly as before again.

To Reproduce

It's a tricky one, though it's a simple app, it uses what is currently our own proprietary internal set of nuget packages to "bootstrap" things to get started.

While I can't share the source here at the moment (though I would be happy to, with MS staff, via email), I wonder if there are any pointers that could be shared to help me track this down, diagnose, or collect appropriate info?

Expected behavior

Everything to work as it did before.

Additional context

dotnet --info output:

.NET Core SDK (reflecting any global.json):
 Version:   3.0.100-preview8-013656
 Commit:    8bf06ffc8d

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.18362
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\

Host (useful for support):
  Version: 3.0.0-preview8-28405-07
  Commit:  d01b2fb7bc

.NET Core SDKs installed:
  1.0.0-preview2.1-003155 [C:\Program Files\dotnet\sdk]
  1.0.0-preview2-003131 [C:\Program Files\dotnet\sdk]
  1.0.0-preview2-003133 [C:\Program Files\dotnet\sdk]
  1.0.0-preview2-1-003177 [C:\Program Files\dotnet\sdk]
  1.0.0-preview2-1-003182 [C:\Program Files\dotnet\sdk]
  1.0.0-preview4-004233 [C:\Program Files\dotnet\sdk]
  1.0.1 [C:\Program Files\dotnet\sdk]
  1.0.2 [C:\Program Files\dotnet\sdk]
  1.1.0-preview1-005051 [C:\Program Files\dotnet\sdk]
  1.1.0-preview1-005098 [C:\Program Files\dotnet\sdk]
  1.1.0 [C:\Program Files\dotnet\sdk]
  2.0.0-preview2-006497 [C:\Program Files\dotnet\sdk]
  2.0.0 [C:\Program Files\dotnet\sdk]
  2.0.2 [C:\Program Files\dotnet\sdk]
  2.1.4 [C:\Program Files\dotnet\sdk]
  2.1.104 [C:\Program Files\dotnet\sdk]
  2.1.200 [C:\Program Files\dotnet\sdk]
  2.1.201 [C:\Program Files\dotnet\sdk]
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.400 [C:\Program Files\dotnet\sdk]
  2.1.401 [C:\Program Files\dotnet\sdk]
  2.1.402 [C:\Program Files\dotnet\sdk]
  2.1.500 [C:\Program Files\dotnet\sdk]
  2.1.502 [C:\Program Files\dotnet\sdk]
  2.1.505 [C:\Program Files\dotnet\sdk]
  2.1.600 [C:\Program Files\dotnet\sdk]
  2.1.801 [C:\Program Files\dotnet\sdk]
  2.2.108 [C:\Program Files\dotnet\sdk]
  2.2.200 [C:\Program Files\dotnet\sdk]
  3.0.100-preview8-013656 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 3.0.0-preview8.19405.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.0-preview1-001100-00 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.2.0-beta-001297-00 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.0-preview2-25407-01 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 3.0.0-preview8-28405-07 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 3.0.0-preview8-28405-07 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]    
To install additional .NET Core runtimes or SDKs:
  https://aka.ms/dotnet-download

(Can't wait for dotnet uninstall or similar...)

@Tratcher
Copy link
Member

Note that I did not update any NuGet packages at all

Please share your current csproj so we can see all of your dependency versions. Note mixing 2.x and 3.0 dependencies is not supported.

@kierenj
Copy link
Author

kierenj commented Aug 29, 2019

Will do. The only 3.0 dependency was the EF Core Cosmos provider package. Would that be enough to mess things up?

@Tratcher
Copy link
Member

Maybe, that provider has 3.0 dependencies.

@kierenj
Copy link
Author

kierenj commented Aug 29, 2019

Here's my .csproj. I now realise that it may be pretty useless without all of the nuget package sources (they're on a private feed).

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <LangVersion>7.3</LangVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DocumentationFile>.\bin\Debug\netcoreapp3.0\BeatBrain.xml</DocumentationFile>
    <NoWarn>1701;1702;1705;1591</NoWarn>
    <PlatformTarget>AnyCPU</PlatformTarget>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
  </PropertyGroup>

  <ItemGroup>
    <None Remove="*-config.json" />
    <Content Include="*-config.json">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore.Cosmos" Version="3.0.0-preview8.19405.11" />
    <PackageReference Include="RedRiver.SaffronCore" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Autofac" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.AspNetCore" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Auth" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.EntityFramework.AuthStore" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.EntityFramework" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.EntityFramework.Tooling" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Queues" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.RedisCore" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Redis.RegularWorker" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Redis.Queues" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Cqrs" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.AutoMapper" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Sql.EventScheduleStore" Version="2.0.1-alpha1-*" />
    <PackageReference Include="RedRiver.Saffron.Azure.Email" Version="2.0.1-alpha1-*" />
  </ItemGroup>

  <!-- front-end files to serve -->
  <ItemGroup>
    <None Remove="Frontend\Content\**" />
    <Content Include="Frontend\Content\**">
      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
    </Content>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Format\AsyncStreams\" />
  </ItemGroup>
  
</Project>

For ref, the one with the ASP.NET Core reference:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <Description>xxx</Description>
    <VersionPrefix>2.0.1</VersionPrefix>
    <TargetFramework>netstandard2.0</TargetFramework>
    <AssemblyName>RedRiver.Saffron.AspNetCore</AssemblyName>
    <PackageId>RedRiver.Saffron.AspNetCore</PackageId>
  </PropertyGroup>

  <ItemGroup>
    <ProjectReference Include="..\RedRiver.SaffronCore\RedRiver.SaffronCore.csproj" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0"/>
    <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
    <PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.2.1" />
    <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="4.0.1" />
    <PackageReference Include="Swashbuckle.AspNetCore.SwaggerUI" Version="4.0.1" />
  </ItemGroup>

</Project>

It's fine if you were to just say "you can't mix any 3.0 nuget packages we have with any non-3.0 nuget packages we have" - I'll get busy upgrading our universe to 3.0. It was just surprising - no warnings, no build errors, it "runs", just requests hang..

@Tratcher
Copy link
Member

Yeah, there have been significant breaking changes between 2.2 and 3.0, there's no expectation that any new packages work with the old ones. Upgrade and we'll see how it goes.

@kierenj
Copy link
Author

kierenj commented Aug 29, 2019

I'm trying to do that now - I'm hopeful. I am having some difficulties though I'm sure the resources are out there somewhere, but not forthcoming to me and I'm feeling pretty stupid - so I'd be very grateful indeed if I might bother with you with but one quick question -

How do I upgrade to ASP.NET Core 3.0?

This - https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30 - says "If there's no 3.0 version of a package, the package might have been deprecated in 3.0. ". So that includes my main reference, https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc/ . Indeed, #3756 says I shouldn't use it, instead adding a FrameworkReference to Microsoft.AspNetCore.App.

I worked that out (I figured the docs should probably include that?) - but get:

NETSDK1073
The FrameworkReference 'Microsoft.AspNetCore.App' was not recognized
C:\Program Files\dotnet\sdk\3.0.100-preview8-013656\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets	262	

My TargetFramework is netstandard2.1, since this component is a library. Is that where I'm falling short? How can I update my library to 3.0?

Many thanks indeed - with this I hope to be able to get everything up-and-running on 3.0.

@Tratcher
Copy link
Member

@JunTaoLuo @davidfowl where's our guidance for 3.0 class libraries referencing Microsoft.AspNetCore.App?

@JunTaoLuo
Copy link
Contributor

Yes, if your library depends on Microsoft.AspNetCore.App, you'll also need to update your tfm to netcoreapp3.0.

@davidfowl
Copy link
Member

Yep you need to target the netcoreapp3.0 tfm.

@jkotalik
Copy link
Contributor

jkotalik commented Sep 3, 2019

Shouldn't it also be

<Project Sdk="Microsoft.NET.Sdk.Web">

instead of Microsoft.NET.Sdk?

@jkotalik jkotalik added the Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue. label Sep 3, 2019
@kierenj
Copy link
Author

kierenj commented Sep 4, 2019

I dont know - is that a question for me? The migration doc didnt seem to mention it?

@JunTaoLuo
Copy link
Contributor

No it doesn't have to use the Web SDK. Though it has a reference to Microsoft.AspNetCore.App, the project itself is a class library and not a runnable app.

@shirhatti
Copy link
Contributor

I've filed a docs issue- dotnet/AspNetCore.Docs#14245

@analogrelay
Copy link
Contributor

Closing as it appears that this is a docs issue and that work is covered by the docs issue: dotnet/AspNetCore.Docs#14309 (cc @DamianEdwards)

@ghost ghost locked as resolved and limited conversation to collaborators Dec 2, 2019
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Needs: Author Feedback The author of this issue needs to respond in order for us to continue investigating this issue.
Projects
None yet
Development

No branches or pull requests

9 participants