zoukankan      html  css  js  c++  java
  • Orchard Core 使用模板创建Module

    根据官方示例:https://orchardcore.readthedocs.io/en/latest/Templates/README/#create-a-new-module

    执行以下命令:

    dotnet new --install "OrchardCore.Cms.Templates"

    PS C:Usershyzx8DocumentsVisual Studio 2017ProjectsJZProjectManage> dotnet new --install "OrchardCore.Cms.Templates"
    正在还原 C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj 的包...
    C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj : error NU1103: 找不到版本为 的稳定包 OrchardCore.Cms.Templates
    C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj : error NU1103: - 在 Orchard Core Nuget 中找到 20 个版本[ 最接近版本: 1.0.0-beta3-68792 ]
    C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj : error NU1103: - 在 nuget.org 中找到 3 个版本[ 最接近版本: 1.0.0-beta2-67846 ]
    C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj : error NU1103: - 在 Microsoft Visual Studio Offline Packages 中找到 0 个版本
    C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj : error NU1103: - 在 C:Program FilesdotnetsdkNuGetFallbackFolder 中找到 0 个版本
    正在生成 MSBuild 文件 C:Usershyzx8.templateenginedotnetcliv2.1.403scratchobj estore.csproj.nuget.g.props。
    正在生成 MSBuild 文件 C:Usershyzx8.templateenginedotnetcliv2.1.403scratchobj estore.csproj.nuget.g.targets。
    C:Usershyzx8.templateenginedotnetcliv2.1.403scratch estore.csproj 的还原在 251.62 ms 内失败。

      

    安装失败,此时参考微软官方的 api :https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-new?tabs=netcore21#examples

    -i|--install <PATH|NUGET_ID>

    从提供的 PATH 或 NUGET_ID 安装源或模板包。 若要安装模板包的预发布版本,需要以 <package-name>::<package-version> 格式指定该版本。 默认情况下,dotnet new 为该版本传递 *,表示最后一个稳定的包版本。 请在示例部分查看示例。

    注意以上命令中的高亮部分,由于OrchardCore 尚未发布稳定版,所以我们需要指定具体的版本号,在此之前你应确保已经添加了OrchardCore官方的 Nuget源: https://orchardcore.readthedocs.io/en/latest/Templates/README/#adding-orchard-core-nuget-feed

    将命令修改为:

    dotnet new --install "OrchardCore.Cms.Templates::1.0.0-beta3-68792"

    注意后方的版本号来自于 上一个命令的 最接近版本 部分

    接下来再按照官方文档继续执行就没问题了

    New module from Command Shell (automated way)

    Module commands

      dotnet new ocmodule -n ModuleName.OrchardCore

    dotnet new ocmodule -n ModuleName.OrchardCore --PartName TestPart
    
    dotnet new ocmodule -n ModuleName.OrchardCore --PartName TestPart --AddPart true
  • 相关阅读:
    xss框架(一)之浏览器通信
    Joomla未授权创建特权用户漏洞和getshell脚本解析
    从零开始写网站登录爆破(一)
    CSRF学习整理
    vue中vue2-google-maps使用谷歌地图的基础操作
    vue中百度地图API的调用
    60秒定时减少
    git操作指令,以及常规git代码操作
    taro taroUi的H5打包后路径/修改为./
    vue enter事件无效,加入native
  • 原文地址:https://www.cnblogs.com/Qbit/p/9778128.html
Copyright © 2011-2022 走看看