question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

EnablePreviewFeatures not working in 8.0.100-alpha.1.22469.4

See original GitHub issue

Describe the bug

https://github.com/dotnet/aspnetcore/pull/44066 updated the SDK from 7.0 to 8.0.100-alpha.1.22469.4 and now EnablePreviewFeatures isn’t working in tests and samples.

Exceptions (if any)

D:\github\aspnetcore\src\Servers\Kestrel\Transport.Quic\test\QuicConnectionContextTests.cs(60,50): error CA2252: Using
'ConnectAsync' requires opting into preview features. See https://aka.ms/dotnet-warnings/preview-features for more info
rmation. [D:\github\aspnetcore\src\Servers\Kestrel\Transport.Quic\test\Microsoft.AspNetCore.Server.Kestrel.Transport.Qu
ic.Tests.csproj]

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:19 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
emex-yakovlevcommented, Nov 9, 2022

I just updated to Visual Studio release v17.4.0 and this bug is affecting all projects as I was running net6.0…

Editing the project file helped me

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

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <LangVersion>Preview</LangVersion>
    <EnablePreviewFeatures>True</EnablePreviewFeatures>
    <GenerateRequiresPreviewFeaturesAttribute>True</GenerateRequiresPreviewFeaturesAttribute>
    ..
  </PropertyGroup>
1reaction
curt-wcommented, Nov 9, 2022

I just updated to Visual Studio release v17.4.0 and this bug is affecting all projects as I was running net6.0.

As noted in this thread, <EnablePreviewFeatures> seems only to work with latest version. Since NET 7.0 is released now, updating my framework reference resolved issues. May not be a solution for everyone though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CA2252 warnings with .NET 7 RC1 SDK · Issue #28049
NET 7 SDK the IsNetCoreAppTargetingLatestTFM will not be true ... EnablePreviewFeatures not working in 8.0.100-alpha.1.22469.4 #28016.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found