Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running a .Net program

Status
Not open for further replies.

seanbo

Programmer
Jun 6, 2003
407
GB
The prog i've been working on for some time now is nearing completion. i'm trying to write a procedure for running it on verious machines. first of all, windows 98. i've installed the .NET runtime (NETCFSetup.msi), and copied everything from the debug folder on the dev machine.

the first time i tried to run it it needed MSCOREE.dll, so i found it and stuck it in the program directory. i don't know what this dll does. then i tried to run it and i got the following error:

'.Net Framework Initialization Error'
'set registry key to HKLM\Software\Microsoft\.NetFramework\InstallRoot to .Net Framework install drectory'

there isn't a key like that in the registry though. there isn't a .NetFramwork within HKLM\Software\Microsft


what do i need to do to make the program run?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Sounds like the framework didn't install correctly.

I'd check it's prerequisites, and then reinstall it.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
He Seanbo,

It looks to me you have got the wrong .Net Framework. I think the file you used (NETCFSetup.msi) is the Compact Framework (for PDA devices). I used a file named dotnetfx.exe to install the .Net Framework 1.1 Redistributable (I hope this helps.
 
looks like you're right, mr hell. i got it through a confusing third party website because microsoft were being soft and micro.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
okay, this is the progress so far. i've installed the framework from dotnetfx on two machines - an win98, and a win xp. even though the program runs fine on my dev machine, i get an unhandled exception error on both of the test machines. i've not checked the numbers, but i assume they're the same error. the details of the error, taken from the win98 machine, are as follows:

Application has generated and exception that could not be handled
Process id=0xfff94fcd (-438323), Thread id=0xfffda159(-155303).

what should my next step towards getting it running be?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Assuming it's something your code is doing: add a try..catch block to the Main method and log the error. That way you can see what happened, instead of getting the &quot;unhandled exception&quot; error.

If it's in the startup part of your code (trying to resolve references, etc) it'll be more work -- you'll have to identify what's missing by gradually removing references until it starts working.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
first some help:

1) i don't know what type of exception to catch
2) how can it be in my code if it works on the dev machines?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
1) i don't know what type of exception to catch

Doesn't matter -- just catch a System.Exception. Since all other exception types derive from this type, you're guaranteed to catch them all.

2) how can it be in my code if it works on the dev machines?

It could be environmental (directory missing, registry value missing, security setting). You won't know until you have more info, which is why you need to catch all possible exceptions and log them.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
aah, didn't think of that. come to think of it, it's probably because the user directory is in a different place (the loading and saving is still a bit half arsed). hurrah, a plan of action. i've got to meet some nerds from microsoft tomorrow, but wednesday is the day i get this thing working. cheers chip.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Having a &quot;Catch 'em all&quot; block in your Main method is probably good practice. If your code does end up there, it'll give you the opportunity to display a friendly message box for the user instead of the nasty &quot;unhandled exception&quot; one.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
i have added the following code. at the start of main...

try{

...at the end of main...

}catch(System.Exception ex){
MessageBox.Show(ex.Message);
}

I am still getting the 'Application has generated and exception that could not be handled' error. Why is this? Notice that is says 'could not be handled', not 'wasn't handled'.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
OK, this indicates that it's not anything in the code you've written -- it's configuration or environmental.

I would first make sure the framework installed properly, then I'd check permissions -- using tools like the mscorcfg.msc, and making sure the userid it's running under has access to the parts of the machine that it needs (registry access, read/write to the file system, etc).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
well i agree, but i have some news that you may find interesting. i made a very basic program (just a window) and tried to run that on one of the dotnetfx machine - it ran fine. there is obvously something in my code that is causing the problem, but i don't understand why it works fine on the dev machines, won't run on the dotnetfx machines, and can't be handled.

all my program does on startup is create an mdi container with a few menu bars. i'm going to start adding things to the basic program, to see if i can work out what trips up.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
- i found the code that was causing the problem. It's a peice of third party software from a company called CodeJocks. unfortunatly, i've settled on using it now - so i had better find a way to get it sorted.

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
How are you calling it? Via a reference, or via System.Activator?

If it's a reference, I suspect the .NET loader is trying to resolve all the references before passing control to your code.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
I am calling it as a reference. I am not sure what you mean by resolve. What is the framwork trying to do? How can i stop it?

____________________________________________________
If you like a post, show you care by giving it a <censored>.
 
Resolve means to take the reference (stored in the assembly's manifest) and make sure that the other assembly can be loaded. And then resolve all that assembly's references, and so on in a recursive fashion until the loader has located and loaded all the assemblies which are early-bound.

You could stop it, but it's a case of being more work than it would possibly be worth (much like writing your own GINA dll to authenticate users in Windows NT/2k/XP/03).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top