简体   繁体   English

如何使用Visual Studio为Umbraco创建软件包?

[英]How to create a package for Umbraco with Visual Studio?

How do I create a package for Umbraco inside Visual Studio? 如何在Visual Studio中为Umbraco创建软件包? I know that you can create a package inside Umbracos backoffice, but I am not interested in that right now. 我知道您可以在Umbracos后台创建一个程序包,但是现在我对此并不感兴趣。 I just need something simple, like a hello world package 我只需要一些简单的东西,例如hello world package

Unfortunately, it's not so simple. 不幸的是,这并不是那么简单。 It depends what is going to be the package content. 这取决于包装内容。 If those will be static files, dlls etc. - it's a job for MsBuild and you can use it to gather all the required files and create a package or even distrubute it. 如果这些文件是静态文件,dll等,则-这是MsBuild的工作,您可以使用它来收集所有必需的文件并创建一个包,甚至对其进行篡改。

There's a great article by Jeavon Leopold on 24days.in: http://24days.in/umbraco/2014/packaging-with-appveyor/ combined with CI done with AppVeyor. Jeavon Leopold在24days.in上有一篇很棒的文章: http ://24days.in/umbraco/2014/packaging-with-appveyor/结合了由AppVeyor完成的CI。

The challange starts when you want to include document types, datatypes or any other Umbraco-related content there too. 当您想在其中包括文档类型,数据类型或任何其他与Umbraco相关的内容时,挑战就开始了。 And this is really easy to be done with Umbraco Packaging through the backoffice (you just need to select what should be included). 使用Umbraco Packaging的后台服务确实很容易做到这一点(您只需要选择要包含的内容即可)。 Using your custom build and automatic packaging, you need to remember that if anything should be included inside the Umbraco backoffice, it needs to be handled by the creation of those objects in your code (eg on application startup events custom handlers) and ensure that if it's not exist it should be re-created etc. 使用自定义构建和自动打包功能时,您需要记住,如果Umbraco后台中应包含任何内容,则需要通过在代码中创建这些对象来进行处理(例如,在应用程序启动事件中使用自定义处理程序),并确保它不存在,应重新创建等。

Personally, I suggest you to check how other package creators are handling it, as a lot of packages is open-sourced eg: 就个人而言,我建议您检查其他软件包创建者如何处理它,因为许多软件包都是开源的,例如:

etc. 等等

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

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