无法更改ServiceDefinition文件

时间:2012-12-24 12:22:13

标签: .net visual-studio-2010 azure

我安装最新的Azure SDK for .Net - 2012年10月后,我无法更改ServiceDefinition.csdef文件。

B'cos我需要注释掉这个<!--<Binding name="HttpsIn" endpointName="HttpsIn" hostHeader="www.pawloyalty.com" />-->行。

编译后它给出了下面提到的消息。即使消息说文件已在源编辑器外修改。实际上我在源代码编辑器中做了(使用 vs 2010 )。

enter image description here

ServiceDefinition.csdef 文件如下所示

<?xml version="1.0" encoding="utf-8"?>
<!--
  **********************************************************************************************

  This file was generated by a tool from the project file: ServiceDefinition.csdef

  Changes to this file may cause incorrect behavior and will be lost if the file is regenerated.

  **********************************************************************************************
-->
<ServiceDefinition name="PawLoyalty.Web.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
    <WebRole name="PawLoyalty.Web" vmsize="Medium">
        <Startup priority="-2">
            <Task commandLine="startuptasks/settime.cmd" executionContext="elevated" taskType="simple" />
            <Task commandLine="Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe install" executionContext="elevated" taskType="simple" />
            <Task commandLine="Microsoft.WindowsAzure.Caching\ClientPerfCountersInstaller.exe install" executionContext="elevated" taskType="simple" />
        </Startup>
        <Sites>
            <Site name="Web">
                <Bindings>
                    <Binding name="HttpIn" endpointName="HttpIn" hostHeader="www.pawloyalty.com" />
                    <Binding name="HttpsIn" endpointName="HttpsIn" hostHeader="www.pawloyalty.com" />
                </Bindings>
            </Site>
        </Sites>
        <ConfigurationSettings>
            <Setting name="Blob" />
            <Setting name="CDN" />
            <Setting name="ConnectionString" />
            <Setting name="Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel" />
        </ConfigurationSettings>
        <Endpoints>
            <InputEndpoint name="HttpIn" protocol="http" port="80" />
        </Endpoints>
        <Certificates></Certificates>
        <Imports>
            <Import moduleName="Diagnostics" />
            <Import moduleName="RemoteAccess" />
            <Import moduleName="RemoteForwarder" />
            <Import moduleName="Caching" />
        </Imports>
        <LocalResources>
            <LocalStorage name="ExcelStorage" cleanOnRoleRecycle="false" sizeInMB="250" />
            <LocalStorage name="Microsoft.WindowsAzure.Plugins.Caching.FileStore" sizeInMB="1000" cleanOnRoleRecycle="false" />
            <LocalStorage name="DiagnosticStore" sizeInMB="20000" cleanOnRoleRecycle="false" />
        </LocalResources>
    </WebRole>
</ServiceDefinition>

为什么?

如何更改ServiceDefinition.csdef文件?

1 个答案:

答案 0 :(得分:6)

文件顶部的大警告是您的第一个提示。

<!--
  **********************************************************************************************

  This file was generated by a tool from the project file: ServiceDefinition.csdef

  Changes to this file may cause incorrect behavior and will be lost if the file is regenerated.

  **********************************************************************************************
-->

基本上,这个文件是在构建过程中根据其他内容生成的。对于Windows Azure,其角色为“配置设置”。

1)关闭该文件选项卡(您永远不会直接更改该文件)
2)展开“角色”文件夹
3)双击要更改的角色
4)在新属性对话框中,单击端点
5)删除你不想要的那个。

enter image description here enter image description here