3
votes

I have recently attempted to duplicate our Application server using Microsoft's Web Deploy. Everything went fine although in the logs I seem to be missing some VisualStudio component(?).

This is the full error log:

System.Configuration.ConfigurationErrorsException: The type 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior, Microsoft.VisualStudio.Diagnostics.ServiceModelSink, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' registered for extension 'Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior' could not be loaded. (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config line 236)

What did I miss?

2

2 Answers

5
votes

We recently switched to Windows Server 2016 from Windows Server 2012 R2 (The old one still running). When moved all our applications to this new server we started getting this error in some specific parts of one of the web application.

I compared the machine.config files for both server and both have entries for Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior but for some reason i was getting this error on new server.

I removed following entries from machine.config of new server and error is gone

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

<commonBehaviors>
    <endpointBehaviors>
        <Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>
    </endpointBehaviors>
    <serviceBehaviors>
        <Microsoft.VisualStudio.Diagnostics.ServiceModelSink.Behavior/>
    </serviceBehaviors>
</commonBehaviors>
</system.serviceModel>

I am not very comfortable with removing these lines from machine.config but this is working as temporary solution. Will update my answer if i find a better non invasive solution

1
votes

I am not sure whether this was because I used Windows Update and forgot to restart or because I simply didnt restart after the IIS installation and deploy.

One way or another the answer was to reboot the server.