Reputation: 3384
I have an issue when deploying wcf service to remote iis, first, I have vs solution contains two projects
Inside my library project there is ExchangeEmailService.cs
and ExchangeEmailService.cs
files.
Then I included the library in ExchangeMailService
project and created new .svc file as follows
<%@ServiceHost Language="C#" Debug="true" Service="ExchangeMailCore.ExchangeEmailService" %>
my web.config file as follows,
<?xml version="1.0"?>
<configuration>
<appSettings>
<!--<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />-->
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
</appSettings>
<system.web>
<!--<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>-->
<compilation debug="true" />
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>
</system.web>
<system.serviceModel>
<!--<bindings>
<basicHttpBinding>
<binding name="NetTcpBindingEndpointConfig">
--><!--<security mode="Message" />--><!--
<security mode="Transport">
<transport clientCredentialType="Windows">
</transport>
--><!--<message clientCredentialType=""/>--><!--
</security>
</binding>
</basicHttpBinding>
</bindings>-->
<!--<services>
<service name="ExchangeMailCore.ExchangeEmailService">
</service>
</services>-->
<services>
<service name="ExchangeMailCore.ExchangeEmailService">
<endpoint address="" binding="basicHttpBinding" contract="ExchangeMailCore.IExchangeEmailService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8734/Design_Time_Addresses/ExchangeMailCore/ExchangeEmailService/" />
</baseAddresses>
</host>
</service>
</services>
<!--<behaviors>
<serviceBehaviors>
<behavior>
--><!-- To avoid disclosing metadata information, set the values below to false before deployment --><!--
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="False"/>
--><!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --><!--
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>-->
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information,
set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="False" />
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>
<!--<protocolMapping>
<add binding="basicHttpBinding" scheme="http" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />-->
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
This runs perfectly on localhost, but when I deploy to the remote server it gives following error,
.Net framework is 4.5
Is any one can help on this?
Upvotes: 2
Views: 6350
Reputation: 3384
After spending beautiful night, I found the solution, solution is adding the required library files(.dlls) to the deployed folder bin folder, I was using the EWS for email extraction so I have to add ews library to the bin folder of the published folder, thanks, hops this will help to someone.
Upvotes: 2