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.

.NET Core SDK 3.1.300-preview-015048 breaks build with multi targeting

See original GitHub issue

With .NET Core SDK 3.1.200 installed the AWS .NET Core Lambda libraries fail for projects doing multi targeting. For example I have a project that is doing multi targeting with <TargetFrameworks>netstandard2.0;netcoreapp3.1</TargetFrameworks> and I’m getting following errors with 3.1.200

Internal\InvokeFeatures.cs(6,17): error CS0234: The type or namespace name 'Pipelines' does not exist in the namespace 'System.IO' (are you missing an assembly reference?) [C:\temp\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.AspNetCoreServer\Amazon.Lambda.AspNetCoreServer.csproj]                                      
Internal\InvokeFeatures.cs(232,9): error CS0246: The type or namespace name 'PipeWriter' could not be found (are you missing a using directive or an assembly reference?) [C:\temp\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.AspNetCoreServer\Amazon.Lambda.AspNetCoreServer.csproj]                                        
Internal\InvokeFeatures.cs(232,45): error CS0539: 'InvokeFeatures.Writer' in explicit interface declaration is not found among members of the interface that can be implemented [C:\temp\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.AspNetCoreServer\Amazon.Lambda.AspNetCoreServer.csproj]                                  
Internal\InvokeFeatures.cs(30,31): error CS0012: The type 'PipeWriter' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.IO.Pipelines, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. [C:\temp\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.AspNetCoreServer\
Amazon.Lambda.AspNetCoreServer.csproj]                                                                                                                                                                                                                                                                                          
Internal\InvokeFeatures.cs(230,17): error CS0246: The type or namespace name 'PipeWriter' could not be found (are you missing a using directive or an assembly reference?) [C:\temp\aws-lambda-dotnet\Libraries\src\Amazon.Lambda.AspNetCoreServer\Amazon.Lambda.AspNetCoreServer.csproj]  

To reproduce the failure you can use the following steps.

git clone https://github.com/aws/aws-lambda-dotnet.git
cd ./aws-lambda-dotnet/Libraries/src/Amazon.Lambda.AspNetCoreServer
git checkout dev-netcore31
dotnet build

but if I use the following steps which setup a global.json file to use 3.1.101 the project builds correctly.

git clone https://github.com/aws/aws-lambda-dotnet.git
cd ./aws-lambda-dotnet/Libraries/src/Amazon.Lambda.AspNetCoreServer
dotnet new globaljson --sdk-version 3.1.101
git checkout dev-netcore31
dotnet build

This might be related to https://github.com/dotnet/sdk/issues/10878 but since that one was talking about AssemblyLoadContext issues as part of the build I wasn’t sure this should be tagged onto the same issue.

Not sure if this is related but in Visual Studio it is skipping the build for all of the projects even though there is no bin or obj folder on 3.1.200 but when I add the global.json for 3.1.101 Visual Studio builds the solution correctly.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
StummeJcommented, May 20, 2020

Looks like they split this package out. Running dotnet add package System.IO.Pipelines --version 4.7.2 in your project that uses pipelines fixed it for us.

0reactions
marcpopMSFTcommented, Aug 26, 2021

Closing as this was in a 3.1.3xx preview and sounds like solutions were found. Reactivate if it’s still something you want investigated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking changes in .NET Core 3.1
NET Core SDK 3.1.400, only top-level package references are returned by the RunResolvePackageDependencies target. Version introduced .NET Core ...
Read more >
MSBuild breaking changes in .NET Core 2.1 - 3.1
Lists the breaking changes in MSBuild for .NET Core 2.1 ... NET Core SDK 3.1.400, only top-level package references are returned by the ......
Read more >
How to multitarget .NET 5 and .NET Core 3.1 while still ...
NET SDK. I'm trying to find a condition so I can target net5.0 only if it is available, but documentation is sparse ...
Read more >
The current .NET SDK does not support targeting . ...
I want to create a class library project with Target Framework .NET Standard 2.0. I've updated my Visual Studio 2017 to Version 15.3...
Read more >
The Obligatory "How I Upgraded To .NET Core 3.1" Post
The very first step was to update the project files to target netcoreapp31 . You can also remove the explicit references to the...
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