2013-10-11 5 views
1

일반 코드 난독 화 및 응용 프로그램의 오류보고 모두에 SmartAssembly을 사용하고 있습니다.SmartAssembly를 사용하여 오류를 자동으로 기록하고 종료하십시오.

내 응용 프로그램에 처리되지 않은 예외가 발생하면 예외가 기록되고 사용자 상호 작용없이 응용 프로그램이 종료되기를 바랍니다. 이것을 허용하는 SmartAssembly 프로젝트를 만들 수 있습니까?

나는 SmartAssembly GUI에서 프로젝트를 설정하려고했지만 행운이없는 the command-line에서도 시도했다. 아래의 명령과 인자는 내가 시도했지만, 지금까지 내가 어떻게 그것을 종료하고 사용자가 입력하지 않고 오류를 기록하는 방법을 결정할 수 없습니다.

만들기 SA 프로젝트 :

"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com" 
/create shell.saproj input=C:\Repositories\MyApp\src\shell.exe 
/output=shell.exe 
/reportappname="MyTestApp" 
/errorreportingtemplate=standard;continueonerror=false,email:"[email protected]" 
/reportprojectname="Shell" 
/reportcompanyname="My Company" 

프로젝트 빌드 : 웹 사이트의 예에 따르면

"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com" /build shell.saproj 

답변

2

SmartAssembly 맞춤 ErrorReportingTemplates의 몇 가지 예를 포함

예제 Red Gate/SmartAssembly 6/SDK/Exception Reporting/에 위치는 몇 종류로 집중되어

Without UI Standard Custom UI Via Email Secured Proxy Silverlight Silverlight Basic

01,

이러한 각 폴더에는 원하는 결과를 얻기 위해 확장 할 수있는 .csproj 파일이 있습니다. 당신이 사용하는 단지 .dll 후이고, 재사용 가능한 솔루션에 관심이 파일을 직접 편집하고 .dll을 결과를 사용하지 않는 경우 Without UI 폴더 내부 는 Sample 01 - Without User Interface.csproj

제목 우리가 후하고있는 프로젝트입니다 파일 (새 프로젝트를 만드는 대신에 SmartAssembly.SmartExceptionsCore 참조)을 가져옵니다.

편집 OnReportException 기능은 다음과 같이합니다 :

protected override void OnReportException(ReportExceptionEventArgs e) 
    { 
     for (int i=0; i<3; i++) 
     { 
      if (e.SendReport()) break; 
     } 
     e.TryToContinue = false; 
     System.Diagnostics.Process proc = System.Diagnostics.Process.GetCurrentProcess(); 
     proc.Kill(); 
    } 

Here's a Gist of the final result을, 당신이 혼란스러워합니다.

"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com" 
/create shell.saproj input=C:\Repositories\MyApp\src\shell.exe 
/output=shell.exe 
/reportappname="MyTestApp" 
/errorreportingtemplate=MySmartAssemblyLogger.dll;continueonerror=false,email:"[email protected]" 
/reportprojectname="Shell" 
/reportcompanyname="My Company" 

는 GUI 또는 cmd를 통해 구축 :

GUI를 사용하거나 cmd를 통해 프로젝트 파일을 만듭니다

"C:\Program Files\Red Gate\SmartAssembly 6\SmartAssembly.com" /build shell.saproj 
관련 문제