Does .NET 4.0 business API's work with Win 8 M

2019-08-01 22:31发布

问题:

We have a huge sets of business APIs/assemblies developed in .NET 4.0 (most of those were upgraded from .NET 2.0). They are not currently exposed as web services.

We would like to start Win 8 metro app development (using C#/XAML) based on those API's. Is it possible?

回答1:

Another option is to target the Portable Class Library (PLC)

http://msdn.microsoft.com/en-us/library/gg597391.aspx

This way you can compile a single assembly to multi target both normal .net and Metro/WinRT .net.

You will of course have to code to the subset of APIs that a exposed to both frameworks.



回答2:

It may be the case that your classes can be used in a Metro style app, but it's unlikely. The full .NET Framework is not exposed to a Metro style app. It's actually a subset of the .NET Framework called the Core Profile. You can see the Core Profile reference assemblies with ILDasm or ILSpy at ...

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\

Check out A .NET developer's view of Windows 8 app development from Build for a discussion of the .NET Profile for Metro style apps.



回答3:

You can use them if you can recompile them as WinRT class libraries. Most likely that means no and you would need to update them first to use WinRT APIs wherever you used WinAPI or some .NET libraries before that were not moved to WinRT.



回答4:

I think the way things are going now is SaaS/cloud solutions.

Your best bet may be to expose those assemblies as web services and access these services from your app.

Of course, this is assuming you don't have huge amounts of data back and forth.

In that case, you should be able to include those assemblies recompiled as WinRT class libraries... though I would discourage it, as it could make the apps you are developing quite large in size.