关于Win7 天气插件的问题

873 views 十一月 17, 09 by Timothy

最近突然发现自己Win7 gadget中的天气插件罢工了,老是显示Service not available,冥思苦想不得其解,在网上Google了一把,才找到原因,原来在将系统的Region and Language设置为非美国地区或者非英语格式后(比如设置为China),系统中的wlsrvc.dll会在运行时检查你的地区设置,如果检查到设置为India或者China,DLL会返回1506,表示天气服务在你的语言区域不可用。晕死…… 回忆了一下前些日子,为了使用一个软件,不得已改了语言设置,索性把Location改回为United Status, Format改回为English,一切又正常了,天气服务立马可用。嗯,反正我的Windows 7也是英文版的,改回来还是比较方便的方法,网上还有一种比较暴力的方法,就是替换掉那个wlsrvc.dll,有兴趣的同学可以参考下列步骤:

  1. Close and exit Windows Sidebar.
  2. Open Windows Explorer.
  3. Browse to C:\Program Files\Windows Sidebar folder.
  4. Take ownership and grant full permission to you on wlsrvc.dll file.
  5. Rename wlsrvc.dll to wlsrvc.dll.old.
  6. Download the patched wlsrvc.dll (contains inside the wlsrvc.zip).
  7. Copy the patched wlsrvc.dll into the Windows Sidebar folder.
  8. Run the sidebar.exe to restart Windows Sidebar.

IIS7中Host WCF遇到的问题

204 views 九月 03, 09 by Timothy

最近重装了系统,用上了Windows 7,在IIS7中Host WCF Service的时候,遇到一个比较奇怪的问题,当在站点下面添加应用,指向WCF的目录后,访问.svc文件,浏览器提示以下错误:

 

The page you are requesting cannot be served because of the extension configuration.
If the page is a script, add a handler. If the file should be downloaded, add a MIME map. 

 

这种错误应该是.svc文件没有映射到相关的handler上,因此IIS不知道怎么处理该请求。带着错误信息,在网上搜索了一把,终于找到了解决方法,看来搜索引擎很强大。

解决方法如下:

1.用管理员身份运行cmd命令行

2.切换到目录C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation

3.运行命令: servicemodelreg –i

这样,工具会自动把WCF相关的注册项安装到IIS7中,再打开浏览器访问WCF Service,一切正常。

细想了一下自己的装机过程,先装了VSTS和.net framework,后来发现IIS7没有在windows7里面默认安装,要到部署WCF的时候,才装好IIS7。这样在安装.net framework 3.0的时候,因为没有安装IIS7,所以一些注册项就没有起到作用。此方法可以将WCF的配置项重新配置到IIS7中,供同学们参考。