에러 메세지

------------------

Active Server Pages 오류 'ASP 0131'

허용되지 않는 부모 경로

/ppcardManager/ppCardList/list.asp, 줄 22

'../submenu_Product.asp' Include 파일은 부모 디렉터리를 표시하기 위해 '..'를 사용할 수 없습니다.

 

----------------

 

어디서 들은적은 있었는데... 오늘 에러 메세지를 확인하고 찾아봤습니다.

windows 2003에서는 기본적으로 보안을 강화하기 위해 상위 폴더의 파일 참조를 불허한다고 합니다.

영문 MSDN 원본 입니다.

 

IIS 6.0 and later:  To increase security, parent paths are disabled by default. This can potentially break upgraded Web sites that use the ..\ notation or include files from parent directories.

 

그러므로 상위 폴더 파일 첨부를 허용하게 하기 위해선 IIS 세팅을 변경해 주시면 됩니다.

 

사이트 등록정보를 누르면 아래와 같은 화면이 뜨는데 거기서 '홈 디렉터리'를 선택

 

'옵션' 탭에 보면 '부모 경로 사용' 이 부분을 check하면 문제 해결~

http://www.devpia.com/Forum/BoardView.aspx?no=20029&page=10&Tpage=18&forumname=csharp_qa&stype=&ctType=&answer=&KeyR=title&KeyC=

 

 

1. 일단은 클래스 라이브러리 프로젝트를 선택하시구요...

    COM+를 작성할 것들을 코딩하시구요...

 

2. 일단 COM+를 만들려면 System.EnterpriseService를 참조 추가하시구요...

   그리구 네임스페이스를 적어주시구요...

   그런 다음 만드시는 클래스는 반드시 ServicedComponent를 상속 받아야합니다...

 

3. 아래는 COM+의 주요 서비스들인데요...

   이 서비스들을 이용하시려면 적절한 어트리뷰트를 추가하셔야 하구요...

항목설명
자동 트랜잭션 처리선언적 트랜잭션 처리 기능을 적용합니다.
BYOT(Bring Your Own Transaction)트랜잭션 상속 형식을 허용합니다.
COMTI자동화 개체에서 CICS 및 IMS 응용 프로그램을 캡슐화합니다.
CRM트랜잭션이 없는 리소스에 원자성 및 영속성 속성을 적용합니다.
Just-In-Time 활성화메서드가 호출될 때 개체를 활성화하고 호출이 반환될 때 활성화를 취소합니다.
느슨하게 결합된 이벤트개체 기반 이벤트를 관리합니다.
개체 생성클래스의 인스턴스를 생성할 때 영구 문자열 값을 인스턴스에 전달합니다.
개체 풀링이미 만들어진 개체들이 포함된 풀을 제공합니다.
전용 구성 요소out-of-process 호출로부터 구성 요소를 보호합니다.
대기열 사용 구성 요소비동기 메시지 대기열을 제공합니다.
역할 기반 보안 역할에 따라 보안 권한을 적용합니다.
SOAP 서비스구성 요소를 XML Web services로 게시합니다.
동기화동시성을 관리합니다.
XA 상호 운용성X/Open 트랜잭션 처리 모델을 지원합니다.

 

4. 해당 기능들을 다 정의 했다고 한다면...

    강력한 이름의 어셈블리를 추가해야 합니다...

    그럴려면 프로젝트 파일 중에서 AssemblyInfo.cs 파일을 여시구요...

    [assembly: AssemblyKeyFile("")] 이 부분에 KeyFile의 경로를 설정하셔야 합니다...

    키 생성은 sn.exe를 이용하면 됩니다...

    sn -k XXXX.snk

 

5. 이제 모든 것이 완료되었습니다...

   이 프로젝트를 빌드하시면 DLL 파일이 생깁니다...

   이 DLL 파일을 이용해서 이제 COM+에 등록을 해야 합니다...

 

6. 전역 어셈블리에 추가하시려면 gacutil.exe를 이용하셔서 전역 어셈블리에 등록을 하셔야 합니다...

 

ex) gacutil /i c:\mydll.dll

 

7. 이제 COM+ 응용 프로그램에 등록하실 차례인데요...

   regsvcs.exe를 이용하셔서 COM+ 응용 프로그램에 등록하시면 됩니다...

regsvcs /appname:myTargetApp c:\myTest.dll

 

 

8. 이렇게 되면 이제 모든 것이 완료 되었습니다...

    확인하시려면 구성요소 서비스에서 등록한 COM+ 응용 프로그램이 있는지 확인하시면 됩니다...

 

* 참고 자료 : MSDN에서 COM+라고 치시면 많은 관련 문서들이 있습니다...

그럼!~~~

C#으로 Component만들어 돌려보고...

배포 쪽 확인 작업 중...

 

SETUP Project를 통해 GAC에 등록하는 것까지는 했는데... 구성요소서비스에 등록하는 방법(Batch 파일을 통한 방법 말고)을 찾던 중... 매우 쉽게 하는 방법을 찾았다 --;;

 

시작-관리도구-구성요소서비스 에서...

등록된 컴포넌트를 선택하고 오른쪽 마우스 버튼을 누르면 '내보내기'라고 나온다..

 

이것 선택하면 설치 파일이 자동 생성된다 MSI파일과 CAB파일...

 

이것만 가지고 실제 작업 서버에서 실행하면 GAC등록은 물론 구성요소서비스에도 자동 등록된다....

 

쩝... 허무했다 너무 간단해서...

 

혹시 SET Project에서 구성요소서비스에 등록하는 법을 알고 계신분 답글 부탁드립니다.

'programming > c#' 카테고리의 다른 글

[펌] COM+ 관련 게시물  (0) 2004.11.12
[펌] COM + 의 Server 방식과 Library 방식의 차이  (0) 2004.11.09
Registering Assemblies  (0) 2004.11.09

개체가 생성되는 프로세서가 다릅니다.

 

Library 방식은 호출자의 프로세서 내에 생기지만 Server 방식은 다른 프로세스(Dllhost.exe)에서 생성되어 서비스됩니다.

 

Server 방식일 경우

참조하고 있는 개체가 혹시나 죽어버려도 호출자 프로세스에 영향을 안미쳐서 안전성에 좋지만,

다른 프로세스에 있는 개체를 원격 호출하기 때문에 느린 단점이 있습니다.

 

Library 방식일 경우

참조하고 있는 개체가 죽어버리면 속해 있는 프로세스도 같이 죽을 수도 있지만,

같은 프로세스 내에서 생성되기 때문에 속도가 빠릅니다.

 

하지만, .NET 런타임은 안전한 환경(AppDomain을 통한 격리 환경, 예외 처리)을 제공하기 때문에 .NET을 기반으로 하는 MS 제품을 살펴보면 전에 Server 방식으로 제작되었던 부분도 Library방식으로 제작되는 것을 볼 수 있습니다.

GAC에 공유 어셈블리를 등록하는 방법은 크게 세 가지가 있다는건 알았는데...

구체적으로 어떻게 하는지 궁금했었는데.. 여기 세 가지 방법이 나오네요.

쿠쿠..

 

 

To add the serviced components in your assembly to a COM+ application, you need to register that assembly with COM+. You can perform that registration in three ways:

  • Manually, using a command line utility called RegSvcs.exe.

  • Dynamically, by having the client program register your assembly automatically.

  • Programmatically, by writing code that does the registration for you using a utility class provided by .NET.

 


..more


  • commmand line에서 RegSvcs.exe utility를 사용하여서 수동적으로 등록 하는 방법
    • 수동적으로 component를 등록하기 위해서는 command line에서 RegSvcs.exe utility를 사용합니다 ( 이후에는 아마 Visual Studio .NET에서 RegSvcs를 호출할 수 있도록 합니다. 만약 하나의 DLL assembly MyAssembly.dll을 MyApp라는 COM+ application에 assembly를 추가 하고 싶을때는 RegSvcs.exe /appname:MyApp MyAssembly.dll 입니다.
    • 기본적으로 RegSvcs COM+ application에 구성된 것을 override하지 않습니다. 만약 assembly 버전이 이미 등록된 COM+ application이 있다면 RegSvcs는 아무 일도 하지 않을 것입니다. 만약 버전이 아직 등록되어 있지 않다면, 새로운 버전을 추가 하고 새로운 CLSID를 할당 할 것입니다.
  • client program에서 COM+ application을 사용하여서 자동적으로 등록 하는 방법
  • .NET에서 제공하는 등록 utility 클래스를 사용하여 프로그램에서 등록하는 방법

..more


DNS서버로부터 조회를 해서 MX(Mail Exchange) record를 얻어와야 하는데...

첨부 파일은 출처에 있는 파일이고...

 

아래 소스는 실제 사용예 입니다.

 

  DnsLib.DnsLite dns = new DnsLite();
  ArrayList dnsServer = new ArrayList();
  dnsServer.Add("164.124.101.2");               // 데이콤 DNS 서버 주소입니다.

  dns.setDnsServers(dnsServer);
  ArrayList ar = dns.getMXRecords("daum.net");  //얻어오고자 하는 메일 주소

  IEnumerator ie = ar.GetEnumerator();

  while(ie.MoveNext())
   Console.Out.WriteLine(((MXRecord)ie.Current));

  Console.ReadLine();

 

 

출처 : http://www.dotnet247.com/247reference/a.aspx?u=http://www.csharphelp.com/archives/files/archive43/DnsLite.cs

'programming > c#' 카테고리의 다른 글

COM+에 assembly를 등록하는데는 3가지 방법  (0) 2004.11.09
[펌] 바이트자르기  (0) 2004.10.01
[펌] Threading in C# and .NET  (0) 2004.10.01

추적 플래그 3502를 사용하여 SQL Server를 시작하면, Checkpoint가 실행될 때마다 정보를 SQL Server의 에러 로그에 기록한다.

 

출처 : Inside SQL Server 번역판 [p156]

'programming > MSSQL' 카테고리의 다른 글

Essential SQL Server 2005 For Developers #1  (0) 2004.12.20
DTC 오류 해결 방법  (0) 2004.08.31
DTC 통신에 문제가 있을때 Check List  (0) 2004.08.31
>>>문자열 String형을 charcter 단위가 아닌 byte단위로 제어할수있나요?
>>>1바이트나 2바이트문자가 섞여있는 문자열을 제어하고 싶은데...
>>>String 의 메소드에는 character의 크기만가지고 하는것 같더라구요.
>>
>>String str = "우리나라 korea";
>>byte[] byteArray = str.getBytes();
>>위의 방식을 원하시나요 ?
>
>
>위에서처럼 하면 byteArray 를  1바이트 다뉘로 제어가 가능한지요.
>저는 한글전각2바이트문자를 1바이트단위로 제어를 하고 싶어서 그러거든요.
>예를 들어
>
>String str = "ABCD가나다라";
>
>에서 "ABCD"는 1바이트문자(총 4바이트) "가나다라"는 2바이트문자(총 8바이트)라면
>전체문자열의 총 바이트수라던가 처음부터 n번째 바이트까지 문자열을 짤라맨다던가 하는걸 할 수도 있나요?

// 이정도면 답이 될수 있을까요 ?
String str = "우리나라 Corea";
byte[] byteArray = str.getBytes();
System.out.println(byteArray.length);
byteArray[9] = (byte)'K';
System.out.println(new String(byteArray, "KSC5601"));
byte[] nation = new byte[10];
for(int i=9; i<=13; i++)
{
  nation[i-9] = (byte)byteArray[i];
}
System.out.println(new String(nation, "KSC5601"));

Threading in C# and .NET

Welcome to Multithreading programming section of C# Corner. In this section, you will find various multithreading related source code samples, articles, tutorials, and tips. If you have some cool code, article, white paper, or tips related to Windows Forms and want to share with other peer developers, send it to webmaster@c-sharpcorner.com.
Source Code
Multithreaded XML Document for Read/Write Access by John Bailo. July 21, 2004.
This article describes a process for using a ThreadPool within a windows service that monitors other services. It also shows how to allow multithreaded read/write access to an XmlDocument, that acts as persistent storage, using a Mutex.
Performing Lengthy Operations on a Single Thread in .NET Applications by Wiktor Zvchla. July 08, 2004.
In this article I discuss how the lenghty operations can be handled in a .NET application. I also discuss how the stack trace can be examined to find any specific methods.
Interlocking Threads by Mahesh Chand. Sep 10, 2003.
Sharing variables among multiple concurrent threads may lead to data inconsistency. To overcome data inconsistency, we usually apply locking mechanism on the shared variables. However, locking may not be the best way in some cases.
Changing the default limit of 25 threads of ThreadPool class  by Yash Malge. Jun 19, 2003.
The thread pool is created the first time you create an instance of the ThreadPool class. 
Use Thread Local Storage to Pass Thread Specific Data by Doug Doedens.  Mar 18, 2003.
In an ideal world developers typically create instance variables and access these via interfaces to hold thread specific data.
ChessyOnline Version 1.0  by Samesh Ahmad.  Dec 31, 2002.
The attached project is a chess game that can be played by two users online as well as on the network. 
Synchronized Threading in .NET by Ahmad Al-Kayali. Dec 11, 2002.
Threads are a powerful abstraction for allowing parallelized operations: graphical updates can happen while another thread thread is performing computations, two threads can handle two simultaneous network requests from a single process, and the list goes on. Since threads are pretty simple to understand, conceptually, but, practically, they are a cause for programmatic headaches, I decided to write this program to describe how to make use of threads. 
Using the ThreadPool to Run Animated Gifs by Mike Gold. Nov 14, 2002.
In this article we will discuss the use of the ThreadPool class in conjunction with the ImageAnimator class to run 3 animated gifs in separate threads. 
Sorting using Multithreading by Indika M. W. Nov 13, 2002.
This is simple multithreading application that sort integers values in an array. 
Client Server Multuthreaded Application  by Indika M. W. Nov 08, 2002.
This is simple Client/Server (multi-threading) program that transfers data. Server can handle multiple clients. 
Consumer/Producer Multithreaded Application by Indika M. W. Nov 04, 2002.
This is consumer/producer multi-threading program written in C#. 
Drawing Shapes Using Threading by Indika M.W . Oct 25, 2002.
This is simple multi-threading program that draws circles and rectangles. 
Recipe to Implement Threads Quick n' Easy in C# by Erlend Larson. Aug 28, 2002.
In this tutorial type article, author shows how to write threading applications quick and easy in C#.
Loading XML Document in a TreeView Control by Manisha Mehta. Apr 29, 2002.
There are many occasions when programmers need to develop multithreading applications, which can load big files in the background and let the user do data entry or other jobs without any interruption. In this article, I'll show you how to create multiple threads to load multiple files.  
Multi-threading Web Applications: Part II - Port Scanner by Tin Lam. Mar 12, 2002.
In this article, I will demonstrate how you can apply the same technique to a web based port scanner.
Multi-threading Web Applications: Part I - Search Engine by Tin Lam. Mar 07, 2002.
Multi-threading is the ability for an application to perform more than one execution simultaneously. 
Messaging between threads using Message Looping by John Schofield. Aug 22, 2001.
MessageLoopLib is a stripped down version of a complete, threading communication subsystem I?ve written. 
Synchronization of Parallel Threads  by Paul Abraham. Jul 02, 2001.
The Threads makes us  able to run multitasks at a time. In fact  Computers (John von Neumann Architecture) don't  execute  the tasks parallel. The OS gives threads permission (depend on thread priority) to work on CPU. The sufficient degree of parallelism keeps the CPU busy  and it is efficient.
Synchronization in Multithreading by Hari Shanker. Feb 13, 2001.
This article with sample code shows synchronization concepts of multithreading ..
Making UI more responsive by using Threading by Hari Shanker. Feb 12, 2001.
See how threads can help us to make User interface more responsive when we have some background jobs.
Articles and Tutorials
Multithreading Part 4: The ThreadPool, Timer Class and Asynchronous Programming Discussed by Manish Mehta. Apr 16, 2002
If you were following my first three parts of this series, you probably are familiar with basics of threading
Multithreading Part 3: Thread Synchronization by Manish Mehta. Apr 11, 2002
Gradually, as you start picking up the threads of multi-threading, you would feel the need to manage shared
Multithreading Part 2: Understanding the Thread Class by Manish Mehta. Apr 08, 2002
In this article we will study the .NET threading API, how to create threads in C#, start and stop them
Multithreading Part 1: Multitasking and Multithreading by Manish Mehta. Apr 08, 2002
Gradually, as you start picking up the threads of multi-threading, you would feel the need to manage shared

'programming > c#' 카테고리의 다른 글

[펌] 바이트자르기  (0) 2004.10.01
[펌]Obtaining the HTML from a URL  (0) 2004.09.14
[펌]Using Application Configuration Files in .NET  (0) 2004.09.03

한빛 미디어에 나온 기사 스크랩입니다.

 


..more


'programming > c#' 카테고리의 다른 글

[펌] Threading in C# and .NET  (0) 2004.10.01
[펌]Using Application Configuration Files in .NET  (0) 2004.09.03
.Net API Class의 Mock Object 만들기...  (0) 2004.09.03

디자인 패턴을 공부 하는 방법에 대한 내용이 나온 사이트입니다.

 

김창준씨의 공부론이라는 글에 나온 사이트인데...

최근에 디자인 패턴 스터디를 했는데... 미리 살펴봤으면 더 좋았을텐데 하는 아쉬움이 남네요..

 

http://www.industriallogic.com/papers/learning.html

 

configuration File은 예전에 ini파일이나 레지스트리에 저장했던 정보들을 저장하는 파일이다.

자세한 내용은 아래의 기사를 확인~

 

 


..more


음...

요즘 회사에서 진행 중인 프로젝트를 XP를 도입하여 진행 중이다.

 

그래서 페어 프로그래밍이라던가 TDD를 하게 되는데, TDD를 하던 중 문제가 발생했다.

ADO.Net 프로그래밍이나 Socket을 사용하는 부분에서 그 Class들에 대한 Mock을 만들지 못하는 문제이다.

 

이러한 문제를 해결할 수 있는 방법을 아시는 분은 연락 주심 매우 고맙겠습니다. ^^''

관련 내용을 찾아다니던 중 나와 같은 문제로 고민하는 사람의 Post를 발견해서 밑에 올립니다.

 

--------

.NET Needs Better Interfaces
In this post, Frans Bouma continues his list of things he wants added to the VS.NET IDE and the .NET API.

My biggest complaint about the .NET API is that I don't think MS used interfaces enough. (And they seal classes that they shouldn't, but Frans already convered that one.) If you have tried to do TDD with Maverick.NET, for example, you very quicly run into a problem with HttpContext and the other HTTP Pipeline classes. Because there are no interfaces to be found, you can't mock them at all.

A similar problem exists in ADO.NET. Once again you can't do TDD very well with it. The root cause is that you can't really write code that is independent of your data provider. It is very close, but when you really get in there you will find that you can't create a DataAdapter without knowing whether you're doing SQL or OLEDB. (Justin wrote Abstract ADO.NET to deal with this, but he shouldn't have had to.)

Another example: Sockets. I was trading email with someone last week and he was asking me how to create a mock Socket. In Java, Socket is an interface, so MockSocket has something to derive from. In .NET, Socket is a class. It is very difficult to mock without creating your own ISocket interface and then creating a lightweight wrapper that aggregates the .NET Socket class. Very annoying.

posted on Wednesday, June 25, 2003 2:49 PM

 

출처 : http://www.peterprovost.org/archive/2003/06/25/576.aspx

MS 문서를 첨부합니다. 클릭하시면 바로 확인가능합니다.

 

기존에 보지 못했던 내용들도 있어서 퍼 왔습니다.

--------------------------------------------------

 

1. 양쪽서버 모두에서 MSDTC서비스가 시작되었는지 확인.
'NET START MSDTC'

2. 서버이름으로 서로간에 정상적으로 ping이 되는지 확인 하십시요.

3. 명령창에서 cliconfg를 실행 protocol을 named pipe대신 Tcp/ip를 default로 설정.

5. 둘 중 어느 서버에서든 NIC 를 두개 이상 가진 경우 이것들이 정상적으로 설정 되었는지 확인.

6. 만약 하나의 NIC에 두개 이상의 IP가 할당된 경우 (특히 web server) 하나의 IP만 할당하여 Test .

7. 서버간의 name resolution 방식을 확인 (DNS, WINS or lmhost)
   - 만약 서로 서버를 찾지 못하는 경우 hosts or lmhost file을 수정하여 연결.

위에서 확인된 사항이 모두 확인된 경우에도 동일 error가 발생하면 다음과 같은 일반적인 DTC TroubleShooting을 시도.

1. Transaction timeout을 길게 잡아준다.(즉, 600초 또는 0)
MTS탐색기또는 구성요소서비스관리자에서 내컴퓨터를 우측마우스로 선택후 등록정보의 옵션탭에서 설정한다.

2. MSDTC버전을 확인한다.(윈도우2000은 문제없음, NT4는 SQL 6.5 SP5a이상 또는 SQL7일경우 문제없음

4. Firewall 관련
MSDTC는 RPC를 통해 작동되기 때문에 Firewall을 사이에 두고 MTS/COM+서비스와 SQL 서버가 있을 경우 다음과 같이 하여 RPC가 원활하게 작동하도록 설정한다.
(특히 Internet환경에서)
Regedt32.exe를 실행한다.(시작->실행->regedt32)
다음키와 값을 추가합니다.(Double Quotation은 제외한다.)
HKLM\Software\Microsoft\Rpc\Internet
Ports "3000-3010" REG_MULTI_SZ
PortsInternetAvailable "Y" REG_SZ
UseInternetPorts "Y" REG_SZ

TCP와 UDP Port 135번과 TCP Port 3000-3010이 열려있어야 한다.

SQL DB에 Access하기 위해 반드시 TCP/IP와 Port 1433을 사용해야 한다. (물론 1433 Port는 열려있어야 한다.)

5. Router관련
NetBios Name을 DTC에 바인딩하기 위해 DNS 또는 WINS(또는 Hosts & LMHOSTS파일)를 사용해야만 한다.

이상의 사항으로도 해결이 되지 않는 경우 MSDTC 재설치 고려.

 

출처 : http://blog.korea.com/post/blogpost.aspx?bid=sqldba&mode=view&view=board&pid=9336&index=6&cate=240

'programming > MSSQL' 카테고리의 다른 글

DTC 오류 해결 방법  (0) 2004.08.31
Isolation level  (0) 2004.08.19
미리 보는 유콘 T-SQL의 새로운 기능들  (0) 2004.08.16

내용이 많으므로 관심있는 분만 누르세요~~


..more