Click here to Skip to main content
15,879,535 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak7-Mar-14 9:18
mveDave Kreskowiak7-Mar-14 9:18 
GeneralRe: Pre-load libraries Pin
alejx8-Mar-14 2:53
alejx8-Mar-14 2:53 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak8-Mar-14 3:21
mveDave Kreskowiak8-Mar-14 3:21 
GeneralRe: Pre-load libraries Pin
alejx8-Mar-14 4:27
alejx8-Mar-14 4:27 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak8-Mar-14 5:01
mveDave Kreskowiak8-Mar-14 5:01 
GeneralRe: Pre-load libraries Pin
alejx8-Mar-14 6:32
alejx8-Mar-14 6:32 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak8-Mar-14 7:32
mveDave Kreskowiak8-Mar-14 7:32 
GeneralRe: Pre-load libraries Pin
alejx8-Mar-14 9:27
alejx8-Mar-14 9:27 
I read that using NGEN depend on target machine , and we should use the NGEN on every machine ???
This is what I have found :

"The idea behind NGen is that when your application is installed on the target machine, the JIT is triggered to compile our entire set of managed assemblies, and generate a native image for the application. Afterwards, when the application is launched, the CLR will make sure to load the correct native image from the disk, and so avoid unnecessary jitting
The problem with NGen is that it's quite complicated to use, and if we are really looking to avoid performance penalties during our application&'s initialization, we will have to spend more of our valuable time in order to register our assemblies in the GAC, correctly set our DLL's base addresses in order to avoid rebasing, etc"

it's correct or I read the wrong article ?
And as alternative to the previous code , I have found another code that load all the assemblies , but again I don't know how to use it :

// recursively load all of assemblies referenced by the given assembly
public static void ForceLoadAll(Assembly assembly)
{
    ForceLoadAll(assembly, new HashSet());
}


private static void ForceLoadAll(Assembly assembly,
                                 HashSet loadedAssmblies)
{
    bool alreadyLoaded = !loadedAssmblies.Add(assembly);
    if (alreadyLoaded)
        return;


    AssemblyName[] refrencedAssemblies =
        assembly.GetReferencedAssemblies();


    foreach (AssemblyName curAssemblyName in refrencedAssemblies)
    {
        Assembly nextAssembly = Assembly.Load(curAssemblyName);
        if (nextAssembly.GlobalAssemblyCache)
            continue;


        ForceLoadAll(nextAssembly, loadedAssmblies);
    }
}



Thank you !
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak8-Mar-14 10:39
mveDave Kreskowiak8-Mar-14 10:39 
GeneralRe: Pre-load libraries Pin
alejx8-Mar-14 11:01
alejx8-Mar-14 11:01 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak8-Mar-14 11:31
mveDave Kreskowiak8-Mar-14 11:31 
GeneralRe: Pre-load libraries Pin
alejx9-Mar-14 5:42
alejx9-Mar-14 5:42 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak9-Mar-14 6:57
mveDave Kreskowiak9-Mar-14 6:57 
GeneralRe: Pre-load libraries Pin
alejx9-Mar-14 7:49
alejx9-Mar-14 7:49 
GeneralRe: Pre-load libraries Pin
Dave Kreskowiak9-Mar-14 7:55
mveDave Kreskowiak9-Mar-14 7:55 
AnswerRe: Pre-load libraries Pin
Richard Andrew x647-Mar-14 15:31
professionalRichard Andrew x647-Mar-14 15:31 
QuestionIs this possible? Pin
hansoctantan6-Mar-14 0:29
professionalhansoctantan6-Mar-14 0:29 
AnswerRe: Is this possible? Pin
Wayne Gaylard6-Mar-14 0:49
professionalWayne Gaylard6-Mar-14 0:49 
GeneralRe: Is this possible? Pin
hansoctantan9-Mar-14 19:57
professionalhansoctantan9-Mar-14 19:57 
GeneralRe: Is this possible? Pin
Wayne Gaylard9-Mar-14 20:01
professionalWayne Gaylard9-Mar-14 20:01 
AnswerRe: Is this possible? Pin
Eddy Vluggen6-Mar-14 2:59
professionalEddy Vluggen6-Mar-14 2:59 
QuestionVB.NET Visual Studio 2113: Windows Explorer right click-> print Pin
dgoogle6-Mar-14 0:14
dgoogle6-Mar-14 0:14 
AnswerRe: VB.NET Visual Studio 2113: Windows Explorer right click-> print Pin
Richard Deeming6-Mar-14 1:56
mveRichard Deeming6-Mar-14 1:56 
QuestionHelp with uploading picture using visual basic Pin
Surajit Das5-Mar-14 11:38
Surajit Das5-Mar-14 11:38 
AnswerRe: Help with uploading picture using visual basic Pin
Peter Leow5-Mar-14 13:18
professionalPeter Leow5-Mar-14 13:18 

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.