Register-ServiceFabricApplicationType:值不能为null。参数名称:source

问题描述 投票:2回答:1

我正在尝试在本地运行我的Service Fabric应用程序但是我收到了以下错误:

Register-ServiceFabricApplicationType:值不能为null。

参数名称:source

在这种情况下,source是什么?为什么是null

azure-service-fabric
1个回答
1
投票

ApplicationManifest.xml我定义了<EnvironmentOverrides> w / one <EnvironmentVariable>条目,但我没有在<EnvironmentVariable>中定义ServiceManifest.xml

Sample project to illustrate


ApplicationManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<ApplicationManifest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ApplicationTypeName="Application1Type" ApplicationTypeVersion="1.0.0" xmlns="http://schemas.microsoft.com/2011/01/fabric">
  <Parameters>
    <Parameter Name="Web1_InstanceCount" DefaultValue="-1" />
    <Parameter Name="OverrideTest" DefaultValue="Do I Get a Useless Error Message?" />
  </Parameters>
  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="Web1Pkg" ServiceManifestVersion="1.0.0" />
    <ConfigOverrides />
    <EnvironmentOverrides CodePackageRef="Code">
      <EnvironmentVariable Name="OverrideTest" Value="[OverrideTest]" />
    </EnvironmentOverrides>
  </ServiceManifestImport>
  ....
  </DefaultServices>
</ApplicationManifest>

ServiceManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="Web1Pkg"
                 Version="1.0.0"
                 xmlns="http://schemas.microsoft.com/2011/01/fabric"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ServiceTypes>
    <StatelessServiceType ServiceTypeName="Web1Type" />
  </ServiceTypes>

  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>Web1.exe</Program>
        <WorkingFolder>CodePackage</WorkingFolder>
      </ExeHost>
    </EntryPoint>
    <!--Uncomment the EnvironmentVariables to get rid of Value cannot be null. >Parameter name: source-->
    <!--<EnvironmentVariables>
      <EnvironmentVariable Name="OverrideTest" Value="Uncomment-me to get rid of the error" />
    </EnvironmentVariables>-->
  </CodePackage>
  ...
</ServiceManifest>
© www.soinside.com 2019 - 2024. All rights reserved.