Bug 30093 - Compiled Assembly Not Strong Named
Summary: Compiled Assembly Not Strong Named
Status: NEW
Alias: None
Product: Tools
Classification: Mono
Component: xbuild ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-05-14 14:55 UTC by Martin Costello
Modified: 2015-05-14 14:55 UTC (History)
1 user (show)

Tags:
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 for Bug 30093 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Martin Costello 2015-05-14 14:55:00 UTC
Compiling the C# sample code in this GitHub repo (https://github.com/experiandataquality/electronicupdates) using xbuild 12.0 with Mono 4.0.1 produces assemblies that are not strong named.

Compiling the same .msbuild file using MSBuild with the Visual Studio 2013 tool chain produces strong named assemblies as expected as the <AssemblyOriginatorKeyFile> and <SignAssembly> properties are specified in the MetadataWebApi.targets file which is imported by both .csproj files.

I would expect mcs.exe to be correctly invoked by xbuild with the /keyfile argument when these properties are set so that the output assemblies are strong named.

An excerpt from the xbuild log file with diagnostic logging enabled is below:

Task "Csc"
						Using task Csc from Microsoft.Build.Tasks.Csc, Microsoft.Build.Tasks.v12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
						Tool /usr/lib/mono/4.5/mcs.exe execution started with arguments: /noconfig /debug:pdbonly /optimize+ /out:obj/Release/MetadataWebApi.exe ../CommonAssemblyInfo.cs AvailablePackagesReply.cs DataFile.cs FileDownloadReply.cs FileDownloadRequest.cs GetAvailablePackagesRequest.cs GetDownloadUriRequest.cs GlobalSuppressions.cs IFileStore.cs IMetadataApi.cs IMetadataApiExtensions.cs IMetadataApiFactory.cs LocalFileStore.cs MetadataApi.cs MetadataApiException.cs MetadataApiFactory.cs Package.cs PackageGroup.cs Program.cs Properties/AssemblyInfo.cs UserNamePassword.cs obj/Release/.NETFramework,Version=v4.5.AssemblyAttribute.cs /target:exe /warnaserror+ /define:"TRACE;CODE_ANALYSIS;UNIX" /doc:bin/Release/MetadataWebApi.xml /nostdlib /platform:AnyCPU /reference:../packages/Newtonsoft.Json.6.0.8/lib/net45/Newtonsoft.Json.dll /reference:/usr/lib/mono/4.5/System.dll /reference:/usr/lib/mono/4.5/System.Configuration.dll /reference:/usr/lib/mono/4.5/System.Net.Http.dll /reference:../packages/Microsoft.AspNet.WebApi.Client.5.2.3/lib/net45/System.Net.Http.Formatting.dll /reference:/usr/lib/mono/4.5/System.Net.Http.WebRequest.dll /reference:/usr/lib/mono/4.5/System.Runtime.Serialization.dll /reference:/usr/lib/mono/4.5/System.Xml.dll /reference:/usr/lib/mono/4.5/System.Core.dll /reference:/usr/lib/mono/4.5/mscorlib.dll /warn:4
						Environment variables being passed to the tool:
						Tool /usr/lib/mono/4.5/mcs.exe execution finished.
					Done executing task "Csc"