-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
System.Data.Common.dll has an incorrect format #23279
Comments
This looks like a BadImageFormatException when reading |
That doesn't seem to be it. I'm reproducing it now on other assemblies. Looking into it. |
The problem here is that the workflow XAML compiler is loading reference assemblies for execution. Its similar to https://github.com/dotnet/corefx/issues/23229. The offending method is Microsoft.Activities.Build.Utilities.GetLocalAssembly(string). This ends up loading the reference from the target framework for execution in the build process. |
Workaround is the following, note that this relies on private MSBuild item names and could be broken in the future. Note that this requires both a workaround for the xaml compiler and the workaround from #23174 since the workflow compiler is emitting a static set of reference filenames into a generated file and trying to load them at runtime. <Target Name="ReplaceNetFxNetStandardRefWithLib" AfterTargets="ImplicitlyExpandNETStandardFacades">
<ItemGroup>
<Reference Remove="@(_NETStandardLibraryNETFrameworkReference)" Condition="'%(FileName)' != 'netfx.force.conflicts'"/>
<Reference Include="@(_NETStandardLibraryNETFrameworkLib)">
<Private>true</Private>
</Reference>
</ItemGroup>
</Target>
<Target Name="RemoveNetFxForceConflicts" AfterTargets="ResolveAssemblyReferences">
<ItemGroup>
<ReferencePath Remove="@(ReferencePath)" Condition="'%(FileName)' == 'netfx.force.conflicts'" />
</ItemGroup>
</Target> |
Moved this to SDK: dotnet/sdk#1522 |
I am in the process of updating a project that uses Windows Workflow to use some netstandard2.0 dependent assemblies.
When I build the project I get the following warning
The problem is the workflows now do not run and I get the following
This project has been working fine when all assemblies were targeting net461. This has only happened since introducing the netstandard2.0 libraries.
I am running VS 2017 15.3.1 and the official .NET Core 2.0 SDK.
This problem is actually really easy to reproduce, just create a standard .NET framework project and then add any netstandard2.0 assembly to the project and just add a blank Workflow .xaml file and compile. You'll get the warning or you might need to fix the first warning you get by following the links below first.
You may need to also modify the project file to stop the problem noted at https://github.com/dotnet/sdk/issues/1509 and you might also want to modify the project file so that nuget plays nicely like in https://github.com/dotnet/sdk/issues/901
The text was updated successfully, but these errors were encountered: