代码改变世界

Silverlight4 + WCF RIA Serivces + MySql Connector6.3.5 On Godaddy

2010-12-17 15:37  yunti  阅读(529)  评论(0)    收藏  举报

这是第一篇博文,能发表就不容易了。工作忙,太懒。

这里没有godaddy广告的嫌疑,godaddy只是“被代表”。

 

在godaddy上发表如题的网站会有几个问题出现!

1.如果你是share hosting 的话必须变成是grid hosting  才可以使用asp.net4.0 .(share hosting还是asp.net3.5,时间2010.12.17,以后可能sharehosting也有asp.net4.0吧);

这个不会你只能上网找了··

2.关于wcf ria services问题了,如果你没有包括程序集System.ServiceModel.DomainServices.Hosting,System.ServiceModel.DomainServices.Server,System.ServiceModel.DomainServices.EntityFramework,还有一个System.ServiceModel.DomainServices.Hosting.OData(如果你在新建domain serivce的时候checked Odata的话)页面提示错误信息:Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 系统找不到指定的文件。

解决方法,手动复制,或者在引用属性上把copy local 变成true.

3.通过了重重难过之后,你应该看到这个异常(可能你需要使用fiddler来截取详细的信息):IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.如果不是这个异常,那么就不是hosting商的问题了····不知道这个是什么异常那么上网搜搜或者看看文档了···

好了,打开我们的google老师输入(godaddy wcf ria )最头头的两编文章是goddaddy论坛上的问答(地址:http://community.godaddy.com/groups/web-hosting/forum/topic/ria-services-on-godaddy/  http://community.godaddy.com/groups/web-hosting/forum/topic/wcf-ria-service-authentication-schemes/) DuckSoup同学导出了真谛:(Hoan,
Sorry for the delay. I got it running on GoDaddy. I do include the DLL's in the distribution but the big trick was to contact GoDaddy support and have them remove Basic Authentication for your account.)如果你英语超标的厉害那么可以打电话给godaddy support和他们聊天。我只能躲在一角翻开字典慢慢写email(大概内容是叫他们把IIS7的Basic Authentication删除掉,这个是wcf ria 的问题,听说下个版本会修复这个问题).等了一天多的时间,OK,放上去使用,问题又来了················

 

4.如果这个时候你使用的是mssql2005就发现,sl没问题了(都是MS的东西的好处啊),可惜我使用了mysql了。models是使用了domain class ->entity framework -> mysql connector6.3.5,你就会有这个异常:Unable to find the requested .Net Framework Data Provider. It may not be installed.  问题一下子就判断出来了,没有程序集,手动把connector的程序集复制上去(注意了,看看他们的版本是否一样,我的版本MySql.Data.CF.dll MySql.Data.Entity.dll是6.3.4 ,MySql.Data.Entity.dll(V4.0中)把这个程序集换成6.3.5不然有报异常了,再看·······靠,不行。打开我们的google老师输入异常,又是英文,没所谓打开我们的字典(http://www.daniweb.com/forums/thread154467.html )

在configuration 间加上:如果不会写格式就(Go to the folder C:\WINDOWS\Microsoft.NET\Framework\(你要的版本)v2.0.50727\CONFIG

Select the Machine.config and then find the tag <DbProviderFactories> under <system.data> and copy)

<configuration>

<system.data>
    <DbProviderFactories>
      <!--<remove name="Microsoft SQL Server Compact Data Provider"/>-->
      <remove invariant="MySql.Data.MySqlClient"/>
      <!--<add name="Microsoft SQL Server Compact Data Provider" invariant="System.Data.SqlServerCe.3.5" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=3.5.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>-->
      <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.3.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
</configuration>

 

OK 有东西看了·····如果你不是租空间的,就不用那么痛苦了·····