Error referencing Xamarin.iOS Binding Project since updating to Visual Studio 2019 for Windows

dj.devdj.dev USMember ✭✭

Hi,

Since updating to Visual Studio 2019 for Windows, all of our Xamarin.iOS projects referencing a Xamarin.iOS native bindings project failed to build. Upon investigation, we noticed that Visual Studio has automatically added a <ReferenceOutputAssembly> element to the binding project references. Example from the .csproj:

<ProjectReference Include="..\PathToBindingsProject\BindingProjectName.csproj">
  <Project>{BCD5AC17-2DA4-406A-9931-1D4C3F8BB1EE}</Project>
  <Name>BindingProjectName</Name>
  <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>

Where <ReferenceOutputAssembly>false</ReferenceOutputAssembly> is the new line added automatically by Visual Studio 2019. If we change this to true, i.e. <ReferenceOutputAssembly>true</ReferenceOutputAssembly> , the referencing Xamarin.iOS project builds and runs fine. The problem however is that every time we re-open the solution, Visual Studio is automatically changing this element back to false. Which results in a lot of wasted time, unloading the csproj and editing this line to make the project build again.

Does anyone know if this is a known bug in Visual Studio 2019?

Some more details...

We are referencing the Xamarin.iOS bindings project as a project reference as described in the example documentation here:
https://docs.microsoft.com/en-us/xamarin/ios/platform/binding-objective-c/walkthrough?tabs=windows

See title "Using the binding"

When the build fails, (i.e. with ReferenceOutputAssembly = false), the error message from VS is:
The type or namespace name 'OurCustomTypeInNativeBindingsProject' could not be found (are you missing a using directive or an assembly reference?)

The Visual Studio 2019 for Windows version is 16.0.1 (9/04/2019). There are no updates available.
Xamarin 16.0.0.515 ([email protected])
Xamarin.iOS and Xamarin.Mac SDK 12.8.0.0 (0aa8452)

Our team members using Visual Studio 2019 for Mac, have reported that this is not an issue when building the same projects. So appears to be a Windows only problem.

Any suggestions or feedback would be welcome.

Thanks

Answers

Sign In or Register to comment.