问题描述
我已经将我的DSL部署为VSIX扩展了几年,并希望将Nuget更改为分发机制。 我意识到这不是NuGet打包问题的地方,但我需要了解我的Nuget包中包含的内容为
,确保这将在目标开发人员实例上运行,所以我希望有人已经这样做了可以为我提供一些线索。
I have been deploying my DSL as VSIX extensions for a few years and want to change to Nuget as a distribution mechanism. I realize that this not a place for NuGet packaging questions, but I need to understand what to include in my Nuget package to ensure that this will run on a target developer instance, so I am hoping someone has done this already and can provide me with some clues.
我已经安装了NuGet Package Manager,这使得创建和发布Nuget包非常容易。 我能够创建一个简单的Nuget包部署,但现在我需要部署我的DSL扩展。
I have installed NuGet Package Manager which makes creating and publishing a Nuget package very easy. I am able to create a deploy a simple Nuget package but now I need to deploy my DSL extension.
我的问题是我在包内容中部署了什么?
My question is what do I deploy in my package contents?
在我目前的VSIX中,我有许多程序集,例如
In my current VSIX I have a number of assemblies such as
- MyProduct.DsL.dll,
- MyProduct.DslPackge.dll
- Microsoft.Practices.ServiceLocation.dll(不确定是否需要)
- Microsoft.VisualStudio.TextTemplating.Interfaces.12.0.dll(不是确定是否需要)
我还有一些我自己的自定义程序集,它们是MyProduct.Dsl.dll和MyProduct.DslPackage的依赖项.dll。
As well I have a few of my own custom assemblies that are dependencies of the MyProduct.Dsl.dll and MyProduct.DslPackage.dll.
我的VSIX中还有一个文件夹,其中包含T4Templates,它们在运行时用于代码生成目标项目中的一些类。
I also have a folder within my VSIX that contains T4Templates which are used at runtime to code generate some classes within the target project.
然后 ItemTemplates\CSharp \ 1033 \ MyProduct.zip中的文件以及
ItemTemplat es\VisualBasic \ 1033 \ MyProduct.zip
And then there files in the ItemTemplates\CSharp\1033\MyProduct.zip as well asItemTemplates\VisualBasic\1033\MyProduct.zip
我还有一个名为 Additional.pkg.def 的文件 具有以下内容...
I also have a file named Additional.pkg.def file with the following content...
[$ RootKey $ \TextTemplating\IncludeFolders]
[$ RootKey $ \TextTemplating\IncludeFolders\.tt]
" IncludeMyDsl" =" $ PackageFolder $ \CustomCode \ T4Templates"
MyProduct.DslPackage.pkgdef中有大量配置,我不确定大多数这意味着什么,我怀疑VSIX安装程序使用它来安装我的扩展程序。
There is a ton of configuration within MyProduct.DslPackage.pkgdef and I am not certain what most of this means, I suspect it is used by the VSIX installer to install my extension.
那么有没有人知道我如何设置Nuget包以及成功部署的所有必要元素?
So does anyone have a clue as to how I go about laying out the Nuget package with all the necessary elements for a successful deployment?
干杯
约翰
Johnny Larue,http://www.softlandingcanada.com
Johnny Larue, http://www.softlandingcanada.com
推荐答案
FYI pkgdef文件包含使设计器与VS一起正常工作所必需的注册表项它告诉VS您的包存在以及在哪里找到它,为您的新模型文件创建文件关联,注册您的编辑器,
工具窗口,菜单命令等等。你需要确保这些信息也以某种方式进入注册表。
FYI the pkgdef file contains the registry entries that are necessary to make your designer work correctly with VS e.g. it tells VS that your package exists and where to find it, creates the file association for your new model file, registers your editor, tool window, menu commands etc. You will need to make sure this information gets into the registry somehow too.
问候,
Duncan
这篇关于如何为我的DSL扩展创建Nuget包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!