개발하는 동안 SVN 패치 파일을 사용하여 웹 API에서 인증을 제거하려고합니다. 인증을 제거하는 패치 파일은 잘 작동하고 다음과 같습니다 : 당신이 볼 수 있듯이TortoiseSVN 패치 파일이 잘못 적용되었습니다.
Index: WebApplication.Api/Global.asax.cs
===================================================================
--- WebApplication.Api/Global.asax.cs (revision 18939)
+++ WebApplication.Api/Global.asax.cs (working copy)
@@ -115,7 +115,7 @@
_dependencyRegister.AddRegistration<WebApplication.Application.Aspects.AuthorisationAspect>();
// WebApplication.Application.CurrentUser
- _dependencyRegister.AddRegistration<WebApplication.Application.CurrentUser.ICurrentUserService, WebApplication.Application.CurrentUser.CurrentUserService>();
+ _dependencyRegister.AddRegistration<WebApplication.Application.CurrentUser.ICurrentUserService, WebApplication.Api.DummyServices.CurrentUserService>();
// WebApplication.Application.Interface.Manager
_dependencyRegister.AddRegistration<WebApplication.Application.Interface.Manager.IAspNetMembershipManager, WebApplication.Application.Manager.AspNetMembershipManager>();
Index: WebApplication.Api/Web.config
===================================================================
--- WebApplication.Api/Web.config (revision 18939)
+++ WebApplication.Api/Web.config (working copy)
@@ -64,14 +64,12 @@
</sessionState>
<httpModules>
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
- <add name="ProtectedResourceModule" type="WebApplication.Api.Modules.ProtectionModule"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
- <add name="ProtectedResourceModule" type="WebApplication.Api.Modules.ProtectionModule"/>
</modules>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
, 그것은 인터페이스의 DI 구현을 변경하고 XML 구성 파일에서 두 개의 노드를 제거합니다.
Visual Studio에서 VisualSVN을 사용하여 패치를 적용하는 방법이 없으므로 원본 패치 파일을 기반으로 '역방향 패치'를 만들었습니다.
Index: WebApplication.Api/Global.asax.cs
===================================================================
--- WebApplication.Api/Global.asax.cs (revision 18939)
+++ WebApplication.Api/Global.asax.cs (working copy)
@@ -115,7 +115,7 @@
_dependencyRegister.AddRegistration<WebApplication.Application.Aspects.AuthorisationAspect>();
// WebApplication.Application.CurrentUser
+ _dependencyRegister.AddRegistration<WebApplication.Application.CurrentUser.ICurrentUserService, WebApplication.Application.CurrentUser.CurrentUserService>();
- _dependencyRegister.AddRegistration<WebApplication.Application.CurrentUser.ICurrentUserService, WebApplication.Api.DummyServices.CurrentUserService>();
// WebApplication.Application.Interface.Manager
_dependencyRegister.AddRegistration<WebApplication.Application.Interface.Manager.IAspNetMembershipManager, WebApplication.Application.Manager.AspNetMembershipManager>();
Index: WebApplication.Api/Web.config
===================================================================
--- WebApplication.Api/Web.config (revision 18939)
+++ WebApplication.Api/Web.config (working copy)
@@ -64,14 +64,12 @@
</sessionState>
<httpModules>
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
+ <add name="ProtectedResourceModule" type="WebApplication.Api.Modules.ProtectionModule"/>
</httpModules>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="PerRequestLifestyle" type="Castle.MicroKernel.Lifestyle.PerWebRequestLifestyleModule, Castle.Windsor" />
+ <add name="ProtectedResourceModule" type="WebApplication.Api.Modules.ProtectionModule"/>
</modules>
<httpErrors existingResponse="PassThrough" />
</system.webServer>
간단히 말하면, 내가 한 모든 것은 변경 + 기호입니다. - 그 반대도 마찬가지입니다. 이것은 나에게 맞는 역방향 패치 파일을 만듭니다.
역방향 패치는 XML 구성 파일의 마지막 '줄 추가'와 줄을 추가하는 것 외에 다음 줄 중 몇 개가 제거되어 잘못된 형식의 XML이 만들어지는 것을 제외하고는 잘 작동합니다.
누구에게 조언 할 수 있습니까? 마법 @@ -64,14 +64,12 @@
으로 무언가를해야합니까?