无法更改ServiceDefinition文件

Sam*_*ath 4 .net azure visual-studio-2010

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

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

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

在此输入图像描述

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>
Run Code Online (Sandbox Code Playgroud)

为什么?

我该如何更改 ServiceDefinition.csdef文件?

iam*_*lin 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.

  **********************************************************************************************
-->
Run Code Online (Sandbox Code Playgroud)

基本上,这个文件是在构建期间根据其他内容为您生成的.在Windows Azure的情况下,其角色配置设置.

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

在此输入图像描述 在此输入图像描述