Two instances of the same .NetCF code? - TypeLoadException

C

Craig Setera

(Apologies for cross post from smartphone newsgroup)

I have an application I've built that consists of 4 .Net CF Dll's and a
single .Net executable. The application uses a single configuration
file to drive the functionality. The configuration file is located
relative to the Assembly's installation location. I would like to be
able to install multiple instances of this code that are only
distinguished by their installation location. This does not appear to
work, as a TypeLoadException is thrown when one of the instances is
running and an attempt to start another instance occurs. Is this not
possible? If it is possible, what needs to be done to make it work
correctly? Changing the executable name does not appear to be enough.
What other options do I have?

Thanks,
Craig
 
G

Guest

I think we need more info on your deployment. There's no reason this
shouldn't work.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
C

Craig Setera

What kind of information would be helpful? I'm fairly new to .Net CF
(and .Net) development, so I apologize if this is something that should
be obvious.

Thanks,
Craig
 
G

Guest

What files are getting deployed to what folders? Are there version
differences between the instances of the primary assembly or any of its
references (yours or the CF)? Are you installing anything in the GAC?


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com
 
C

Craig Setera

Chris,

Things are pretty simple. This is a .Net CF 1.0 application to target
the largest base of devices. Let's say that we are packaging up
"myapp1". If so, we build an installable cab file that does the following:

- Creates \Program Files\myapp1 folder
- Adds MIDPBridge.dll to that folder
- Adds MJXCore.dll to that folder
- Adds mojax.exe to that folder
- Adds SmartDeviceFramework14.dll (a heavily trimmed version of SDF 1.4)
to that folder.
- Adds a launch shortcut for mojax.exe
- Adds a configuration file to that folder

When the process starts up, it uses the location of the Assembly to
locate the configuration file and uses that file to drive the
application. A different installation (for instance, myapp2) would be
installed in \Program Files\myapp2 directory but all of the executable
files would be the same with the same names, etc. I am not
(intentionally) installing anything into the GAC.

Thanks,
Craig
 
C

Craig Setera

OK. I'm an idiot. I'm still finding my way around this stuff.

Your question prompted me to realize that I should set a breakpoint on
TypeException to see what was going on. It turns out that one of my
classes is attempting to share a file on the file system and dying when
that doesn't work since the first instance is holding the lock.
Completely in my code, which at least makes it relatively easy to fix.

I have a couple of other questions that have come up, but I will put
them into separate threads with valid subjects.

Thanks so much for your help. Sorry to bother with such a idiotic
mistake on my part.

Thanks,
Craig
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top