I'm trying to use NGen to see if native images of my application run better than the .NET ones. However, I'm having a little bit of trouble figuring out what to do.
My application is called MyApp.exe and it has several dependency DLLs.
I opened up the VS 2010 Command Prompt and ran:
ngen install MyApp.exe /Profile
The command output did not suggest any issues had been encountered.
I then went to C:\Windows\assembly to try and run the EXE but I couldn't find it there (I'm on Windows 7). A little bit of digging told me to use the command prompt to browse into C:\Windows\assembly\NativeImages_v4.0.30319_32. I was eventually ably to locate my MyApp.ni.exe there but of course couldn't open the containing folder in explorer.
I tried to run the program and it told me:
"C:\Windows\assembly\NativeImages_v4.0.30319_32...\MyApp.ni.exe is not a valid Win32 application."
The command output said Access is denied.
I had two questions:
- How can I run this program so that I can execute the native version.
- How would I go about profiling it? Looks like I won't be able to locate that folder from within the VS2010 profiler because it cannot be seen in explorer.
Thanks.