azure - PowerShell 脚本无法执行。有关详细信息,请参阅输出窗口

标签 azure asp.net-web-api azure-sql-database azure-web-app-service azure-service-fabric

错误步骤:

  1. 我在 Visual Studio 2017 的 .net Framework 4.6.1 中使用 WebApi 创建了一个“Service Fabric 应用程序”。

  2. 然后我创建了一个类库来借助 Entity Framework 访问sql数据。

  3. 借助 NugetPackage 将 Entity Framework 附加到 Web API 应用程序,并设置从 Webapi 到类库项目的引用以获取数据上下文。

  4. 创建了一个 Controller 类来访问 Entity Framework 数据上下文。

  5. 运行应用程序时,我收到错误(没有构建错误,而是显示错误:“'packages'元素未声明”),例如

enter image description here

  • 构建后显示构建成功,但出现此错误:
  • enter image description here

  • 我检查了packages.config 文件。显示如下:
  • enter image description here

  • 下面是输出窗口。
  • enter image description here

  • 我尝试过“重置本地集群”,但没有结果。

  • 我尝试使用 1 个节点“设置本地集群”:它向我显示错误 :本地集群设置失败

  • enter image description here

    最佳答案

    您的错误是:

    'Test-ServiceFabricClusterManifest' is not recognized as a cmdlet...
    

    尝试重新安装最新版本的 Service Fabric SDK,并查看 cmdlet 是否在独立 shell 中工作。

    packages.config 的警告是默认的 Visual Studio 行为,与您的问题无关。如果关闭文件,警告就会消失。

    关于azure - PowerShell 脚本无法执行。有关详细信息,请参阅输出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49113474/

    相关文章:

    Azure:存储交易成本

    c# - 使用其他方法名称创建 WebAPI

    tsql - 如何更新json对象中数组的特定项

    wpf - SQL Azure 是否适合桌面客户端应用程序

    .net - 在 SQL Azure 上部署数据层项目 - 部署前和部署后使用主数据库

    azure - 数据工厂复制数据而不显式创建目标表

    c# - 管理从 web api 返回的 json 中的属性名称

    sql-server - SQL 服务器 : Export Query RESULT as JSON Object

    c# - 使用 FTP 从 Azure WebJobs 发送文件

    c# - 使用 HttpResponseMessage 401 在 ajax post 上总是成功