'msdn'에 해당되는 글 5건

  1. 2009/07/17 2009년 7월 16일 - sunyruru 미투데이 일기장
  2. 2009/04/03 Error Handling Guide - Rethrow to preserve stack details
  3. 2008/07/14 DHTML을 빠르게 하는 12가지 튜닝
  4. 2008/06/24 Remote Web part debugging
  5. 2007/09/05 MOSS 테크넷
2009/07/17 04:32

2009년 7월 16일 - sunyruru 미투데이 일기장

이 글은 sunyruru님의 2009년 7월 16일의 미투데이 내용입니다.

크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/482 관련글 쓰기

2009/04/03 00:34

Error Handling Guide - Rethrow to preserve stack details



훈스닷넷(Hoons.kr)에 다음과 같이 try - catch 구문에서 throw의 사용에 대해 질문이 올라왔습니다.

글쓴이: 주니
제목: try...catch 에 대해서...
2009-04-02 오후 8:57:59
주소 : http://www.hoons.kr/Board.aspx?Name=QAASPNET&Mode=2&BoardIdx=21940

aspx 페이지에서 biz단 함수를 호출하게 되고 biz단 함수에서는 dbbiz를 호출하게 됩니다.
 
그런 try catch 문을 세 곳 다 걸었습니다.
 
catch문에 에러로그를 남기기위해 에러로그 함수를 불렀다가 throw로 타는 형태로 되어있습니다.
 
제가 개념이 약해서 그런데..제일 마지막 dbbiz 단에서 에러가 나서 catch문을 타면 dbbiz catch만 타게 되는건가요?
 
아니면 다시 돌아오면서 catch문을 다 타게 되는건가요??
 
에러로그 함수 호출은 한곳만 불러야되는데...aspx에 넣어야할지..다 넣어야할지가 ㅡ.ㅡ;;;;;




이에 대한 저의 답변

에러 로그 함수는 aspx에서만 하시고요. Exception에 대해서 e로 받으셨다면 e.StackTrace 값을 찍어보시면 어디에서 부터 catch 되어 넘어왔는지 알 수 있습니다.

단, biz와 dbbiz에서 throw는 e를 던지는
throw e 구문은 StackTrace를 타지 않고, 해당 부분부터 다시 StackTrace를 시작하므로 나중에 어디서 에러가 났는지 찾기 힘들어집니다.
throw e; 형식보다 throw 형식으로만 던지도록 작성하세요.

참고하실 주소 : http://msdn.microsoft.com/ko-kr/library/ms182363.aspx



자세한 내용은 다음과 같이 MSDN의 설명이 있습니다.







참고하실 주소 : http://msdn.microsoft.com/ko-kr/library/ms182363.aspx

TypeName

RethrowToPreserveStackDetails

CheckId

CA2200

Category

Microsoft.Usage

Breaking Change

Non Breaking (주요 변경 아님)

 

 

원인(Cause)

예외가 다시 throw되며 예외가 throw 문에 명시적으로 지정되어 있습니다.
An exception is re-thrown and the exception is explicitly specified in the throw statement.

 

규칙 설명 (Rule Description)

예외가 throw된 경우 예외가 제공하는 정보에는 스택 추적 정보가 포함되어 있습니다. 스택 추적은 예외를 throw한 메서드로 시작되어 예외를 catch한 메서드로 끝나는 메서드 호출 계층 구조 목록입니다. throw 문에 예외를 지정하여 예외가 다시 throw되면 현재 메서드에서 스택 추적이 다시 시작되고 예외를 throw한 원래 메서드와 현재 메서드 간의 메서드 호출 목록이 손실됩니다. 원래의 스택 추적 정보를 예외와 함께 유지하려면 예외를 지정하지 않고 throw 문을 사용합니다.
Once an exception is thrown, part of the information it carries is the stack trace. The stack trace is a list of the method call hierarchy that starts with the method that throws the exception and ends with the method that catches the exception. If an exception is re-thrown by specifying the exception in the throw statement, the stack trace is restarted at the current method and the list of method calls between the original method that threw the exception and the current method is lost. To keep the original stack trace information with the exception, use the throw statement without specifying the exception.

 

위반 문제를 해결하는 방법 (How to Fix Violations)

이 규칙 위반 문제를 해결하려면 예외를 명시적으로 지정하지 않고 예외를 다시 throw합니다.
To fix a violation of this rule, re-throw the exception without specifying the exception explicitly.

 

예제(Example)

다음 예제에서는 이 규칙을 위반하는 CatchAndRethrowExplicitly 메서드와 규칙을 충족하는 CatchAndRethrowImplicitly 메서드를 보여 줍니다.
The following example shows a method, CatchAndRethrowExplicitly, which violates the rule and a method, CatchAndRethrowImplicitly, which satisfies the rule.

using System;

 

namespace UsageLibrary

{

class TestsRethrow

{

static void Main()

{

TestsRethrow testRethrow = new TestsRethrow();

testRethrow.CatchException();

}

 

void CatchException()

{

try

{

CatchAndRethrowExplicitly();

}

catch(ArithmeticException e)

{

Console.WriteLine("Explicitly specified:{0}{1}",

Environment.NewLine, e.StackTrace);

}

 

try

{

CatchAndRethrowImplicitly();

}

catch(ArithmeticException e)

{

Console.WriteLine("{0}Implicitly specified:{0}{1}",

Environment.NewLine, e.StackTrace);

}

}

 

void CatchAndRethrowExplicitly()

{

try

{

ThrowException();

}

catch(ArithmeticException e)

{

// Violates the rule.

throw e;

}

}

 

void CatchAndRethrowImplicitly()

{

try

{

ThrowException();

}

catch(ArithmeticException e)

{

// Satisfies the rule.

throw;

}

}

 

void ThrowException()

{

throw new ArithmeticException("illegal expression");

}

}

}


너무 무차별적으로 해설이 없이 소스만 있지만 -_ -;; 이해해주시길..
천천히 분석해볼만 할거에요;;
저작자 표시 비영리 변경 금지
크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/443 관련글 쓰기

2008/07/14 17:02

DHTML을 빠르게 하는 12가지 튜닝


Faster DHTML in 12 Steps

http://msdn2.microsoft.com/en-us/library/ms533019(VS.85).aspx


MSDN 에서 빠른 DHTML 제공을 위한 12가지 튜닝에 대한 절차를 문서화한 내용입니다.

영문으로 제공되어 있지만 내용이 꼭 필요한 내용이고 그다지 어렵지 않은 단어로 되어 있어 보기 너무 어렵지는 않을거 같네요..(어렵다면 죄송.. -_ -)

원문의 목차를 보면 다음과 같습니다.(스크랩..)

The introduction of Dynamic HTML (DHTML) in Microsoft Internet Explorer 4.0 made available a new programming model to Web authors and developers. Since then, Web authors have taken advantage of this powerful feature to provide dynamic content, styles, and positioning, enabling a rich interactive experience for the Web user. Because of the flexibility of DHTML, there is often more than one way to accomplish what you want to do. Understanding how the HTML parsing and rendering component of Windows Internet Explorer processes your requests can give you the edge when deciding which methods work best for the job. This article describes how using some DHTML features can affect performance more than others, and it presents tips that will help your pages perform faster.


DHTML을 개발하면서 크게 하는 실수는 너무 주관적인 생각만으로 하다보니 효용성이나 사용자 관점을 생각하지 못하는 실수를 하게되거나 퍼포먼스를 고려하지 않는 문제 또는 브라우져 호환성을 고려하지 않는 등의 문제가 발생할 수 있죠.

시간 나실 때 위 원문을 한번 보시는게 어떨지 ^ ^



관련글
2007/08/30 - [CSS] - IE와 W3C의 박스 차이에 의한 CSS 코딩 방식
2008/01/08 - [Sites] - HTML, CSS, JS 등 Markup과 DHTML의 기초를 위한 추천사이트
2008/01/31 - [JavaScript] - 드래그 드랍(Drag and Drop) 으로 개체의 정보 다루기
2008/02/12 - [JavaScript] - JavaScript Obejct 형식의 데이터를 덤프하여 내용 보기

크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/288 관련글 쓰기

2008/06/24 17:33

Remote Web part debugging

http://msdn2.microsoft.com/en-us/library/ms916837.aspx


이 글은 원격 컴퓨터의 웹파트를 디버그하고 개발하는 방법을 소개합니다.

내용은 MSDN의 내용을 발췌하였습니다.


Developing and Debugging from a Remote Computer

To use a remote computer to develop and debug, follow these steps.

Note   To follow these steps, you must have a client computer running Visual Studio .NET (Computer_A) and a server computer running Windows SharePoint Services (Server_B).
  1. On Server_B, share the directory that hosts the SharePoint virtual server. By default, the Windows SharePoint Services virtual server is mapped to the following directory:

    local_drive:\InetPub\wwwroot

  2. Ensure that you have Read and Write permissions for this directory and its sub-directories.
  3. On Server_B, share the directory in which the Microsoft.SharePoint.dll file is located. By default, the Microsoft.SharePoint.dll file is located in the following directory:

    local_drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI

  4. Make sure that you have Read permission for this directory.
  5. On Computer_A, follow these steps:
    1. Click Start, point to All Programs, point to Microsoft Visual Studio .NET, and then click Microsoft Visual Studio .NET.
    2. On the File menu in Visual Studio .NET, click Open.
    3. Browse to the Web Part project that you want to debug, and then click Open.
    4. Right-click the project name, and then click Properties.
    5. In the navigation tree, double-click Configuration Properties.
    6. Under Outputs, verify that the value for Output Path matches the following line:

      remote_drive_on_Server_B:\InetPub\WWWRoot\bin\

    7. In Windows Explorer, browse to the following folder:

      remote_drive_on_Server_B:\InetPub\WWWRoot\bin\.

    8. Double-click the Web.config file.
    9. In the Web.config file, search for the <SafeControls> tag.
    10. Verify that your assembly is listed as a Safe Control. If not, add the following line to the Safe Controls list.
      <SafeControl Assembly="assembly_name, Version=assembly_version,
      Culture=assembly_culture, PublicKeyToken=assembly_public_key_token"
      Namespace="assembly_namespace" TypeName="*" Safe="True"/>
    11. Save and close the file.
  6. On Server_B, install and configure the remote debugging services.

For more information about remote debugging, visit the following MSDN Web site: Visual Studio: Setting Up Remote Debugging.

Problems Saving Output

When you debug or modify an assembly, you may receive the following error message:

Unable to replace file_name.dll after compilation.

This behavior may occur if the W3wp.exe process locks the old copy of the assembly located in the InetPub\WWWRoot\bin directory. To resolve this issue, use Task Manager to end the W3wp.exe process, recompile the assembly, and then resume the debugging process.

Conclusion

Web Parts for Windows SharePoint Services are ASP.NET server controls. Therefore, the process for debugging Web Parts is similar to the process for debugging ASP.NET server controls.

크리에이티브 커먼즈 라이선스
Creative Commons License
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/253 관련글 쓰기

2007/09/05 16:23

MOSS 테크넷

http://technet2.microsoft.com/Office/en-us/library/61799f9a-da01-4c11-b930-52e5114324451033.mspx?mfr=true
http://technet2.microsoft.com/windowsserver/WSS/en/library/700c3d60-f394-4ca9-a6d8-ab597fc3c31b1033.mspx?mfr=true
http://technet2.microsoft.com/windowsserver/WSS/en/library/74f80404-bfba-43b5-8941-95c4795df9d11033.mspx?mfr=true

TechNet MOSS 2007 아 죽겠다... 모스 모스~
크리에이티브 커먼즈 라이선스
Creative Commons License

'Microsoft > SPS/MOSS' 카테고리의 다른 글

Active directory how to  (0) 2007/09/06
Active Directory ㅠ_ㅠ  (0) 2007/09/06
MOSS 테크넷  (0) 2007/09/05
Active directory 제어  (0) 2007/09/05
MOSS Custom 검색을 위한 Webpart를 만들기 위한 예제 코드  (0) 2007/09/01
MOSS SharePoint Server 2007 SDK  (0) 2007/08/30
올블로그추천버튼 블코추천버튼 블로그뉴스추천버튼 믹시추천버튼 한RSS추가버튼 구글리더기추천버튼


이 포스팅이 도움이 되었다면 구글에서 관련 정보를 찾아 보세요 ^^


Trackback 0 Comment 0

Trackback : http://i-ruru.com/trackback/159 관련글 쓰기