Tyler Brinks
Tyler Brinks

Reputation: 1201

Xamarin Studio build targets? Trying to get Fody working?

I'm trying to get Xamarin Studio to use PropertyChanged.Fody. I have Fody installed via NuGet which puts Fody.targets in its NuGet packages folder. But when I build, the output never shows that the target is run.

How can I tell Xamarin Studio to use the Fody build target?

Thanks!

Upvotes: 10

Views: 3127

Answers (3)

Gering
Gering

Reputation: 3460

There is an error in the Fody.targets file. Just replace

Condition="Exists(@(IntermediateAssembly))"

with

Condition="Exists('@(IntermediateAssembly)')"

and it should work again.

Find the file in .../projectfolder/packages/Fody2.x.x/build/netstandard1.4/Fody.targets

Upvotes: 2

rid00z
rid00z

Reputation: 1616

I had the same issue and managed to figure out that if you remove the build\Microsoft.Bcl.Build.targets from the csproj file Fody runs as normal.

So try and remove this line.

<Import Project="..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\packages\Microsoft.Bcl.Build.1.0.21\build\Microsoft.Bcl.Build.targets')" />

Upvotes: 16

Stephane Delcroix
Stephane Delcroix

Reputation: 16232

As you tagged your question with , I assume you're having the issue on iOS. Until very recently, Xamarin.Studio wasn't using xbuild (or msbuild) to build the project, and then additional targets were skipped.

Starting with Xamarin.iOS 7.9 (or more realistically 8.0), the default is unchanged but you have the option to enable it from the project preferences :

use MSBuild build engine

Ignore the "unsupported" warning, but know that it's unsupported if you have any issue.

Then, provided that the nuget correctly added a line like

  <Import Project="PATH_TO/Fody.targets" />

the target should be executed.

Upvotes: 2

Related Questions