Forum Visual Studio

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


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">

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:

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 ([email protected])
Xamarin.iOS and Xamarin.Mac SDK (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.



Sign In or Register to comment.