Click here to Skip to main content
15,889,863 members
Home / Discussions / C#
   

C#

 
QuestionConvert Object Pin
papa198023-Jan-06 2:07
papa198023-Jan-06 2:07 
AnswerRe: Convert Object Pin
User 665823-Jan-06 2:22
User 665823-Jan-06 2:22 
AnswerRe: Convert Object Pin
sathish s23-Jan-06 2:25
sathish s23-Jan-06 2:25 
GeneralRe: Convert Object Pin
papa198023-Jan-06 4:26
papa198023-Jan-06 4:26 
QuestionVisual Inheritance, and Default Property Values Pin
big_trev23-Jan-06 2:05
big_trev23-Jan-06 2:05 
AnswerRe: Visual Inheritance, and Default Property Values Pin
tarasn23-Jan-06 3:57
tarasn23-Jan-06 3:57 
GeneralRe: Visual Inheritance, and Default Property Values Pin
big_trev23-Jan-06 7:54
big_trev23-Jan-06 7:54 
QuestionHow do I retrieve all my webPages + web services in .NET framework 2.0? Pin
Ronen Tidhar23-Jan-06 2:00
Ronen Tidhar23-Jan-06 2:00 
In framework 1.1 I used to do Assembly.GetTypes() and get everything, web pages, web services, classes.
In framework 2.0 it’s not the same story. There are App_code…dll, App_Global.dll, App_web…dll.

The only thing I was able to get is the App_Code by ReflectionOnlyLoadFrom() method.

Is there a way to get everything like I did before?

10x
TD


Code :

internal void Run()
{
AppDomain curDomain = AppDomain.CurrentDomain;

curDomain.ReflectionOnlyAssemblyResolve += new ResolveEventHandler(MyReflectionOnlyResolveEventHandler);

string assemblyPath = Path.GetFullPath(assembly.Location);
m_rootAssembly = assemblyPath;

Assembly asm = Assembly.ReflectionOnlyLoadFrom(assemblyPath);

// force loading all the dependencies
Type[] types = asm.GetTypes();

// show reflection only assemblies in current appdomain
Console.WriteLine("---- Inspection Context ----");
foreach (Assembly a in curDomain.ReflectionOnlyGetAssemblies())
{
Console.WriteLine("Assembly Location: {0}", a.Location);
Console.WriteLine("Assembly Name: {0}", a.FullName);
Console.WriteLine();
}
}

private Assembly MyReflectionOnlyResolveEventHandler(object sender, ResolveEventArgs args)
{
AssemblyName name = new AssemblyName(args.Name);
String asmToCheck = Path.GetDirectoryName(m_rootAssembly) + "\\" + name.Name + ".dll";

if (File.Exists(asmToCheck))
{
return Assembly.ReflectionOnlyLoadFrom(asmToCheck);
}

return Assembly.ReflectionOnlyLoad(args.Name);
}


QuestionLCD Pin
sianatia23-Jan-06 1:41
sianatia23-Jan-06 1:41 
QuestionHow to call a function... Pin
Soundman32.223-Jan-06 1:17
Soundman32.223-Jan-06 1:17 
AnswerRe: How to call a function... Pin
AB777123-Jan-06 2:01
AB777123-Jan-06 2:01 
AnswerRe: How to call a function... Pin
Phil J Pearson23-Jan-06 2:20
Phil J Pearson23-Jan-06 2:20 
Questionsingle commands for DotMatrixPrinter Pin
softmusic23-Jan-06 0:58
softmusic23-Jan-06 0:58 
AnswerRe: single commands for DotMatrixPrinter Pin
Dave Kreskowiak23-Jan-06 6:11
mveDave Kreskowiak23-Jan-06 6:11 
GeneralRe: single commands for DotMatrixPrinter Pin
softmusic23-Jan-06 7:12
softmusic23-Jan-06 7:12 
GeneralRe: single commands for DotMatrixPrinter Pin
Dave Kreskowiak23-Jan-06 13:23
mveDave Kreskowiak23-Jan-06 13:23 
QuestionMIDI programing in c# Pin
softmusic23-Jan-06 0:52
softmusic23-Jan-06 0:52 
QuestionEditor Color Pin
peppepinna23-Jan-06 0:33
peppepinna23-Jan-06 0:33 
Questiononclick event not triggering ! Pin
nitya_arysys23-Jan-06 0:23
nitya_arysys23-Jan-06 0:23 
AnswerRe: onclick event not triggering ! Pin
Guffa23-Jan-06 1:14
Guffa23-Jan-06 1:14 
GeneralRe: onclick event not triggering ! Pin
nitya_arysys23-Jan-06 1:21
nitya_arysys23-Jan-06 1:21 
GeneralRe: onclick event not triggering ! Pin
Guffa24-Jan-06 1:21
Guffa24-Jan-06 1:21 
GeneralRe: onclick event not triggering ! Pin
nitya_arysys24-Jan-06 1:36
nitya_arysys24-Jan-06 1:36 
AnswerRe: onclick event not triggering ! Pin
Guffa24-Jan-06 9:35
Guffa24-Jan-06 9:35 
GeneralRe: onclick event not triggering ! Pin
nitya_arysys25-Jan-06 2:33
nitya_arysys25-Jan-06 2:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.