简体   繁体   中英

Referencing Windows Store project to .Net Framework assembly, eg Class Library

I think, I can understand why, I can not reference any .Net Framework assemblies to any WinRT projects - targeted to .Net Core. Portability and so on... bla bla bla...

But I can not understand, why I can not do it in vice versa!

For example, when I want to add some Windows Store assembly reference to regular .Net Framework assembly, I get error. Is it any logical reason why it is impossible?

Yes, there is a perfectly logical explanation for this: .NET for Windows Store apps (or .NET Core) is not a subset of .NET Framework (or its Client profile). It's a completely separate platform, just like Silverlight or Windows Phone. In fact, it is strongly based on an older version of Silverlight.

The only way to share a class library between a Windows Store app and a regular Windows (.NET) application is to create a portable class library. By selecting the target platforms for it, you'll get a specific subset of APIs that are available on all selected platforms. You'll be able to reference such a library in any project using one of selected supported platforms.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM