0

좋습니다. ASP.NET 사이트에서 IIS를 실행하는 CMS 사이트가 있습니다.사이트를 통해 IIS의 사이트에있는 파일을 업데이트하는 방법은 무엇입니까?

사용자가 사이트의 일부 이미지를 업데이트하려고하지만 최근에 서비스가 제공 되었기 때문에 IIS에 핸들이 열려있어 파일을 잠급니다. 이 파일에 핸들을 캐시 된 해제 IIS에게 프로그래밍 방식으로 ASP.NET의 코드에서, 어떤 방법이 있나요

The process cannot access the file 'X:\inetpub\wwwroot\sitename\Images\Banner\Temp\5.jpg' because it is being used by another process. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.IO.IOException: The process cannot access the file 'X:\inetpub\wwwroot\sitename\Images\Banner\Temp\5.jpg' because it is being used by another process. 

Source Error: 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 

[IOException: The process cannot access the file 'X:\inetpub\wwwroot\sitename\Images\Banner\Temp\5.jpg' because it is being used by another process.] 
    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +14328663 
    System.IO.File.InternalDelete(String path, Boolean checkHost) +14293114 
    Admin_Settings_EditHomePageBanner.btnSave_Click(Object sender, ImageClickEventArgs e) +1109 
    System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +134 
    System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +204 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804 

:이 파일의 업데이트 된 버전을 업로드하려고 할 때 다음 오류가 발생 사용자에 이르게 업데이트 될 수 있습니까? 분명히 전체 IIS 프로세스를 재활용하는 것은 실제로 여기에서 실행 가능한 접근법이 아닙니다.

답변

1

Bro, 문제를 올바르게 진단했다고 생각하지 않습니다. IIS는 결코 이런 방식으로 파일을 보관하지 않으며, 이것이 사실이 아니라고 확신합니다.

.Net의 비트 맵 클래스를 사용하여 수정/표시하는 등의 코드에서 이러한 이미지로 놀았습니까? 내 자신의 코드가 이러한 이미지를 다시 붙잡고 있다고 생각합니다. 여기에 코드를 붙여 넣으면 어떤 도움이 될지도 모릅니다.

0

다시 시작하는 것이 가장 좋고 가장 나쁜 옵션입니다. 업데이트 된 global.asax를 배포하여 다시 시험해 볼 수 있습니다.

관련 문제