2013-07-30 23 views
0

我正在为Windows Phone应用程序开发WCF。WCF部署到天蓝色的实体框架方法返回异常

的数据库为MySQL,所以我利用ADO.net实体框架的访问数据。 它对当地的环境很好。

然而,当我部署它们使用的软件包实例天青,我得到了利用实体框架的方法异常。不需要数据库的数据返回其他方法值精细,如:getHello()

我使用Visual Studio的最新的MySQL连接器。

为了测试,我利用WCFTestClient.exe的。这是当我调用的方法是什么返回我:

The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs. 

Server stack trace: 
    at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) 
    at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 
    at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at IService1.getUUser(Int32 userUid) 
    at Service1Client.getUUser(Int32 userUid) 

服务是http://unifiqsvc.cloudapp.net/Service.svc

方法我试图修复有:

getUUser() - 输入3的任意整数1将返回一个帐户详细

updateLoc() - 输入UID任何整数,LAT,longit(插入记录)

欢迎您访问该服务以帮助我。

回答

0

已解决。

我确定MySQL.Data.dll,MySQL.Web.dll,MySQL.Data.Entity.dll和System.Data.Entity.dll System.Data.Entity.Design System.Data.dll都是本地复制(复制本地设置为true)

以下内容添加到您的web.config文件:

<system.data> 
     <DbProviderFactories> 
     <clear /> 
     <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" 
     description=".Net Framework Data Provider for MySQL" 
     type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, 
     Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> 
     </DbProviderFactories> 
    </system.data>