Bug 57029 - .nib output from assemblies in solution not included in application bundle
Summary: .nib output from assemblies in solution not included in application bundle
Status: RESOLVED DUPLICATE of bug 55147
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Mac Add-in ()
Version: 7.0 (VSforMac)
Hardware: PC Mac OS
: High major
Target Milestone: 15.4
Assignee: Bugzilla
Depends on:
Reported: 2017-06-01 01:31 UTC by xamarin
Modified: 2017-06-09 14:49 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Diagnostic build output from msbuild and xbuild. (831.36 KB, application/zip)
2017-06-01 01:31 UTC, xamarin

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description xamarin 2017-06-01 01:31:24 UTC
Created attachment 22607 [details]
Diagnostic build output from msbuild and xbuild.

It appears that using msbuild to build a program does not include .nib files from referenced assemblies in the same solution. This is a breaking change in behavior compared to xbuild.

The following GitHub repo contains the code used for this bug report:

The attached file contains build output (diagnostic) from building twice - once with msbuild, once with xbuild. This project has a long history -- the .xib files were created in Xcode 4.x on a Mac OS X 10.7 computer with the last compatible Xamarin Studio. The .cs code has since been migrated from MonoMac to Xamarin.Mac, and builds correctly in the last Xamarin Studio's default settings. It does not work correctly when built in Visual Studio for Mac.

When the solution Locutus/Locutus.XamMac.git.sln at the above depot is built with **msbuild**, the resulting program, LtoFlash, will *ONLY* contain .nib files for corresponding .xib files directly in the LtoFlash project in the application bundle's Resources. The program cannot launch, as nearly all of the visuals are defined in assemblies in the solution that are referred to by the LtoFlash project.

If you build the solution with xbuild, the .nib files from assemblies referred to by the LtoFlash project *will* be included in the application bundle, and the application can launch.
Comment 1 Matt Ward 2017-06-01 08:55:05 UTC
How are you building the project with xbuild or msbuild?

The build output seems to use projects and solutions which are not available from the VINTage.git repository:


Can you attach the information from the About dialog - show details page?
Comment 2 xamarin 2017-06-01 12:45:59 UTC
The solution at GitHub is just a renamed copy of the one that was built.

As described in the bug report, when the solution is built with msbuild, the .nibs are not copied into the app resource bundle. This is regardless of whether built in the IDE or via command line.

The Visual Studio for Mac info:

=== Visual Studio Community 2017 for Mac ===

Version 7.0.1 (build 24)
Installation UUID: bf1ed5cd-6210-42cb-908c-e63a0d9f0528
	Mono (2017-02/5077205) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500010001

=== NuGet ===


=== .NET Core ===

Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.5.4
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.3.2 (12175)
Build 8E2002

=== Xamarin.iOS ===

Version: (Visual Studio Community)
Hash: d2270eec
Branch: d15-2
Build date: 2017-05-22 16:30:53-0400

=== Xamarin.Android ===

Version: (Visual Studio Community)
Android SDK: /Users/steveno/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		6.0 (API level 23)

SDK Tools Version: 25.1.2
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:

=== Xamarin.Mac ===

Version: (Visual Studio Community)

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Build Information ===

Release ID: 700010024
Git revision: 7ab1ca2ced6f584e56b7a0d4d321d00775cd95c9
Build date: 2017-05-19 05:44:51-04
Xamarin addins: 08d17158f3365beee5e60f67999e607cce4b3f93
Build lane: monodevelop-lion-d15-2

=== Operating System ===

Mac OS X 10.12.5
Darwin 16.6.0 Darwin Kernel Version 16.6.0
    Fri Apr 14 16:21:16 PDT 2017
    root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
Comment 3 Lluis Sanchez 2017-06-01 13:16:08 UTC
Info provided.
Comment 4 xamarin 2017-06-01 15:08:35 UTC
This GitHub link may be easier to use:

Comment 5 Matt Ward 2017-06-02 11:05:18 UTC
The reason I asked about how the project was being built was because the projects seem to be MonoMac projects, which as far as I know do not support being compiled with MSBuild nor xbuild. If I try to use xbuild or msbuild from the command line I get errors about missing MonoMac.targets.


I can see some of the projects import these files:

<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />

Building inside the IDE does not use MSBuild or xbuild as far as I can see. That requires going into the MonoMac project options and checking the "Use MSBuild build engine (unsupported for this project type)" in Build - General. Doing that and then you get the same errors about the missing MonoMac.targets.
Comment 6 xamarin 2017-06-02 15:19:59 UTC
You're using the wrong solution. The *.Mac.sln are MonoMac.

You need to use Locutus.XamMac.git.sln.
Comment 7 Matt Ward 2017-06-02 15:32:44 UTC
Ah, sorry.

I can repro it now with VSMac 7.0.1. Building with msbuild only the MainMenu.nib and MainWindow.nib are included in the app bundle. Building with xbuild all the .nib files are added to the app bundle.
Comment 8 Jeffrey Stedfast 2017-06-09 14:49:08 UTC

*** This bug has been marked as a duplicate of bug 55147 ***