我在使用ADO.NET Entity Data Model生成 * .edmx,然后利用Domain Service 生成服务。在Silverlight中调用服务中的方法。以上过程在VS2010中一切正常,当我想将程序部署在IIS6的时候,程序可以跑起来,但是怎么也没办法获得Sql server数据。总是提示“远程服务器返回了错误: NotFound。”;
1:跨越xml已经添加在跟目录;
2:系统所使用的dll均已拷贝纸Bin目录下;
3:利用动态svc地址访问http://localhost:8000/wcf/services/sl_WcfRia-web-hwDomainContext.svc无法获得服务页面,在VS2010运行环境范围时可以访问;
各位朋友,可否知道服务器上那里设置出现了问题,到时svc服务在IIS上无法访问的原因。等待大家的帮助,谢谢!
运行环境情况:
1:开发环境和服务器是一台机器(系统:windows xp;数据库:2005 Sql Server;IIS:5.1)
2:Web.Config 文件如下
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<customErrors mode="On"/>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</modules>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
<system.web>
<httpModules>
<add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>
<compilation debug="true" targetFramework="4.0"/>
</system.web>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="fooSoap" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
经过上述步聚,部署就可以成功(操作系统:windows 2003 sp2,windowsxp 均可)
解决问题是快乐的,分享经验也是快乐