views:

58

answers:

1

Guys I created a console application in Visual Studio 2010. It targets the .NET framework 2.0. When I run the application is Visual Studio, it works perfect. I then exited Visual Studio and copied the executable to my C:\Windows\System32 directory. When I open a command prompt window and try to execute my program, it comes up with a standard Windows message box with an error that says "Unable to find a version of the runtime to run this application". I know I got the .NET framework installed.

I then copied the executable to my C:\Users\Public directory and tried to execute it from there and it worked fine. So I am assuming this is some kind of security issue or something? What do I need to do make the application work from C:\windows\system32 directory?

I am using Windows 7 64-bit, by the way. The application was compiled to target .NET 2.0 framework and 32-bit machines.

+1  A: 

I think on a 64-bit machine you'll have to put it into c:\Windows\SysWOW64, which contains all the 32-bit stuff retained for compatability (everything in system32 should be x64).

Jay
Well it works when I move it into SysWOW64, but there is no path to it, so I can't run it unless I change into that directory. Is there a global place I can put it where I can execute it from any directory? I know I can modify my PATH system variable, but I don't want to have to do that for like 50 computers lol
icemanind
Hmmm… well, that's a job for Powershell. Anyway, you'd only have to do it on the computers that have x64 architectures.
Jay
That's true...That won't be bad..Thank you
icemanind