본문 바로가기

Web_Application

(94)
CORS on Nginx location ~ \.php$ { try_files $uri /index.php =404; #root public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_intercept_errors on; fastcgi_param SCRIPT_FILENAME d:/dev/nginx/freemusic/public$fastcgi_script_name; include fastcgi_params; add_header Access-Control-Allow-Origin *; } nginx 다시시작windows commandcmd > nginx.exe -s reopen
Log4net 설치 Package InstallNuget Package Manager > log4net > Install Solution Explorer > Properties > AssemblyInfo.cs [assembly: log4net.Config.XmlConfigurator(Watch = true)] Web.config 소스 적용 예) Solution Explorer > Controllers > OOOController.cs
[NSubstitute] HttpContext Mock // arrange var contextMock = Substitute.For(); var requestMock = Substitute.For(); var queryString = new NameValueCollection(); queryString["foo"] = "bar"; requestMock.QueryString.Returns(queryString); contextMock.Request.Returns(requestMock); var sut = new SomeController(); sut.ControllerContext = new ControllerContext(contextMock, new RouteData(), sut);
[ASP.NET MVC] Make sure that the controller has a parameterless public constructor 유발소스 ASP.NET MVC /Controller/FileController.cs public string storageRoot { get; set; } public FileController() { storageRoot = Server.MapPath("~/App_Data/Upload"); } public FileController(ServerPathProvider pathProvider) { storageRoot = pathProvider.MapPath(); } public string DoSomething(string path1, string path2, string filename) { return StorageRoot + "\\" + path1 + "\\" + path2 + "\\" + file..
[nginx]10013: An attempt was made to access a socket in a way forbidden by its access permissions 2017/01/12 09:01:41 [emerg] 7444#9312: bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions) 80포트가 점유 상태 일 때 확인 D:\dev\nginx-1.11.6>netstat -ano |find /i "listening"|find /i ":80" TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4 TCP [::]:80 [::]:0 LISTENING 4 뒤에 4 번이 PID 프로세스 번호 입니다. 4번 프로세스를 중지시키면 80포트 점유가 풀립니다. C:\Windows\system32>tasklist..
Error 1053: "The service did not respond in a timely fashion" when attempting to start, stop or pause a service Windows 환경에서 서비스로 등록 시 정상적으로 등록이 되지 않을 때 1. Start > Run > regedit 실행 2. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control 3. control 폴더 우클릭 > 새로만들기 DWORD 이름 ServicesPipeTimeout 4. ServicesPipeTimeout 우클릭 후 수정 5. 10진수 (Decimal) 선택 '180000' 입력 후 OK 6. 리부팅
특정 url을 실행 중인 ie 종료 using SHDocVw; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { WebBrowser webBrowser = FindIE("찾을 url"); // 해당 url을 갖고 있는 ie 종료 if (webBrowser != null) { Thread.Sleep(10000); webBrowser.Quit(); } } static SHDocVw.WebBrowser ..
Upgrading mvc4 to mvc5 in vs2013 mvc4 -> mvc 5.2.3.0nuget package manager > asp.net mvc인스톨 되어 있으면 솔루션 탐색기 참조에서 System.Mvc 의 버전 체크 4.0.0.0 이면 System.Web.Mvc 참조 삭제 후 해당 솔루션 밖 패키지 폴더에서패키지 폴더 > Microsoft.AspNet.Mvc.5.2.3 > lib > net45 > System.Web.Mvc.dll 참조 추가 NuGet Package Console 창에서 Install-Package -Id Microsoft.AspNet.WebHelpers Install-Package Microsoft.AspNet.Web.Optimization Install-Package Microsoft.AspNet.WebPages.Data In..