Hi
I have run into a problem using ZeroDeployment.
I short, IEExec loads a VB application, which uses a DLL
written in C++. VB calls into managed C++ code. The
managed C++ code calls into unmanaged C++ code. So far, no
problem. But when the unmanaged C++ code does a
CreateThread, the error System.DllNotFoundExecption is
thrown.
Creating our own 'Application loader' can load the VB
application and everything works.
Using calls like:
da = [Assembly].LoadFrom(URL)
dt = da.GetType(ClassName)
sc = Activator.CreateInstance(dt)
sc.Show()
Note, while testing, the VB application have been fully
trusted.
A search on the net gave little result, though I did find
a communication which seemed to be in the vicinity of my
problem (Actually I think it is the same):
-- Extract start --
The bug is inside of the .Net Framework (CLR). IIS6 is
doing its part
correctly, VC++ is compiling and pulling in CLR correctly,
but CLR is
bugging out about the name of the DLL that IIS6 gave it.
The bug can be
independently reproduced outside of IIS, so it's a CLR bug.
Unfortunately, the IIS team is having a hard time
convincing the CLR team to
fix/resolve this issue, but we're working on it. If you
can help us make a
case on the importance of using managed extensions
directly in ISAPI, please
do. :-)
-- Extract end --
Is it a bug?
Isn't is supposed to work (unmanaged code ZeroDeployed)?
Is it something that could find its way to the
KnowledgeBase?
(It isn't Superman!)
Regards
Tommy
Roger Tan [MSFT] - 05 Dec 2003 22:50 GMT
Hi Tommy, I'm currently looking into your issue, and am wondering if I
could get some more information specific to your set up. I had written up a
repro case similar to yours (C# app calling a managed C++ function in a
DLL, which calls an unmanaged C++ function (which calls CreateThread)
residing in the same DLL), but no exceptions occur. These two files (the C#
exe and C++ DLL) are sitting on an intranet server, and everything seems to
run fine with IEExec.
To try to make a more accurate repro, could you tell me:
- Which version of the CLR you are using
- More details on the setup, namely, is the managed and unmanaged C++
portions in the same file?
- You had granted FullTrust to the VB application, but did you grant
FullTrust to the C++ DLL?
Tommy R. Larsen - 08 Dec 2003 10:00 GMT
Hi Roger
Thanks for looking at it.
I have properly been too impatient, but Friday (5-Dec) I
reported it by phone to Microsoft Scandinavia and got a
SRQ number.
So it is being looked at. With the SRQ I send the code for
an example that will reproduce the problem.
Sorry for the inconvenience.
For the benefit of the community, I will post the outcome
here.
/Tommy
Just to answer you questions:
Regarding security, I have only trusted the executable.
Tried trusting the DLL, but that didn't change the outcome
of the test. As i trusted the DLL, it asked me if I wanted
to trust all assemblies with the given strong name. It
might, as part of earlier tests, have trusted this strong
name key.
Software in use:
On the 'server' PC, there is W2K-SP4 v5.00.2195, and IIS
v?
On the 'client' PC (my development PC) I got CLR
v1.0.3705 & v1.1.4322, Visual Studio Enterprise Developer
2003 (and VS C++ v6)
The managed C++ and unmanaged C++ is linked into the same
DLL.
PS.
A few tests this morning:
Using a client PC with only W2K-SP4 and
CLR 1.1.4322 produced another error.
The none thread creating unmanaged code
still work, but the thread creating unmanaged code now
fails with:
MsgBox header: IEExec - Common Language
Runtime debugging Services
body: Process id=xxxx, Thread
id=yyy.
No JIT debugger available.
Tommy R. Larsen - 16 Dec 2003 09:54 GMT
Hi
A promised, a follow-up
Microsoft have looked at the problem and will do further
investigation.
Meanwhile a work-around exists.
Compile using the /clr:InitialAppDomain switch.
This will restrict CLR usage to v1.0 functionality and may
even pose other restrictions/implications, but for now it
seems to work for us.
/Tommy