简体   繁体   English

Visual Studio 2017 的托管包框架

[英]Managed Package Framework for Visual Studio 2017

I'm following this tutorial on how to create a new Visual Studio Project type.我正在按照本教程学习如何创建新的 Visual Studio 项目类型。 In there, it says to "Import the source-code files for the Managed Package Framework".在那里,它说“导入托管包框架的源代码文件”。 Google led me to this link that has a link to MPF 2013 package.谷歌引导我到这个链接,其中有一个指向 MPF 2013 包的链接。 In the first link they say to look for a file ProjectBase.files which does not exist in the second link download.在第一个链接中,他们说要查找在第二个链接下载中不存在的文件ProjectBase.files

Questions:问题:

  1. Where is the correct MPF download for Visual Studio 2017. Visual Studio 2017 的正确 MPF 下载在哪里。
  2. In the future when we move on to Visual Studio 2019, will I need to download a new MPF for 2019?将来当我们转向 Visual Studio 2019 时,我是否需要为 2019 下载新的 MPF?

I had the same problem, but it seems that I alreasy solved it.我有同样的问题,但似乎我已经解决了。 It seems that MPF is not needed anymore to do these steps and the tutorial is a bit outdated:似乎不再需要 MPF 来执行这些步骤,而且教程有点过时:

How to do it now:现在怎么做:

Instead of loading the "Managed Package Framework code", skip this whole step in the tutorial and go to the next chaprer.不要加载“托管包框架代码”,而是跳过教程中的整个步骤并转到下一个章节。 In the next chapter skip everything until step 3 and register在下一章中跳过所有步骤直到第 3 步并注册

this.RegisterProjectFactory(new SimpleProjectFactory(this));

in the InitializeAsync Task of the SimpleProjectPackage.cs在 SimpleProjectPackage.cs 的 InitializeAsync 任务中

At step 6 implement FlavoredProjectFactory instead of ProjectFactory在第 6 步实施 FlavoredProjectFactory 而不是 ProjectFactory

Continue the tutorial and it should work fine now.继续教程,它现在应该可以正常工作了。 In the end it should look like this:最后它应该是这样的:

class SimpleProjectFactory : FlavoredProjectFactory
{
    private SimpleProjectPackage simpleProjectPackage;

    public SimpleProjectFactory(SimpleProjectPackage simpleProjectPackage)
    {
        this.simpleProjectPackage = simpleProjectPackage;
    }

    protected override object PreCreateForOuter(object outerProject)
    {
        return null;
    }



}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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