Search code examples
windows-store-appswin-universal-app

Optional Package


Is it possible to have c# code in optional package? Or is it refrained to only native code? Most of the blogs suggest that it is cofined to native code. But I need to implement c# code for my project.


Solution

  • Is it possible to have c# code in optional package?

    Currently, it's not possible to include c# code in optional package due to a .Net limitation.

    For more details, you can refer to the blog Extend your application using Optional Packages written by @Sandeep George:

    "All Store apps are compiled via .Net Native and hence is the default build chain when you build your app locally in release mode – see https://msdn.microsoft.com/en-us/library/dn584397(v=vs.110).aspx. Since the app is precompiled, all the referenced dlls must be available at compile time and are statically linked. Optional packages by design can have dlls that are only loaded at run time, hence we have this issue. We are working with the .NET teams to have a solution for this problem."