Re: Prevent DLL usage
- From: "Cesar" <nospam@xxxxxx>
- Date: Wed, 8 Apr 2009 10:09:21 -0300
Use the sample below to use at beginning of every method of your DAL
classes:
public void test()
{
StackTrace st = new StackTrace(true);
if (st.GetFrame(1).GetMethod().ReflectedType.ToString() !=
"BLLLibrary.BLLClass")
{
throw new Exception("Can't call this method by this
assembly");
}
}
"Chris Zopers" <test123test12@xxxxxxxxx> wrote in message
news:uEnhVPEuJHA.4068@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
I have two .NET dll's, one containing business logic and the other
containing data access logic.
The Business Logic DLL references the Data Access DLL.
Only the Business Logic DLL is allowed to use/reference the Data Access
DLL. No other .net assemblies may use the Data Access DLL. Is it
possible to prevent this DLL from being used by other calling assemblies
and how can this be done?
Greetings,
Chris
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: Prevent DLL usage
- From: Jesse Houwing
- Re: Prevent DLL usage
- References:
- Prevent DLL usage
- From: Chris Zopers
- Prevent DLL usage
- Prev by Date: Re: creating a simple web browser
- Next by Date: Re: concatenation issue w \0 char
- Previous by thread: Prevent DLL usage
- Next by thread: Re: Prevent DLL usage
- Index(es):
Relevant Pages
|