C# 执行命令定义-WCF时出错
我已经更新了我的模型并重建了项目(如stackoverflow所建议的),但没有任何好处 我的ASP.NET wcf Web服务在本地主机上运行良好。但当我上传到AppHarbor(免费asp.net网络托管服务)时,我遇到了一个我无法理解的异常(我这样打电话)。这在我的本地主机上非常有效,那么上传后有什么问题 请求错误服务器在处理请求时遇到错误。 异常消息为“执行时发生错误” 命令定义。有关详细信息,请参见内部异常。“。请参阅服务器 日志以获取更多详细信息。异常堆栈跟踪为: 在 System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand,CommandBehavior)位于 System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext 上下文,ObjectParameterCollection parameterValues)位于 System.Data.Entity.Core.Objects.ObjectQueryC# 执行命令定义-WCF时出错,c#,asp.net,entity-framework,wcf,appharbor,C#,Asp.net,Entity Framework,Wcf,Appharbor,我已经更新了我的模型并重建了项目(如stackoverflow所建议的),但没有任何好处 我的ASP.NET wcf Web服务在本地主机上运行良好。但当我上传到AppHarbor(免费asp.net网络托管服务)时,我遇到了一个我无法理解的异常(我这样打电话)。这在我的本地主机上非常有效,那么上传后有什么问题 请求错误服务器在处理请求时遇到错误。 异常消息为“执行时发生错误” 命令定义。有关详细信息,请参见内部异常。“。请参阅服务器 日志以获取更多详细信息。异常堆栈跟踪为: 在 System.
1.c\u DisplayClass3.b\u 2()
在
System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func
1
func,IDbExecutionStrategy executionStrategy,布尔值
startLocalTransaction,布尔releaseConnectionOnSuccess)位于
System.Data.Entity.Core.Objects.ObjectQuery1.c\u DisplayClass3.b\u 1()
在
System.Data.Entity.SqlServer.DefaultSqlExecutionStrategy.Execute[TResult](Func
1
操作)在
System.Data.Entity.Core.Objects.ObjectQuery1.GetResults(可为null
1
forMergeOption)在
System.Data.Entity.Core.Objects.ObjectQuery1.b__0()
在System.Lazy时
1.CreateValue()在System.Lazy时1.LazyInitValue()在
System.Lazy1.在
System.Data.Entity.Internal.LazyEnumerator1.MoveNext()位于
System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
1源)
在
System.Data.Entity.Core.Objects.elink.ObjectQueryProvider.b__2[TResult](IEnumerable1
序列)在
System.Data.Entity.Core.Objects.elink.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable
1
查询,表达式queryRoot)位于
System.Data.Entity.Core.Objects.Elink.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](表达式
表达式)在
System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](表达式
表达式)在
System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)位于
WcfServicePizza.Service1.Login(字符串phoneNo,字符串密码)
d:\temp\lmtrshzg.bwx\input\WcfServicePizza\Service1.svc.cs:at的第37行
SyncInvokeLogin(对象,对象[],对象[])位于
System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象
实例、对象[]输入、对象[]和输出)
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc&
rpc)在
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&
rpc)位于System.ServiceModel.Dispatcher.MessageRpc.Process(布尔值
等操作上下文集)
webservice接口的代码
[OperationContract]
[WebInvoke(UriTemplate="SignUp",
Method="POST",
BodyStyle=WebMessageBodyStyle.WrappedRequest,
ResponseFormat=WebMessageFormat.Json,
RequestFormat=WebMessageFormat.Json)]
bool SignUp(Customer customer);
当前在服务器上运行的实现代码为:
public bool Login(string phoneNo, string password)
{
decimal phoneNoDecimal = Decimal.Parse(phoneNo);
DatabasePizzaEntities db = new DatabasePizzaEntities();
Customer customer = db.Customers.Where(c => c.PhoneNo==phoneNoDecimal && c.Password == password).SingleOrDefault();
if (customer == null)
return false;
return true;
}
内部异常:
Data.SqlClient.SqlException(0x80131904):对象名称无效
“dbo.Customer.”\u000d\u000a在
System.Data.SqlClient.SqlConnection.OnError(SqlException异常,
布尔断开连接,操作1 wrapCloseInAction)\u000d\u000a位于
System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
异常,布尔断开连接,操作
1
wrapCloseInAction)\u000d\u000a位于
System.Data.SqlClient.TdsParser.ThroweException和Warning(TdsParserStateObject
stateObj,布尔调用方连接锁,布尔
异步关闭)\u000d\u000a在
System.Data.SqlClient.TdsParser.TryRun(运行行为,
SqlCommand cmdHandler、SqlDataReader数据流、,
BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject
stateObj、Boolean和dataReady)\u000d\u000a位于
System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\u000d\u000a位于System.Data.SqlClient.SqlDataReader.get\u MetaData()\u000d\u000a处 System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, 运行行为运行行为,字符串重置选项字符串)\u000d\u000a位于 System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior、RunBehavior、Boolean returnStream、Boolean 异步、Int32超时、任务和任务、布尔异步写入、SqlDataReader ds)\u000d\u000a位于 System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior、RunBehavior、布尔返回流、字符串 方法,TaskCompletionSource
1完成,Int32超时,任务和任务,
布尔异步写入)\u000d\u000a at
System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior、RunBehavior、布尔返回流、字符串
方法)\u000d\u000a at
System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
行为,字符串方法)\u000d\u000a在
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
行为)\u000d\u000a在
System.Data.Common.DbCommand.ExecuteReader(CommandBehavior
行为)\u000d\u000a在
System.Data.Entity.Infrastructure.Interce
An error occurred while executing the command definition