using legacy assemblies in metro style app

Yes, sometimes you can reference third-party .NET assemblies from Metro applications. They should be deployed in the same folder as your app and only use supported APIs.

I created a .NET library with one class and used it from metro app. Got the following warning: The project 'EmptyLib' cannot be referenced. But the app has been built and I was able to debug it and explore the instance of my class in debugger.

Then I tried to pass Windows App Certification. It failed (see details below).

After switching on compiler optimization for app certification passed.


The reason that it failed the first time was that library used not supported APIs. Details:

Error: This application failed the supported API check.

  • API System.Runtime.CompilerServices.CompilationRelaxationsAttribute in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. EmptyLib.dll calls this API.

  • API System.Runtime.CompilerServices.CompilationRelaxationsAttribute.#ctor(System.Int32) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. EmptyLib.dll calls this API.

Impact if not fixed: The application is using one or more APIs that are not in the Windows SDK for Metro style Apps. Use of unsupported APIs violates the Windows Store policy and can have negative impact on the user experience and has the potential to hinder overall system stability.

How to fix: Look at the error messages above2 for the exact API that needs to be fixed. Refer to the Windows SDK for Metro style Apps for the supported list of APIs to use.


Comments

  1. Mateo

    • 2021/2/15

    Yes, sometimes you can reference third-party .NET assemblies from Metro applications. They should be deployed in the same folder as your app and only use 

  2. Boston

    • 2020/9/25

    1 Answer1. Yes, sometimes you can reference third-party .NET assemblies from Metro applications. They should be deployed in the same folder as your app and only use supported APIs. I created a .NET library with one class and used it from metro app. Got the following warning: The project 'EmptyLib' cannot be referenced.

  3. Brahimi

    • 2017/9/23

    You can also create Metro style apps using HTML5/CSS and Referencing a non-Metro assembly is perfectly possible but you'll have to use 

  4. Zachary

    • 2018/5/3

    You can't use a C static library in .Net: as Paul says, you would need to include it in a C or C++ project to expose it as a Windows Runtime Component (or p-invokable DLL). So long as it's not using any API which aren't allowed for Metro style apps you could then use it from your C# code.--Rob

  5. Bonnet

    • 2015/6/22

    You can only create metro style apps with C#, VB, JavaScript and C++. There is currently no support for authoring metro style applications with Java.

  6. Gunnar

    • 2018/2/4

    Using the MetroWindow. To start with the full MahApps styling and full window support you need to change your normal Window to our MetroWindow. Open up your main window, normally named MainWindow.xaml; Add the namespace attribute inside the opening Window tag xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" or

  7. Arturo

    • 2018/6/21

    What is WRL and how does it help you write Metro Apps? Learn what is to using C++/CX to write WinRT components and Metro style apps.

  8. Campbell

    • 2021/4/11

    MahApps.Metro overrides the default style of all common WPF controls and gives them a modern look. More than just styles MahApps.Metro also includes some custom controls based on concepts from Windows Phone, Windows 8 and Window 10 (UWP) Apps.

  9. Titan

    • 2016/4/29

    WinRT apps can only be sideloaded from outside Windows Store on Windows 8 or RT systems that are part of a Windows domain, or equipped with a special 

  10. Ephraim

    • 2015/7/27

    Redirect versions by using publisher policy. Vendors of assemblies can direct apps to a newer version of an assembly by including a publisher policy file with the new assembly. The publisher policy file, which is located in the global assembly cache, contains assembly redirection settings.

  11. Fournier

    • 2020/5/14

    NET Framework developers will feel at home with this profile. Make it easy to port existing C# and Visual Basic code to the profile. We also 

  12. Barrett

    • 2017/10/6

    The Legacy protocols usage assessment report table surfaces the top discovered entities using legacy protocols (for now, NTLMv1). Using the report, you can immediately review any top impacted entities and take action on them, stopping use of these protocols and eventually, disabling them altogether.

  13. Eliseo

    • 2017/12/31

    So why would we build a Metro-style application over a traditional desktop the GAC assemblies, but your app will be rejected from the Windows Store.

  14. Isaias

    • 2016/4/29

    You cannot use those assemblies in a Metro style app. Metro style apps use a subset of .Net 4.5 and cannot use any namespaces or classes which are not part of that subset. See .NET for Metro style apps overview for more details.

  15. Rodney

    • 2020/1/5

    Using AS/ 400, to analyze, develop & integrate local solutions for local systems design, develop, implement & maintain mainframe legacy applications on 

  16. Bryce

    • 2018/12/25

    Using AS/ 400, to analyze, develop & integrate local solutions for local systems design, develop, implement & maintain mainframe legacy applications on 

  17. Turner

    • 2016/1/1

    Analyze existing EDI, document processes involved in the system using HTML and support EDI wireless application. Prepare and execute the plan, design and 

Comments are closed.

Recent Posts