Unable to build .NET 4.5.2 project since Win10 Fall Creators Update

stephen.waters's Avatar

stephen.waters

06 Nov, 2017 11:02 AM

Since updating to the Win10 Fall Creators Update, when trying to build a .NET 4.5.2 project the following error has begun appearing:

error PS0099:
Unhandled exception (5.0.30.0, postsharp-net40-x64-srv.exe, CLR 4.0.30319.461308, Release): PostSharp.Sdk.CodeModel.BindingException: The type 'System.ValueTuple`3' does not exist in the target platform.
    at PostSharp.Sdk.CodeModel.Binding.ReflectionBindingManager.GetReferenceAssembly(IAssemblyName assemblyName, String typeName, BindingOptions bindingOptions)
    at PostSharp.Sdk.CodeModel.Binding.ReflectionBindingManager.ResolveAssembly(Type type, BindingOptions bindingOptions)
    at PostSharp.Sdk.CodeModel.ModuleDeclaration.FindType(Type reflectionType, BindingOptions bindingOptions)
    at PostSharp.Sdk.CodeModel.ModuleDeclaration.FindType(Type reflectionType, BindingOptions bindingOptions)
    at PostSharp.Sdk.CodeModel.ModuleDeclaration.FindType(Type reflectionType, BindingOptions bindingOptions)
    at ^XJbqCOExOmCj.^i8LBKh1N(ModuleDeclaration _0, MethodBase _1, BindingOptions _2)
    at PostSharp.Sdk.CodeModel.ModuleDeclaration.^FXZSEVD9(Object _0, Boolean _1, MetadataDeclaration& _2, TokenType& _3)
    at PostSharp.Sdk.CodeModel.Domain.^LTFA90pH(Object _0, Type _1, MetadataDeclaration& _2, TokenType& _3)
    at PostSharp.Sdk.CodeModel.Domain.FindDeclaration(Object reflectionElement, MetadataDeclaration& target, TokenType& tokenType)
    at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^UW4gjp78(IEnumerable`1 _0, TypeDefDeclaration _1, SymAspectInstance _2, StructuredDeclarationDictionary`1 _3)
    at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^UW4gjp78(AspectWeaverInstance _0, StructuredDeclarationDictionary`1 _1)
    at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^lp9i7ZhC(InstructionWriter _0, AspectInstanceInfo _1, StructuredDeclarationDictionary`1 _2)
    at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.^gJhZb6Cg.^KzeTZ0pV(IMetadataDeclaration _0, AspectInstanceInfo _1)
    at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^lNgKC+Z4(IMetadataDeclaration _0, Func`3 _1)
    at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^+g+TCqVg(TypeDefDeclaration _0, Func`2 _1, Set`1 _2)
    at PostSharp.Sdk.AspectInfrastructure.StructuredDeclarationDictionary`1.^fJqG(Func`2 _0)
    at PostSharp.Sdk.AspectWeaver.AspectWeaverTask.Execute()
    at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
    at PostSharp.Sdk.Extensibility.Project.Execute()
    at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
    at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation).

System.ValueTuple is definitely an included reference (I've tried re-adding it to see if there was a faulty binding). There error message seems similar to the one reported here but the workaround advice there does not apply as the DLL in question does not exist for me.

  1. 1 Posted by stephen.waters on 06 Nov, 2017 01:25 PM

    stephen.waters's Avatar

    Updating to PS 5.0.37 yields a different error message when building:

    error PS0125:
    An unexpected exception occurred when executing user code: System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    File name: 'System.ValueTuple, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' ---> System.IO.FileLoadException: Could not load file or assembly 'System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    File name: 'System.ValueTuple, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value HKLM\Software\Microsoft\Fusion!EnableLog to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
       at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
       at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
       at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
       at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
       at System.Reflection.CustomAttribute.IsCustomAttributeDefined(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Int32 attributeCtorToken, Boolean mustBeInheritable)
       at System.Reflection.CustomAttribute.IsDefined(RuntimePropertyInfo property, RuntimeType caType)
       at Base.Aspects.DataContractAspect.<ProvideAspects>d__0.MoveNext() in C:\Repos\assessment-management-and-delivery\Core\Base.Aspects\DataContractAspect.cs:line 31
       at PostSharp.Sdk.Utilities.ExceptionHelper.ExecuteUserCodeT
    
  2. 2 Posted by stephen.waters on 06 Nov, 2017 02:11 PM

    stephen.waters's Avatar

    Sample repro project attached.

  3. Support Staff 3 Posted by PostSharp Techn... on 08 Nov, 2017 09:41 PM

    PostSharp Technologies's Avatar

    Hello,

    Win10 Fall Creators Update includes .NET Framework 4.7.1. PostSharp currently has several known compatibility issues with .NET 4.7.1 and we are working on fixing them. One of these known issues (#15337) is related to System.ValueTuple referenced from a NuGet package. As a workaround you can try to retarget your project to .NET 4.7.1 which includes System.ValueTuple.

    We will get back to you once the bug fix is available.

    -alex

  4. Support Staff 4 Posted by PostSharp Techn... on 20 Nov, 2017 09:51 AM

    PostSharp Technologies's Avatar

    Hello,

    we released a bug fix for this issue in PostSharp 5.0.38.

    I'm going to close this ticket now, but feel free to reopen it if you need a further assistance.

    Best regards
    -jakub

  5. PostSharp Technologies closed this discussion on 20 Nov, 2017 09:51 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac