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

S.R.InteropServices.RuntimeInformation.FrameworkDescription throws in UWP release #16769

Closed
zabulus opened this Issue Mar 6, 2017 · 3 comments

Comments

@zabulus

zabulus commented Mar 6, 2017

Exception message: RFLCT_Ambiguous.
I think cause is here:

AssemblyFileVersionAttribute attr = (AssemblyFileVersionAttribute)(typeof(object).GetTypeInfo().Assembly.GetCustomAttribute(typeof(AssemblyFileVersionAttribute)));

GetCustomAttribute(typeof(AssemblyFileVersionAttribute)) could return several attributes.

Workaround:
If I use following or similar code, exception not occurs:

typeof(object).GetTypeInfo().Assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute)).OfType<AssemblyFileVersionAttribute>().FirstOrDefault(); 
@MichalStrehovsky

This comment has been minimized.

Show comment
Hide comment
@MichalStrehovsky

MichalStrehovsky Mar 8, 2017

Member

Sounds related to custom attribute duplication seen with .NET Native in Azure/autorest#1542

Member

MichalStrehovsky commented Mar 8, 2017

Sounds related to custom attribute duplication seen with .NET Native in Azure/autorest#1542

@joperezr joperezr added this to the 2.1.0 milestone Mar 8, 2017

@MichalStrehovsky

This comment has been minimized.

Show comment
Hide comment
@MichalStrehovsky

MichalStrehovsky Mar 8, 2017

Member

This is a .NET Native bug that can be worked around by disabling the shared library feature. To work around:

  1. Edit the .csproj for your app and add the following property: <UseDotNetNativeSharedAssemblyFrameworkPackage>false</UseDotNetNativeSharedAssemblyFrameworkPackage>. This disables the shared framework feature: as a consequence, the compilation in Release mode will take longer and your app will be bigger.
  2. Rebuild your app

TFS bug ID for people with access: 392708

Member

MichalStrehovsky commented Mar 8, 2017

This is a .NET Native bug that can be worked around by disabling the shared library feature. To work around:

  1. Edit the .csproj for your app and add the following property: <UseDotNetNativeSharedAssemblyFrameworkPackage>false</UseDotNetNativeSharedAssemblyFrameworkPackage>. This disables the shared framework feature: as a consequence, the compilation in Release mode will take longer and your app will be bigger.
  2. Rebuild your app

TFS bug ID for people with access: 392708

@tijoytom

This comment has been minimized.

Show comment
Hide comment
@tijoytom

tijoytom Jun 15, 2017

Contributor

This is fixed "VSO 392708"

Contributor

tijoytom commented Jun 15, 2017

This is fixed "VSO 392708"

@tijoytom tijoytom closed this Jun 15, 2017

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