Bug 18246 - [Ms.Build.Tasks] GetAssemblyIdentity is not implemented
Summary: [Ms.Build.Tasks] GetAssemblyIdentity is not implemented
Alias: None
Product: Class Libraries
Classification: Mono
Component: Ms.Build ()
Version: master
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2014-03-07 09:39 UTC by Yuta Sato (lambdalice)
Modified: 2014-03-10 22:59 UTC (History)
1 user (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 GitHub or 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 Yuta Sato (lambdalice) 2014-03-07 09:39:40 UTC
Hi, I'm lambdalice and from Nemerle Forum.

We find that the [GetAssemblyIdentity]( https://github.com/mono/mono/blob/master/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/GetAssemblyIdentity.cs ) left unimplemented.

The implementation of this task will be very simple; 

1. get the assembly's name, version, and culture from ITaskItem[] AssemblyFiles
2. put the information into ITaskItem[] Assemblies

The [description in MSDN]( http://msdn.microsoft.com/en-us/library/ms164296.aspx ) says that:

> The items output by the Assemblies parameter contain item metadata entries named Version, PublicKeyToken, and Culture.

And assembly's information can be got using [System.Reflection.AssemblyName]( http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.aspx ).

They will be helpful for writing the code.

I wish If I could write a code and send a pullreq.
But I've looked the disassembled one of Microsoft's implementation for researching our problem, so I can't do it anyway (afaik it's one of the Mono's contribution rules).

Please implement it before the Mono 3.4.0 released, and Nemerle Compiler will be able to be compiled on Mono.
Best Regards, lambdalice
Comment 1 Mikayla Hutchinson [MSFT] 2014-03-07 20:23:28 UTC
I don't have time to build unit tests it check behavior against .NET, but here's a first pass attempt at implementing based in the docs and the info you gave: https://gist.github.com/mhutch/9423610

Let me know if there's anything wrong with it and I'll clean it up and commit.
Comment 2 Yuta Sato (lambdalice) 2014-03-08 06:25:36 UTC
Thanks for replying, Michael.

The code looks fine, but there is an implementation that don't match to the MSBuild's one.

I wrote a test code: https://github.com/lambdalice/GetAssemblyIdentityTest
And tested it in windows.

I got

Target AfterBuild:
		asm: GetAssemblyIdentityTest, Version=, Culture=neutral, PublicKeyToken=344d0827edec309a

but I tried with your's code I got:

Target AfterBuild:
		asm: GetAssemblyIdentityTest

I found out that "new TaskItem (string)" sets the behavior.

It is correct using "new TaskItem (an.FullName)" instead of "new TaskItem (an.Name)".
Comment 3 Mikayla Hutchinson [MSFT] 2014-03-10 17:40:14 UTC
Committed: https://github.com/mono/mono/commit/2e939dd1b85f64faaeef62acee4402c4e4df9634
Comment 4 Yuta Sato (lambdalice) 2014-03-10 22:59:54 UTC
Thanks so much!