Failure when using ILASM to compile IL to EXE

5.1k views Asked by At

I've spent hours trying to figure out what is wrong. I know the program is functional, as I tested by debugging the .il in MonoDevelop, however I can't compile through that. This is the log from the command prompt:

http://pastebin.com/NYWAbrUV

Any help appreciated.

3

There are 3 answers

1
Jb Evain On BEST ANSWER

Failed to write output file, error code=0x80070005

0x80070005 is an access denied error. You either don't have the rights to create a file into the directory, or you're trying to overwrite a file which is opened somewhere else.

0
stringbox On

I kept getting this trying to compile an example from a book. What eventually worked for me was specifying the full path to the output parameter.

ilasm c:\folder\codefile.il /output=c:\folder\outfile.exe
0
anion On

Just for everyone else who has this problem due to the usage of a key-file for signing:

The file which can not be accessed due to 0x80070005 does not have to be the .il-file. Like described in this answer I had to give permissions of my user to C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys.