New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status Monitor somehow causes AmbiguousMatchException exception on AutoRest apps #241

Closed
SergeyKanzhelev opened this Issue Nov 30, 2016 · 7 comments

Comments

Projects
None yet
3 participants
@SergeyKanzhelev
Member

SergeyKanzhelev commented Nov 30, 2016

See Azure/autorest#1542 for details.

@SergeyKanzhelev SergeyKanzhelev added the bug label Nov 30, 2016

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

Ok. I took this app and inserted the code into the beginning:

Console.WriteLine("Number of custom attributes:" + System.Attribute.GetCustomAttributes((typeof(object)).Assembly).Length);

foreach(var a in System.Attribute.GetCustomAttributes((typeof(object)).Assembly))
{
    Console.WriteLine("attribute: " + a.TypeId);
}

Some attributes were duplicated and one was new:

attribute: System.CLSCompliantAttribute
attribute: System.Diagnostics.DebuggableAttribute
!dup: attribute: System.Diagnostics.DebuggableAttribute
attribute: System.Reflection.AssemblyCompanyAttribute
attribute: System.Reflection.AssemblyCopyrightAttribute
attribute: System.Reflection.AssemblyDefaultAliasAttribute
attribute: System.Reflection.AssemblyDelaySignAttribute
attribute: System.Reflection.AssemblyDescriptionAttribute
attribute: System.Reflection.AssemblyFileVersionAttribute
!dup: attribute: System.Reflection.AssemblyFileVersionAttribute
attribute: System.Reflection.AssemblyInformationalVersionAttribute
attribute: System.Reflection.AssemblyKeyFileAttribute
attribute: System.Reflection.AssemblyProductAttribute
attribute: System.Reflection.AssemblySignatureKeyAttribute
attribute: System.Reflection.AssemblyTitleAttribute
attribute: System.Resources.NeutralResourcesLanguageAttribute
attribute: System.Resources.SatelliteContractVersionAttribute
attribute: System.Runtime.CompilerServices.CompilationRelaxationsAttribute
!dup: attribute: System.Runtime.CompilerServices.CompilationRelaxationsAttribute
attribute: System.Runtime.CompilerServices.DefaultDependencyAttribute
attribute: System.Runtime.CompilerServices.ExtensionAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
!dup: attribute: System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
attribute: System.Runtime.CompilerServices.StringFreezingAttribute
attribute: System.Runtime.InteropServices.ComCompatibleVersionAttribute
attribute: System.Runtime.InteropServices.ComVisibleAttribute
attribute: System.Runtime.InteropServices.GuidAttribute
attribute: System.Runtime.InteropServices.TypeLibVersionAttribute
!new: attribute: System.Runtime.Versioning.TargetFrameworkAttribute
attribute: System.Security.AllowPartiallyTrustedCallersAttribute
attribute: System.Security.Permissions.SecurityPermissionAttribute
attribute: System.Security.SecurityRulesAttribute
Member

SergeyKanzhelev commented Nov 30, 2016

Ok. I took this app and inserted the code into the beginning:

Console.WriteLine("Number of custom attributes:" + System.Attribute.GetCustomAttributes((typeof(object)).Assembly).Length);

foreach(var a in System.Attribute.GetCustomAttributes((typeof(object)).Assembly))
{
    Console.WriteLine("attribute: " + a.TypeId);
}

Some attributes were duplicated and one was new:

attribute: System.CLSCompliantAttribute
attribute: System.Diagnostics.DebuggableAttribute
!dup: attribute: System.Diagnostics.DebuggableAttribute
attribute: System.Reflection.AssemblyCompanyAttribute
attribute: System.Reflection.AssemblyCopyrightAttribute
attribute: System.Reflection.AssemblyDefaultAliasAttribute
attribute: System.Reflection.AssemblyDelaySignAttribute
attribute: System.Reflection.AssemblyDescriptionAttribute
attribute: System.Reflection.AssemblyFileVersionAttribute
!dup: attribute: System.Reflection.AssemblyFileVersionAttribute
attribute: System.Reflection.AssemblyInformationalVersionAttribute
attribute: System.Reflection.AssemblyKeyFileAttribute
attribute: System.Reflection.AssemblyProductAttribute
attribute: System.Reflection.AssemblySignatureKeyAttribute
attribute: System.Reflection.AssemblyTitleAttribute
attribute: System.Resources.NeutralResourcesLanguageAttribute
attribute: System.Resources.SatelliteContractVersionAttribute
attribute: System.Runtime.CompilerServices.CompilationRelaxationsAttribute
!dup: attribute: System.Runtime.CompilerServices.CompilationRelaxationsAttribute
attribute: System.Runtime.CompilerServices.DefaultDependencyAttribute
attribute: System.Runtime.CompilerServices.ExtensionAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.InternalsVisibleToAttribute
attribute: System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
!dup: attribute: System.Runtime.CompilerServices.RuntimeCompatibilityAttribute
attribute: System.Runtime.CompilerServices.StringFreezingAttribute
attribute: System.Runtime.InteropServices.ComCompatibleVersionAttribute
attribute: System.Runtime.InteropServices.ComVisibleAttribute
attribute: System.Runtime.InteropServices.GuidAttribute
attribute: System.Runtime.InteropServices.TypeLibVersionAttribute
!new: attribute: System.Runtime.Versioning.TargetFrameworkAttribute
attribute: System.Security.AllowPartiallyTrustedCallersAttribute
attribute: System.Security.Permissions.SecurityPermissionAttribute
attribute: System.Security.SecurityRulesAttribute
@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

Ok, it seems that those dups are coming from the assembly 'Microsoft.ApplicationInsights.Agent_x64.2.0.5\content\RTIA\x64\Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll'. Here is the metadata of it:

[assembly: AssemblyVersion("2.0.5.0")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("2.0.5.32465")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: TargetFramework(".NETFramework,Version=v4.0,Profile=Client", FrameworkDisplayName = ".NET Framework 4 Client Profile")]

We need to remove attributes from this library when compiling it.

Member

SergeyKanzhelev commented Nov 30, 2016

Ok, it seems that those dups are coming from the assembly 'Microsoft.ApplicationInsights.Agent_x64.2.0.5\content\RTIA\x64\Microsoft.Diagnostics.Instrumentation.Extensions.Base.dll'. Here is the metadata of it:

[assembly: AssemblyVersion("2.0.5.0")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("2.0.5.32465")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: TargetFramework(".NETFramework,Version=v4.0,Profile=Client", FrameworkDisplayName = ".NET Framework 4 Client Profile")]

We need to remove attributes from this library when compiling it.

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Nov 30, 2016

Member

I confirmed that removing of TargetFramework from the assembly will make it not to insert to mscrolib. I've used this property in csproj: <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>

So we just need to remove all other attributes and release a fix for Status Monitor and Azure Web App extension.

Member

SergeyKanzhelev commented Nov 30, 2016

I confirmed that removing of TargetFramework from the assembly will make it not to insert to mscrolib. I've used this property in csproj: <GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>

So we just need to remove all other attributes and release a fix for Status Monitor and Azure Web App extension.

@dnduffy

This comment has been minimized.

Show comment
Hide comment
@dnduffy

dnduffy Dec 1, 2016

Member

Does that mean we need to build a 2.0.7 version tonight/tomorrow?

Member

dnduffy commented Dec 1, 2016

Does that mean we need to build a 2.0.7 version tonight/tomorrow?

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Dec 1, 2016

Member

This issues is in StatusMonitor/MMA & Azure Web Site extension. Not in Intercept.

Please note, GenerateTargetFrameworkAttribute only removes one attribute. Work needs to be done to remove all other attributes.

Member

SergeyKanzhelev commented Dec 1, 2016

This issues is in StatusMonitor/MMA & Azure Web Site extension. Not in Intercept.

Please note, GenerateTargetFrameworkAttribute only removes one attribute. Work needs to be done to remove all other attributes.

@AlexBulankou AlexBulankou added this to the 2.2 SM milestone Dec 2, 2016

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Dec 15, 2016

Member

This should be fixed on Azure Web Apps extension v2.2.

Update for the Status Monitor is pending

Member

SergeyKanzhelev commented Dec 15, 2016

This should be fixed on Azure Web Apps extension v2.2.

Update for the Status Monitor is pending

@SergeyKanzhelev

This comment has been minimized.

Show comment
Hide comment
@SergeyKanzhelev

SergeyKanzhelev Feb 5, 2017

Member

This is completed

Member

SergeyKanzhelev commented Feb 5, 2017

This is completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment