简体   繁体   中英

HOW to deploy C# application with GAC and NGEN

I have small C# tool, compiled as Windows Application which goal is to wrap execution of other tools. This tool will be executed frequently, sometimes a 100 times a second and this is what I cannot change; same as this will work with Framework 2. Most important for this tool will be short warm startup.

Using Visual Studio 2013 I signed my assembly with strong name key. Compiled "Release" and got "EXE" file. Next I ran ngen /install app.exe

And this is all I could understand from a million posts here and out there. Now I need to move this app.exe to my 12 servers and I have no idea if I should just ngen install on each machine, or should also copy my DEV windows/assembly folder structure to server windows/assembly (of course my application parts only).

I did ngen install on one server, but I don't see assembly created, so need help for more advanced heads.

Thanks Pawel.

UPDATE: I checked again and I found assembly in x64. So is it really enough to run ngen only?

RECAP: I copied exe to server did ngen install, checked that assembly is created. I run machine to launch exe 500 items - they all finished in 1 minute 24 seconds (from mutex log). I repeated test and got exactly the same result: 1.24 Next I did ngen uninstall and checked that assembly is deleted, it was. I run the same test and result was 1.26 (lol). Considering fact that it is stable and execution time is fully satisfactory for me I think I will give it up and stop researching to use GAC/NGEN. But any comments to this scenario and my original question are appreciated.

You should deploy all the assemblies your application needs to function to the new machine. Then you can NGEN if you want. An installer like WiX can do both for you. See here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM