0

I'm developing a WCF service and when I debug the application it runs correctly, however, when I try to create the release version, I get this message:

Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information.

Searching in the internet and here at StackOverflow, I found that this code in the Web.Config, would do the trick:

<startup useLegacyV2RuntimeActivationPolicy="true">
   <supportedRuntime version="v2.0.50727"/>
</startup>

Also tried this:

<startup useLegacyV2RuntimeActivationPolicy="true">
   <supportedRuntime version="v4.0"/>
</startup>

Examples of source:

What 'additional configuration' is necessary to reference a .NET 2.0 mixed mode assembly in a .NET 4.0 project?

Mixed mode assembly in .NET 4

But I'm still getting the error message. What can you suggest?

My web config:

<?xml version="1.0"?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v2.0.50727"/>
  </startup>
  <configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
      <section name="SITEC.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
    </sectionGroup>
  </configSections>
  <appSettings>
    <add key="HSM_Ip" value="3001@192.168.0.6"/>
    <add key="HSM_User" value="Cryxo"/>
    <add key="HSM_Pass" value="123456"/>
    <add key="HSM_LlaveID_Data" value="CryxoKey"/>
    <add key="HSM_LlaveID_Firma" value="CryxoKey"/>
    <add key="HSM_Grupo" value="CRYXO"/>
    <add key="HSM_TimeOut" value="6000"/>
    <add key="URL_Servicio" value="http://www.gmail.com"/>
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5"/>
    <httpRuntime/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
      <add binding="basicHttpsBinding" scheme="https"/>
    </protocolMapping>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
     <directoryBrowse enabled="true"/>
  </system.webServer>
  <applicationSettings>
    <SITEC.Properties.Settings>
      <setting name="SITEC_AWWW_Awww" serializeAs="String">
        <value>http://192.168.10.120:8081/Afwww</value>
      </setting>
      <setting name="SITEC_AIMGProc" serializeAs="String">
    <value>http://localhost:8080/services/ImagesProcessorWS</value>
  </setting>
    </SITEC.Properties.Settings>
  </applicationSettings>
</configuration>
LuisEduardoSP
  • 401
  • 5
  • 11
  • Both of the questions you have linked to suggest updating the `supportedRuntime` section to ``, which you haven't done - yours is still `` – stuartd Sep 05 '17 at 00:13
  • @stuartd I tried that too, I was checking several options and I paste the last one I tried. – LuisEduardoSP Sep 05 '17 at 00:15

0 Answers0