Visual Studio 2010 中的自定义框架定位

发布于 2024-12-18 11:54:23 字数 1004 浏览 4 评论 0原文

我想让使用 Visual Studio 的开发人员能够针对替代 .NET 的自定义框架编写程序(类似于 Windows Phone 和 Silverlight 框架,它们不是现有框架的子集或配置文件),并拥有完整的 IntelliSense 支持等等。

Visual Studio 2010 支持多目标,如果安装了适当的目标包,您可以定位任何框架(例如 .NET、Silverlight、Robotics、XNA、Windows Phone 和 Mono)。

我发现框架通常有一些参考程序集,它们放入 %programfiles%\Reference Assemblies\Microsoft\Framework 中,以及 RedistList 中的 FrameworkList.xml 文件 子文件夹。我尝试创建一个新文件夹,将程序集(例如 MyFramework.dll)以及包含 FrameworkList.xml 文件的 RedistList 子文件夹放入其中。我清除了该文件,但有一个条目类似于:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FileList Redist="MyFramework_1_0">
  <File AssemblyName="MyFramework" Version="1.0.0.0"
    PublicKeyToken="be3ea0d08db41157" Culture="neutral"
    ProcessorArchitecture="MSIL" InGAC="false" />
</FileList>

但在创建新项目时(重新启动 VS 后),Visual Studio 并未在可用框架列表中列出我的框架。显然,我错过了一些东西,但我无法弄清楚是什么。

如何创建这样一个目标包,让 Visual Studio 能够看到自定义框架,或者具有相同效果的东西?定位包中通常包含什么?可以添加自定义构建步骤吗?

I want to give developers using Visual Studio the ability to write programs against a custom framework that replaces .NET (similar to the Windows Phone and Silverlight frameworks, which are not subsets or profiles of an existing framework), and have full IntelliSense support and all.

Visual Studio 2010 supports multi-targeting, where you can target any framework (such as .NET, Silverlight, Robotics, XNA, Windows Phone and Mono) if you have the appropriate Targeting Packs installed.

I found that frameworks generally have some reference assemblies that they put in %programfiles%\Reference Assemblies\Microsoft\Framework along with a FrameworkList.xml file in the RedistList subfolder. I've tried just creating a new folder, putting my assemblies (e.g. MyFramework.dll) in there along with the RedistList subfolder containing a FrameworkList.xml file. I cleared the file but for one entry for similar to:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FileList Redist="MyFramework_1_0">
  <File AssemblyName="MyFramework" Version="1.0.0.0"
    PublicKeyToken="be3ea0d08db41157" Culture="neutral"
    ProcessorArchitecture="MSIL" InGAC="false" />
</FileList>

But Visual Studio doesn't list my framework in the list of available frameworks when creating a new project (after restarting VS). Obviously, I am missing something, but I haven't been able to figure out what.

How to create such a Targeting Pack that allows Visual Studio to see the custom framework, or something that has the same effect? What is generally included in a Targeting Pack? Can custom build steps be added?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ㄖ落Θ余辉 2024-12-25 11:54:23

在注册表中查找,特别是在以下注册表项中: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework (或 64 位系统上的 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft.NETFramework)

我认为 Visual Studio 首先会 找到一堆有趣的子项,其中一些实际上指向 program files\referenced assembly 文件夹。

I think Visual Studio first looks in the registry, notably in this key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework (or HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft.NETFramework on 64-bit systems)

You'll find a bunch of interesting subkeys, some of them actually pointing to the program files\referenced assemblies folders.

高冷爸爸 2024-12-25 11:54:23

你在轨道上。问题是“新建项目”对话框有一个已知限制,它仅列出基于 .NET Framework 的框架。

Windows Phone、Silverlight 和 Portable 都在模板端实现了这一点。基本上,他们有一个预先设置 TargetFrameworkIdentifier MSBuild 属性的模板。例如,MyCustomFramework,其中 MyCustomFramework 是 Microsoft\Framework 文件夹下的框架的名称。

You are on the track. The problem is that the "New Project" dialog has a known limitation where it only lists .NET Framework-based frameworks.

Windows Phone, Silverlight and Portable all implement this on the template side. Basically, they have a template that pre-sets the TargetFrameworkIdentifier MSBuild property. For example, MyCustomFramework, where MyCustomFramework is the name of the framework under the Microsoft\Framework folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文