Skip to content

Conversation

@wtgodbe
Copy link
Member

@wtgodbe wtgodbe commented Aug 20, 2020

Resolves #22853

Adds net461 to all netstandard2.0 projects, except analyzers, tests, test assets, and Razor SDK projects

@wtgodbe wtgodbe requested a review from a team August 20, 2020 20:25
@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 20, 2020

current issue:

C:\code\aspnet\aspnetcore\src\SignalR\samples\ClientSample\Tcp\TcpConnection.cs(58,40): error CS1503: Argument 1: cannot convert from 'System.Net.EndPoint' to 'System.Net.Sockets.SocketAsyncEventArgs' [C:\code\aspnet\aspnetcore\src\SignalR\samples\ClientSample\ClientSample.csproj]

await _socket.ConnectAsync(_endPoint);

ClientSample always targeted net461 and net50 - not sure what I changed that would have caused the failure. It appears it wants to call this overload: https://github.com/dotnet/runtime/blob/885bb524674a22ac90979e64dd71394262ff2530/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketTaskExtensions.cs#L17-L18

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition, suggest adding $(DefaultNetFxTargetFramework) to more of the integration and functional test projects that exercise the updated projects.

<IsShippingPackage>false</IsShippingPackage>

<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether adding a .NET Framework assembly for analyzers is useful. @pranavkm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't think this should be necessary. The ns2.0 version works in VS and CLI, so unless something's broken there, I wouldn't change these.

<PropertyGroup>
<Description>ASP.NET Core design time hosting infrastructure for the Razor view engine.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes w/in the Razor SDK probably aren't useful. @NTaylorMullen

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. These extensions are packaged in the SDK. Unless we are shipping the netfx versions for some reason, I'd avoid this change

<PackageId>$(MSBuildProjectName)</PackageId>
<PackageTags>Build Tasks;MSBuild;Swagger;OpenAPI;code generation;Web API client;service reference</PackageTags>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert changes in this file. The project creates an msbuild task that's always loaded from the netstandard2.0 assembly.

Copy link
Contributor

@pranavkm pranavkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of this change?

<IsShippingPackage>false</IsShippingPackage>

<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I don't think this should be necessary. The ns2.0 version works in VS and CLI, so unless something's broken there, I wouldn't change these.

<PropertyGroup>
<Description>Helpers for writing tests for Roslyn analyzers.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing. This is a test only project, so unless something requires it, I wouldn't cross-compile it.


<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave testassets be (unless something requires it to be cross-compiled)

<PropertyGroup>
<Description>ASP.NET Core design time hosting infrastructure for the Razor view engine.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. These extensions are packaged in the SDK. Unless we are shipping the netfx versions for some reason, I'd avoid this change

<DefineConstants Condition="'$(GenerateBaselines)'=='true'">$(DefineConstants);GENERATE_BASELINES</DefineConstants>
<DefineConstants>$(DefineConstants);__RemoveThisBitTo__GENERATE_BASELINES</DefineConstants>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;net461</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the net461 from this?


<PropertyGroup>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<TargetFrameworks>$(DefaultNetFxTargetFramework);netstandard2.0;net461</TargetFrameworks>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

net461 appears twice here

@dougbu
Copy link
Contributor

dougbu commented Aug 20, 2020

What's the benefit of this change?

We have a requirement (expressed in #22853) to better-support customers using .NET Framework i.e. to avoid relying on netstandard2.0. Basically, those writing extensions should use the netstandard2.0 assemblies while application authors should use the desktop or .NET Core assemblies.

@Pilchie Pilchie added the feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform label Aug 24, 2020
@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 25, 2020

Source build failures:

##[error].dotnet/sdk/5.0.100-rc.1.20379.10/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(198,5): error NU5019: (NETCORE_ENGINEERING_TELEMETRY=Build) File not found: '/__w/1/s/artifacts/bin/Microsoft.AspNetCore.Mvc.Analyzers/Release/Microsoft.AspNetCore.Mvc.Analyzers.dll'.

##[error]src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/src/Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj(0,0): error MSB4057: The target "GetTargetPath" does not exist in the project.

@wtgodbe wtgodbe marked this pull request as ready for review August 25, 2020 19:31
@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 25, 2020

@dotnet/aspnet-build I believe this is now ready for review

<SystemCommandlineExperimentalPackageVersion>0.3.0-alpha.19317.1</SystemCommandlineExperimentalPackageVersion>
<SystemComponentModelPackageVersion>4.3.0</SystemComponentModelPackageVersion>
<SystemNetHttpPackageVersion>4.3.2</SystemNetHttpPackageVersion>
<SystemNetHttpPackageVersion>4.3.4</SystemNetHttpPackageVersion>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bumped this up to the latest

@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 25, 2020

From the issue:

  • src\DataProtection\Cryptography.KeyDerivation\src\PBKDF2\NetCorePbkdf2Provider.cs
  • src\Identity\Extensions.Core\src\PasswordHasher.cs
  • src\Shared\WebEncoders\WebEncoders.cs
  • src\SignalR\common\Shared\MemoryBufferWriter.cs
  • src\SignalR\common\Shared\PipeWriterStream.cs

@dougbu NetCorePbkdf2Provider has no #IFs, while WebEncoders, MemoryBufferWriter, and PipeWriterStream only have #IF NETCOREAPP. I did have to modify PasswordHasher (along with a couple other .cs files) to get the repo to build

Copy link
Contributor

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small cleanup needed but otherwise looks good

@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 26, 2020

Test failures are all the Chrome thing - @dougbu @BrennanConroy @captainsafia do we have an issue tracking that yet?

@BrennanConroy
Copy link
Member

No issue yet. Probably going to have to port the change to all branches affected. (maybe 2.1+)

@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 26, 2020

Selenium failures 😢 will rebase

@wtgodbe wtgodbe force-pushed the wtgodbe/netfxAssemblies branch from f84a60d to 3c547e2 Compare August 26, 2020 22:20
@dougbu
Copy link
Contributor

dougbu commented Aug 26, 2020

will rebase

/fyi @wtgodbe doing the /azp run dance would suffice too. That creates another merge commit w/ the base branch and kicks off AzDO using that. You only really need to rebase PR branches when either (a) you wanna know exactly what you're building or (b) your updates conflict w/ something in the base branch.

@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 27, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@wtgodbe
Copy link
Member Author

wtgodbe commented Aug 27, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@Pilchie
Copy link
Member

Pilchie commented Aug 27, 2020

Approved for RC1 - thanks @wtgodbe !

@Pilchie Pilchie added the Servicing-approved Shiproom has approved the issue label Aug 27, 2020
@wtgodbe wtgodbe merged commit ce058f6 into release/5.0 Aug 27, 2020
@wtgodbe wtgodbe deleted the wtgodbe/netfxAssemblies branch August 27, 2020 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-platform Deprecated: Cross-cutting issues related to ASP.NET Core as a platform Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants