代码改变世界

updater application block v2.0的使用过程中遇到的问题及解决办法

2005-08-10 16:43  netwy  阅读(1767)  评论(5编辑  收藏  举报

最近使用uab2.0做智能升级程序,在使用的过程中碰到这样的问题:
当要下载的文件的扩展名为.config,.rmf时,程序就会报错
Exception Information Details: 
 
====================================== 
 
Exception Type: 
 
Microsoft.ApplicationBlocks.Updater.Downloaders.BitsDownloadErrorException 
 
Code: -2145844845 
 
Context: 5 
 
ContextDescription: The error occurred while the remote file was being 
 
processed. 
 
Message: The client does not have sufficient access rights to the requested 
 
server object. 
如果将.config后缀改成xml,下载能正常工作
解决办法,在server的下载目录中添加一个web.config文件,内容为:

<?xml version="1.0" encoding="utf-8" ?> 
 
<configuration> 
 
<system.web> 
 
<httpHandlers> 
 
<add verb="GET,HEAD" path="myApplication.config" 
 
type="System.Web.StaticFileHandler" /> 
 
<add verb="GET,HEAD" path="*.config" 
 
type="System.Web.StaticFileHandler" /> 

<add verb="GET,HEAD" path="*.rmf" 
 
type="System.Web.StaticFileHandler" /> 
 
</httpHandlers> 
 
</system.web> 
 
</configuration> 

ok!程序一切正常!