将NodeJS应用程序发布到Azure时出错

时间:2012-02-07 17:38:50

标签: .net iis node.js windows-7 azure

我安装了SDK没有任何问题,并且正在跟随Hello World示例。当我到达Publish-AzureService命令时,它失败了:

PS C:\code\node\tasklist\WebRole1> Publish-AzureService -name TaskListContoso -l
ocation "North Central US" -launch
Publish-AzureService : An error occurred creating the configuration section han
dler for system.serviceModel/commonBehaviors: Extension element 'Microsoft.Visu
alStudio.Diagnostics.ServiceModelSink.Behavior' cannot be added to this element
.  Verify that the extension is registered in the extension collection at syste
m.serviceModel/extensions/behaviorExtensions.
Parameter name: element (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Config\m
achine.config line 323)
At line:1 char:21
+ Publish-AzureService <<<<  -name TaskListContoso -location "North Central US"
 -launch
    + CategoryInfo          : CloseError: (:) [Publish-AzureService], Configur
   ationErrorsException
    + FullyQualifiedErrorId : AzureDeploymentCmdlets.Cmdlet.PublishAzureServic
   eCommand

我到处搜索,但未能找到解决方案。我已经完成了重新安装Windows的所有事情,但很快就要前往那里。

1 个答案:

答案 0 :(得分:1)

这看起来像是machine.config的问题。 Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior是一种wcf行为,它在visual studio中启用了wcf调试功能,它就像从机器配置中移除了行为扩展,而不删除对常见端点和服务行为的引用。

如果您的计算机上安装了dll(Microsoft.VisualStudio.Diagnostics.ServiceModelSink)(如果是这样,则应该在全局程序集缓存中,\ windows \ assembly),那么您应该能够将扩展元素添加回您的machine .config:

<system.serviceModel>
  <extensions>
    <behaviorExtensions>
        <add name="Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior" type="Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior, Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>

如果未安装dll,您可以在machine.config中删除对它的引用:

system.serviceModel/commonBehaviors/endpointBehaviors 

system.serviceModel/commonBehaviors/serviceBehaviors

请注意,在进行任何更改之前,您需要备份machine.config。