Visual Studio Development Bookmark and Share   
 index > Visual C# Express Edition > ngen with visual c# express?
 

ngen with visual c# express?

Is it possible to use ngen.exe with visual c# express?  The examples of ngen that i've seen target a published app's .exe file but c# doesn't seem to publish .exe files.
darckeen  Monday, October 05, 2009 7:52 PM
That's ClickOnce deployment by the looks of it.  Yeah, I seriously doubt that's going to support ngen.  The only other option you have with Express is doing it by hand.  You'll need a license to the retail edition to get a real Setup project.

Hans Passant.
nobugz  Monday, October 05, 2009 9:00 PM
ClickOnce won't work with ngen.  If you want to do this with the express edition, you'll need to use a custom installer to ngen your application on the user's system.

Instead of using a VC Setup project, you can just create your application, and use something like WiX , which does support ngen .

Reed Copsey, Jr. - http://reedcopsey.com
Reed Copsey, Jr.  Monday, October 05, 2009 9:17 PM
Visual C# Express will create an EXE file if your project is an application.  If it's a class library, it will create a .DLL file.

Once you have the EXE, you can run it through ngen, the same as if you used Visual Studio Pro or Team Editions.



Reed Copsey, Jr. - http://reedcopsey.com
Reed Copsey, Jr.  Monday, October 05, 2009 8:18 PM
I'm pretty sure that ngen.exe will take a .dll.  What goes wrong when you try?

Hans Passant.
nobugz  Monday, October 05, 2009 8:24 PM

Well the app i'm working with is a console application and when i publish it the following files are created:

c:\deploy\MyApp

autorun.inf
MyApp.application
setup.exe
Application Files\

i guess it also installs an actual .exe in some obsifucated directory like:

c:\Users\Darc\AppData\Local\Apps\2.0\LJ5YYHBP.HV6\YOM1YQGY.4HV\MyApp_0340996763ae8018_0001.0000_08cbdf7b3a8bd3d8

it this the file i can run ngen.exe on?  and if so is there anyway to have setup install the actual .exe to a more accessable directory?

darckeen  Monday, October 05, 2009 8:46 PM
That's ClickOnce deployment by the looks of it.  Yeah, I seriously doubt that's going to support ngen.  The only other option you have with Express is doing it by hand.  You'll need a license to the retail edition to get a real Setup project.

Hans Passant.
nobugz  Monday, October 05, 2009 9:00 PM
ClickOnce won't work with ngen.  If you want to do this with the express edition, you'll need to use a custom installer to ngen your application on the user's system.

Instead of using a VC Setup project, you can just create your application, and use something like WiX , which does support ngen .

Reed Copsey, Jr. - http://reedcopsey.com
Reed Copsey, Jr.  Monday, October 05, 2009 9:17 PM

I think i got yah, basically ngen isn't usable with express because the only publish option in express is one-click.  You can work around by using a 3rd party application building program like wix, correct?  Took a look at wix and it seems kinda intimidating to install.  Mabey the best solution is to install VS 10 pro beta and use that for the mean time.

darckeen  Tuesday, October 06, 2009 3:54 AM
Well I installed VS pro beta 10 and when i publish i get the same one click publishing as with express 2008.  I'm obviously not dev and i really don't know much about the VS IDE but how can i run ngen on c# code or app generated from c# code as easilly as possible? 
darckeen  Tuesday, October 06, 2009 6:11 AM
Don't use Publish.  You'll need to add a Setup project to your solution.  Not sure if the beta has this feature enabled.  Beware that you can't get support in a forum when you use early beta versions of a product.  The beta1 of VS2010 is not that great and pretty instable in some places.  These betas also notoriously screw up your machine because they don't have a good uninstaller yet.

Hans Passant.
nobugz  Tuesday, October 06, 2009 12:04 PM

You can use google to search for other answers

Custom Search

More Threads

• Beginner can't begin!
• Check 1st 10 characters
• EventArgs Error in Window Forms project
• System.ObjectDisposedException crashes the application
• Serial Port weirdness
• Passing Variables to Shell command
• no updation on backend
• WPF Browser Application With DB Connection
• Avoid Looping DataTable
• How to limit decimal places after a double?