gpt4 book ai didi

c# - azure 项目出错

转载 作者:太空狗 更新时间:2023-10-29 17:34:07 25 4
gpt4 key购买 nike

我在 TFS 中有一个 Azure 项目,以前运行良好。

我刚刚获得最新版本并重建了项目,现在出现了一些错误:

Error   97  The setting 'Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel' for role ServiceLayer is specified in the service configuration file, but it is not declared in the service definition file. D:\...\ServiceLayer.Azure1\ServiceConfiguration.Local.cscfg 1   1   ServiceLayer.Azure1

Error 98 Role: 'ServiceLayer', setting 'Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel' in all service configurations could not be found in the service definition. D:\...\ServiceLayer.Azure1\ServiceDefinition.csdef

我有以下代码:

服务定义.csdef:

<ServiceDefinition name="ServiceLayer.Azure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-01.2.3">
<WebRole name="ServiceLayer" vmsize="Medium">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>
</WebRole>
</ServiceDefinition>

和文件:ServiceConfiguration.Local.cscfg:

<ServiceConfiguration serviceName="ServiceLayer.Azure1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="3" osVersion="*" schemaVersion="2014-01.2.3">
<Role name="ServiceLayer">
<Instances count="1" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountUsername" value="[...]" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountEncryptedPassword" value="[...]" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.AccountExpiration" value="2015-03-05T23:59:59.0000000+01:00" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteForwarder.Enabled" value="true" />
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel" value="1" />
</ConfigurationSettings>
<Certificates>
<Certificate name="Microsoft.WindowsAzure.Plugins.RemoteAccess.PasswordEncryption" thumbprint="A218B66C70E780B00E189FAF7C75B0696B90D284" thumbprintAlgorithm="sha1" />
</Certificates>
</Role>
</ServiceConfiguration>

最佳答案

您还需要在服务定义文件的 ConfigurationSettings 部分中指定所有设置名称(不含值)。

所以您的 ServiceDefinitionFile 应该如下所示:

<ServiceDefinition name="ServiceLayer.Azure1"     xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-01.2.3">


<WebRole name="ServiceLayer" vmsize="Medium">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
<Import moduleName="RemoteAccess" />
<Import moduleName="RemoteForwarder" />
</Imports>

<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
<Setting name="Microsoft.WindowsAzure.Plugins.RemoteAccess.Enabled" />

.... and so on (all your settings here

</ConfigurationSettings>
</WebRole>
</ServiceDefinition>

编辑:

您需要对 Certificates 部分执行相同的操作。

关于c# - azure 项目出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25719632/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com