Ariel Y
Ariel Y

Reputation: 21

Add assembly binding to fakes file

I use msbuild to compile a csproj which contains a Fakes definitions:

<Fakes Include="Fakes\AnotherProject.Fakes">
   <SubType>Designer</SubType>
</Fakes>

This definition produces a MSB3277 warning (conflicts between different versions of few dependent dlls).

Adding "AutoGenerateBindingRedirects" property in the fakes file solved some of the conflicts but not all of them.

Is there a way to add assembly binding to the fakes file? Is there a way to suppress those errors? other suggestions?

Upvotes: 1

Views: 321

Answers (1)

Ariel Y
Ariel Y

Reputation: 21

I've managed to solve this by adding section to the .fakes file as follows:

  <Compilation>
    <Property Name="AutoGenerateBindingRedirects">True</Property>
    <Property Name="AppConfig">App.config</Property>
  </Compilation>

and copied the App.config file to the intermediate folder in the obj folder by using Prebuild event in the .csproj file.

Upvotes: 1

Related Questions