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

Microsoft.Net.Compilers has misleading NuGet description (required framework) #18572

Closed
ashmind opened this issue Apr 10, 2017 · 17 comments
Closed
Milestone

Comments

@ashmind
Copy link
Contributor

ashmind commented Apr 10, 2017

Version Used:
Microsoft.Net.Compilers 2.0.1

Steps to Reproduce:

  1. Go to https://www.nuget.org/packages/Microsoft.Net.Compilers/
  2. The description says "Supported Platforms: - .NET Framework 4.5"
  3. Install Microsoft.Net.Compilers in a project, and try to run build on a machine without .NET 4.6.

Expected Behavior:
Description says "Supported Platforms: - .NET Framework 4.6" so developer does not attempt step 3.

Actual Behavior:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061: The "Csc" task could not be instantiated from "REDACTED\packages\Microsoft.Net.Compilers.2.0.1\build\..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll".  [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061: System.TypeInitializationException: The type initializer for 'Microsoft.CodeAnalysis.BuildTasks.ManagedCompiler' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.CodeAnalysis.BuildTasks.AssemblyResolution' threw an exception. ---> System.MissingMethodException: Method not found: '!!0[] System.Array.Empty()'. [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061:    at Roslyn.Utilities.CorLightup.Desktop.GetCurrentAppDomain() [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061:    at Roslyn.Utilities.CorLightup.Desktop.GetOrRemoveAssemblyResolveHandler(Func`3 handler, MethodInfo handlerOperation) [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061:    --- End of inner exception stack trace --- [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061:    at Microsoft.CodeAnalysis.BuildTasks.AssemblyResolution.Install() [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061:    --- End of inner exception stack trace --- [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4061:    at Microsoft.CodeAnalysis.BuildTasks.ManagedCompiler..ctor() [REDACTED\REDACTED.csproj]
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.CSharp.targets(316,9): error MSB4060: The "Csc" task has been declared or used incorrectly, or failed during construction. Check the spelling of the task name and the assembly name. [REDACTED\REDACTED.csproj]
@jcouv
Copy link
Member

jcouv commented Apr 10, 2017

FYI @jaredpar @agocke

@jasonmalinowski
Copy link
Member

@agocke Assigning this to you as it seems the other bug mentioned in your PR is currently closed. Feel free to dupe if you have another tracking bug.

@ashmind
Copy link
Contributor Author

ashmind commented Apr 12, 2017

Might be an unrelated bug, but does it actually require 4.6.1? Getting weird EntryPointNotFoundException on build server with 4.6, but not on local with 4.6.1 (unfortunately don't have the full trace at the moment, but top was something weird like IReadOnlyCollection<T>.get_Count).

Going to install 4.6.1 on build server tomorrow, and see if that helps.

@ashmind
Copy link
Contributor Author

ashmind commented Apr 12, 2017

Can confirm installing 4.6.1 fixes the issue, so the requirement should be 4.6.1, not 4.6.
Here is the stack trace when it's 4.6:

System.EntryPointNotFoundException: Entry point was not found.
   at System.Collections.Generic.IReadOnlyCollection`1.get_Count()
   at Microsoft.CodeAnalysis.CSharp.Binder.IsDegenerateQuery(QueryTranslationState state)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindQuery(QueryExpressionSyntax node, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node, DiagnosticBag diagnostics, Boolean invoked, Boolean indexed)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindExpression(ExpressionSyntax node, DiagnosticBag diagnostics, Boolean invoked, Boolean indexed)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindLambdaExpressionAsBlock(ExpressionSyntax body, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.UnboundLambdaState.ReallyBind(NamedTypeSymbol delegateType)
   at Microsoft.CodeAnalysis.CSharp.UnboundLambdaState.Bind(NamedTypeSymbol delegateType)
   at Microsoft.CodeAnalysis.CSharp.ConversionsBase.IsAnonymousFunctionCompatibleWithDelegate(UnboundLambda anonymousFunction, TypeSymbol type)
   at Microsoft.CodeAnalysis.CSharp.ConversionsBase.IsAnonymousFunctionCompatibleWithExpressionTree(UnboundLambda anonymousFunction, NamedTypeSymbol type)
   at Microsoft.CodeAnalysis.CSharp.ConversionsBase.HasAnonymousFunctionConversion(BoundExpression source, TypeSymbol destination)
   at Microsoft.CodeAnalysis.CSharp.ConversionsBase.ClassifyImplicitBuiltInConversionFromExpression(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, HashSet`1& useSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.ConversionsBase.ClassifyImplicitConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, HashSet`1& useSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.OverloadResolution.IsApplicable(Symbol candidate, EffectiveParameters parameters, AnalyzedArguments arguments, ImmutableArray`1 argsToParameters, Boolean isVararg, Boolean hasAnyRefOmittedArgument, Boolean ignoreOpenTypes, HashSet`1& useSiteDiagnostics)
   at Microsoft.CodeAnalysis.CSharp.OverloadResolution.IsApplicable[TMember](TMember member, TMember leastOverriddenMember, ArrayBuilder`1 typeArgumentsBuilder, AnalyzedArguments arguments, EffectiveParameters originalEffectiveParameters, EffectiveParameters constructedEffectiveParameters, ImmutableArray`1 argsToParamsMap, Boolean hasAnyRefOmittedArgument, HashSet`1& useSiteDiagnostics, Boolean inferWithDynamic)
   at Microsoft.CodeAnalysis.CSharp.OverloadResolution.IsMemberApplicableInNormalForm[TMember](TMember member, TMember leastOverriddenMember, ArrayBuilder`1 typeArguments, AnalyzedArguments arguments, Boolean isMethodGroupConversion, Boolean allowRefOmittedArguments, Boolean inferWithDynamic, HashSet`1& useSiteDiagnostics, Boolean completeResults)
   at Microsoft.CodeAnalysis.CSharp.OverloadResolution.AddMemberToCandidateSet[TMember](TMember member, ArrayBuilder`1 results, ArrayBuilder`1 members, ArrayBuilder`1 typeArguments, AnalyzedArguments arguments, Boolean completeResults, Boolean isMethodGroupConversion, Boolean allowRefOmittedArguments, Dictionary`2 containingTypeMapOpt, Boolean inferWithDynamic, HashSet`1& useSiteDiagnostics, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.OverloadResolution.PerformMemberOverloadResolution[TMember](ArrayBuilder`1 results, ArrayBuilder`1 members, ArrayBuilder`1 typeArguments, AnalyzedArguments arguments, Boolean completeResults, Boolean isMethodGroupConversion, Boolean allowRefOmittedArguments, HashSet`1& useSiteDiagnostics, Boolean inferWithDynamic, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.OverloadResolution.MethodOrPropertyOverloadResolution[TMember](ArrayBuilder`1 members, ArrayBuilder`1 typeArguments, AnalyzedArguments arguments, OverloadResolutionResult`1 result, Boolean isMethodGroupConversion, Boolean allowRefOmittedArguments, HashSet`1& useSiteDiagnostics, Boolean inferWithDynamic, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.Binder.ResolveDefaultMethodGroup(BoundMethodGroup node, AnalyzedArguments analyzedArguments, Boolean isMethodGroupConversion, HashSet`1& useSiteDiagnostics, Boolean inferWithDynamic, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.Binder.ResolveMethodGroupInternal(BoundMethodGroup methodGroup, SyntaxNode expression, String methodName, AnalyzedArguments analyzedArguments, Boolean isMethodGroupConversion, HashSet`1& useSiteDiagnostics, Boolean inferWithDynamic, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.Binder.ResolveMethodGroup(BoundMethodGroup node, SyntaxNode expression, String methodName, AnalyzedArguments analyzedArguments, Boolean isMethodGroupConversion, HashSet`1& useSiteDiagnostics, Boolean inferWithDynamic, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindMethodGroupInvocation(SyntaxNode syntax, SyntaxNode expression, String methodName, BoundMethodGroup methodGroup, AnalyzedArguments analyzedArguments, DiagnosticBag diagnostics, CSharpSyntaxNode queryClause, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindInvocationExpression(SyntaxNode node, SyntaxNode expression, String methodName, BoundExpression boundExpression, AnalyzedArguments analyzedArguments, DiagnosticBag diagnostics, CSharpSyntaxNode queryClause, Boolean allowUnexpandedForm)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindInvocationExpression(InvocationExpressionSyntax node, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindExpressionInternal(ExpressionSyntax node, DiagnosticBag diagnostics, Boolean invoked, Boolean indexed)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindExpression(ExpressionSyntax node, DiagnosticBag diagnostics, Boolean invoked, Boolean indexed)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindPossibleArrayInitializer(ExpressionSyntax node, TypeSymbol destinationType, BindValueKind valueKind, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindVariableOrAutoPropInitializer(EqualsValueClauseSyntax initializerOpt, RefKind refKind, TypeSymbol varType, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindFieldInitializer(Binder binder, FieldSymbol fieldSymbol, EqualsValueClauseSyntax equalsValueClauseNode, DiagnosticBag diagnostics)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindRegularCSharpFieldInitializers(CSharpCompilation compilation, ImmutableArray`1 initializers, ArrayBuilder`1 boundInitializers, DiagnosticBag diagnostics, ImportChain& firstDebugImports)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindFieldInitializers(CSharpCompilation compilation, SynthesizedInteractiveInitializerMethod scriptInitializerOpt, ImmutableArray`1 initializers, DiagnosticBag diagnostics, ImportChain& firstImportChain)
   at Microsoft.CodeAnalysis.CSharp.Binder.BindFieldInitializers(CSharpCompilation compilation, SynthesizedInteractiveInitializerMethod scriptInitializerOpt, ImmutableArray`1 fieldInitializers, DiagnosticBag diagnostics, ProcessedFieldInitializers& processedInitializers)
   at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType)
   at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>c__DisplayClass20_0.<CompileNamedTypeAsTask>b__0()

@jaredpar
Copy link
Member

Can confirm installing 4.6.1 fixes the issue, so the requirement should be 4.6.1, not 4.6.

That's disturbing because we explicitly target 4.6 frameworks in our projects (sometimes via NetStandard). There is no intent to take a dependency on 4.6.1 in this layer because it's unnecessary.

@agocke
Copy link
Member

agocke commented Apr 12, 2017

Yup, and I've confirmed that we're netstandard1.3 and the projects target 4.6, not 4.6.1

@weshaggard @ericstj Any idea what could be going on here?

@jaredpar
Copy link
Member

@agocke definitely Net Standad 1.3 compliant. Or at least when I port our code to the new SDK and use NetStandard 1.3 as the target it still compiles fine.

@jaredpar
Copy link
Member

Adding @terrajobst as well.

@ericstj
Copy link
Member

ericstj commented Apr 12, 2017

I disassembled IsDegenerateQuery and I see the following:

  IL_0001:  ldfld      class [System.Collections]System.Collections.Generic.Stack`1<class Microsoft.CodeAnalysis.CSharp.Syntax.QueryClauseSyntax> Microsoft.CodeAnalysis.CSharp.Binder/QueryTranslationState::clauses
  IL_0006:  call       bool [Microsoft.CodeAnalysis]Roslyn.Utilities.EnumerableExtensions::IsEmpty<class Microsoft.CodeAnalysis.CSharp.Syntax.QueryClauseSyntax>(class [System.Runtime]System.Collections.Generic.IReadOnlyCollection`1<!!0>)

We added IReadOnlyCollection to Stack in 4.6 . I suppose the build server might have been in some torn state. Install of 4.6.1 would have fixed that, repair of 4.6 would have done the same. /cc @AlexGhiondea

Anyone have a repro on something other than this one machine? You should check the version of System.dll loaded if this is happening. That should indicate what's going on.

The place to look would be C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll check file properties. A build from 4.6 or later would have a file version of 4.6.x.0. I believe RTM was 4.6.81.0.

@ashmind
Copy link
Contributor Author

ashmind commented Apr 12, 2017

The build server hdmp references System.ni.dll, 4.0.30319.36350 built by FX452RTMLDR -- seems like a server issue then.

@ericstj
Copy link
Member

ericstj commented Apr 12, 2017

Indeed, that's a native image from 4.5.2. If you have a machine in repro state it's something worth investigating from the setup and/or loader side. You shouldn't be able to get in a state with 4.6 installed running on 4.5.2 bits (unless there was a pending reboot or power failure during update or something).

@terrajobst
Copy link
Member

terrajobst commented Apr 12, 2017

Looks like everything is like it should be, except for the torn server state and the fact that your package description is wrong (.NET Standard 1.3 is only supported on .NET Framework 4.6.1)

@jaredpar
Copy link
Member

Glad to know it wasn't something wrong with our build. Was quite worried for a minute 😄

@terrajobst
Copy link
Member

There is something wrong with your build: it produces a NuGet package with the wrong description ;-)

@jasonmalinowski
Copy link
Member

@terrajobst We have that icky bit fixed; we're building the updated packages tomorrow. 😄

@mihailik
Copy link

Is this bug related in any way to #4889 ?

@agocke
Copy link
Member

agocke commented Jul 7, 2017

Looks like this was fixed by #17942

@agocke agocke closed this as completed Jul 7, 2017
@agocke agocke removed their assignment Jul 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants