Bug 57899 - Resx satellite assemblies not included in IPA if building via MSBuild
Summary: Resx satellite assemblies not included in IPA if building via MSBuild
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.6.0 (15.3)
Hardware: PC Windows
: Normal normal
Target Milestone: 15.4
Assignee: Adrian Alonso
Depends on:
Reported: 2017-07-01 11:57 UTC by Christian Schwarz
Modified: 2017-08-09 07:56 UTC (History)
8 users (show)

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

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 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 Christian Schwarz 2017-07-01 11:57:26 UTC
I have resx files as Embedded Resource with Custom Tool PublicResXFileCodeGenerator in a PCL class library.

It works fine if I build the IPA file in Visual Studio, but if I build it on command line with MSBuild it generates the satellite assemblies in output folder, but they are not included in the IPA file.

The following command is used:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" Path\To\Test.iOS.csproj /p:ServerAddress=x.x.x.x;ServerUser=user;Configuration=AppStore;Platform=iPhone;OutputPath=Path\To\Output
Comment 1 Manuel de la Peña [MSFT] 2017-07-03 10:48:33 UTC

We need some extra information. Does this happen only on Windows with VS? Can you provide full information about your environment?
Comment 2 Christian Schwarz 2017-07-03 15:45:37 UTC
I've only tested it on Windows as I don't think I can build a Xamarin project with MSBuild on Linux/OSX.

If you need any other information than below feel free to ask.

Microsoft Visual Studio Enterprise 2017 
Version 15.2 (26430.14) Release
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Enterprise

Architecture Diagrams and Analysis Tools   00369-60000-00001-AA757
Microsoft Architecture Diagrams and Analysis Tools

Visual Basic 2017   00369-60000-00001-AA757
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA757
Microsoft Visual C# 2017

Visual C++ 2017   00369-60000-00001-AA757
Microsoft Visual C++ 2017

Visual F# 4.1   00369-60000-00001-AA757
Microsoft Visual F# 4.1

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Common Azure Tools   1.9
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JavaScript UWP Project System   2.0
JavaScript UWP Project System

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

Mono Debugging for Visual Studio   Mono.Debugging.VisualStudio
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.3.50417.1
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager   4.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

TypeScript tools for Visual Studio

Visual Studio tools for CMake   1.0
Visual Studio tools for CMake

Visual Studio Tools for Unity
Visual Studio Tools for Unity

Visual Studio Tools for Universal Windows Apps   15.0.26430.06
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Xamarin (fec6f88)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android SDK (9dbc4c5)
Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK (ad35de4)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
Comment 3 Adrian Alonso 2017-07-04 01:36:08 UTC
Hi Christian,

We will take a look at the issue as part of the 15.4 release. I think we have already have enough information or context to reproduce the issue and fix it.

Comment 4 Christian Schwarz 2017-07-04 07:37:28 UTC
Hi Adrian,

Is there a workaround in changing some .targets files or is it a more complex issue?

Do you have any rough estimate for 15.3 and 15.4 release?
Comment 5 Adrian Alonso 2017-07-04 18:50:43 UTC
Hi Christian,

Please instead of building the .csproj try to use the .sln. For example:

"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" Path\Test.iOS.sln /p:ServerAddress=x.x.x.x;ServerUser=user;Configuration=AppStore;Platform=iPhone

Please also note that the OutputPath should not be necessary. Using the .sln the satellite assembly (and the PCL in general) should be correctly included in the .ipa.

I will mark the bug as resolved but please feel free to reopen if the proposed solution does not work for you.

Comment 6 Borisov 2017-08-09 07:56:54 UTC
We have the same problem.
We execute msbuild with the following arguments:
/flp:LogFile=msbuildlog.txt;/verbosity:detailed /m /t:Rebuild /p:Configuration=Release /p:Platform=iPhone "C:\Projects\MyProject\MyProject.csproj" /p:OutputPath="C:\Projects\MyProject\bin\Release" /p:ServerAddress= /p:ServerUser=user /p:ServerPassword=password /p:BuildIpa=true

As a result we do not have satellite assemblies in the ipa file. We found strange records in the log (Releaseru-RU without slash):
  Received Response of Xamarin.Messaging.Build.Contracts.CopyItemMessage to topic build11111user/response/xvs/Build/
  Copying C:/Projects/MyProject/bin/Releaseru-RU/Strings.resources.dll...

Looks like there is an error in the way you combine path for satellite assemblies. If we add trailing slash to the end of OutputPath, problem goes away:

/flp:LogFile=msbuildlog.txt;/verbosity:detailed /m /t:Rebuild /p:Configuration=Release /p:Platform=iPhone "C:\Projects\MyProject\MyProject.csproj" /p:OutputPath="C:\Projects\MyProject\bin\Release/" /p:ServerAddress= /p:ServerUser=user /p:ServerPassword=password /p:BuildIpa=true