gpt4 book ai didi

c# - XNA 平台共享的类库

转载 作者:太空宇宙 更新时间:2023-11-03 11:38:20 27 4
gpt4 key购买 nike

Windows/Xna/Phone/Standard 库有什么区别?

我假设每个人都可以访问特定于平台的 API。是否可以创建一个既不能访问任何 API,又能在所有平台上工作的通用类库?

我尝试创建一个针对 4.0(客户端配置文件)的标准 C# 类库,它仅引用标准 mscorlib 和 System.这适用于 Windows XNA 项目,但在 Xbox XNA 项目中会出现以下错误:

Warning 3 The primary reference "Qua.Game, Version=1.3.3.30456, Culture=neutral, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0,Profile=Client". To resolve this problem, either remove the reference "Qua.Game, Version=1.3.3.30456, Culture=neutral, processorArchitecture=MSIL" or retarget your application to a framework version which contains "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

最佳答案

Is it possible to create a common denominator class library that has access to neither of the API, but in return works on all platforms?

是的,有一些新工具可以让您做到这一点 - 可移植图书馆工具。


几乎每个人都认为目前的情况有点乱......

有一个改进可移植图书馆的新项目正在进行中 - 目前在 CTP 下 - 请参阅 http://visualstudiogallery.msdn.microsoft.com/b0e0b5e9-e138-410b-ad10-00cb3caf4981/

Portable Library Tools is a new Visual Studio add-in from Microsoft that enables you to create C# and Visual Basic libraries that run on a variety of .NET-based platforms without recompilation.

它声称该项目将协助所有:

XNA, Silverlight, .NET, portable, Windows Phone, Xbox 360

希望这是朝着正确方向迈出的好一步!

关于c# - XNA 平台共享的类库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5524232/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com