C# WebDav в проекте VB Asp.Net. Не работает на сервере

Для открытия и сохранения файлов Office я интегрировал сервер ITHit WebDav в свое решение. WebDav реализован в отдельном проекте, но в том же решении. Локально работает нормально, я могу открывать и сохранять документы Word и Excel. Но после развертывания, когда я пытаюсь открыть файл, появляется следующая ошибка:

Sorry, we couldn’t open the File “http://MyWebSite.de/Storage/test.xlsx”

Microsoft Excel cannot access the file “http://MyWebSite.de/Storage/test.xlsx”. 

There are several possible reasons:
 - The file name or path does not exist.
 - The file being used by another program.
 - The workbook you are trying to save has the same name as a currently open workbook.

Файл находится в нужном месте, и приложение имеет полные права на него.

Локальный проект WebDav имеет свой собственный web.config. Но после развертывания в проекте WebSite есть только файл web.config, а WebDav - это файл.dll в папке Bin.

WebSite web.config, внешний и локальный:

...
<location path="Storage">
    <system.web>    
      <httpHandlers>       
        <clear />        
        <add verb="*" path="*" type="WebDav.DavHandler, WebDav" />
      </httpHandlers>    
    </system.web>

    <system.webServer>
      <handlers>        
        <add name="My WebDAV Handler" path="*" verb="*" type="WebDav.DavHandler, WebDav" preCondition="integratedMode" />
      </handlers>      
    </system.webServer>    
  </location>
...

WebDav web.config local:

...
<system.web>
    <httpHandlers>    
      <clear/>     
      <add verb="*" path="*" type="WebDav.DavHandler, WebDav"/>
    </httpHandlers>

    <httpModules>    
      <remove name="FileAuthorization"/>
      <add name="ITHitPutUploadProgressAndResumeModule" type="ITHit.WebDAV.Server.ResumableUpload.PutUploadProgressAndResumeModule, ITHit.WebDAV.Server"/>     
      <add name="ITHitPostUploadProgressModule" type="ITHit.WebDAV.Server.PostUploadProgressModule, ITHit.WebDAV.Server"/>
    </httpModules>

    <httpRuntime executionTimeout="2400" maxRequestLength="2097151" requestPathInvalidCharacters="" relaxedUrlToFileSystemMapping="true" targetFramework="4.5"/>
    <customErrors mode="Off"/>
    <authentication mode="None"/>
    <authorization>
      <allow users="*"/>
    </authorization>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    <compilation targetFramework="4.5" debug="true"/>
  </system.web>

  <system.webServer>
    <handlers>     
      <clear/>      
      <add name="aspnet_isapi 32-bit ASP.NET 2.0" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32"/>      
      <add name="aspnet_isapi 64-bit ASP.NET 2.0" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness64"/>      
      <add name="aspnet_isapi 32-bit ASP.NET 4.0" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness32"/>      
      <add name="aspnet_isapi 64-bit ASP.NET 4.0" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv4.0,bitness64"/>      
      <add name="My WebDAV Handler" path="*" verb="*" type="WebDav.DavHandler, WebDav" preCondition="integratedMode"/>
    </handlers>   

    <modules>      
      <remove name="FileAuthorization"/>  
      <add name="ITHitPutUploadProgressAndResumeModule" type="ITHit.WebDAV.Server.ResumableUpload.PutUploadProgressAndResumeModule, ITHit.WebDAV.Server"/>
      <add name="ITHitPostUploadProgressModule" type="ITHit.WebDAV.Server.PostUploadProgressModule, ITHit.WebDAV.Server"/>     
      <remove name="WebDAVModule"/>
    </modules>
    <validation validateIntegratedModeConfiguration="false"/>

    <security>      
      <requestFiltering allowDoubleEscaping="true">
        <fileExtensions>
          <clear/>
        </fileExtensions>
        <hiddenSegments>
          <clear/>
        </hiddenSegments>
        <requestLimits maxAllowedContentLength="2147483648"/>
      </requestFiltering>
    </security>   

    <staticContent>
      <mimeMap fileExtension=".pkg" mimeType="application/octet-stream"/>
      <mimeMap fileExtension=".deb" mimeType="application/octet-stream"/>
    </staticContent>
  </system.webServer>
...

Как я могу решить эту проблему?

0 ответов

Другие вопросы по тегам