Roslyn: Portable Class library - > Platform target 'AnyCPU' is not supported by one or more of the project's targets.

Created on 11 Apr 2016  路  14Comments  路  Source: dotnet/roslyn

Repo Steps

  • Create a new portable class library
  • Change the target to .NetStandard > 1.2
  • Build

Expected

  • Builds with no error

Actual
capture

Area-IDE Bug Verified

All 14 comments

AnyCPU is the default, so are you saying that by default, targeting .NET Standard shows an error in the Error List?

yes, and the build comes back and succeeded

This isn't ours, this is portable.

Should this still be assigned to @jinujoseph?

No

Any workaround?

@rchande's has a private fix you want one.

Can you verify this?

I'm seeing this error as well. What do I need to do the verify your fix?

Install a build of VSUML > 25319.00.

I'm also seeing this with NetStandard 1.0 in VS "15" Preview 2.

I'm curious about this from my perspective as an author of a library trying out VS "15" and NetStandard. I innocuously clicked the "Target .NET Standard" button in the VS Project Properties window, chose to target NetStandard 1.0, updated some dependencies, and am seeing this failure. I'm not even sure what it means, and whether I should assume its a VS Preview/packaging bug or I have my dependencies set up wrong.

I'm not even sure what AnyCPU really implies about the framework used:

  1. Does it mean "anything but .NET Native" (i.e. either .NET Core w CLR or .NET Framework?)

    • if so, I still expect NetStandard 1.0 to support these

  2. Does it mean .NET Framework?

    • NetStandard 1.0 would cover 4.6, no?

@Eyas This particular error (about "AnyCPU") is a bug in Visual Studio and has no bearing on where or where not NetStandard projects can run. In fact, you should be able to ignore it and still be able to build/run your projects. This will be fixed in the next update.

Verified this on build 14.0.25323.00 update 3 RC

I'm able to reproduce the error using Visual Studio 2015 Update 2 targeting .NETStandard1.5.
The assembly is bult though.

Was this page helpful?
0 / 5 - 0 ratings