function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tom.ax53Tom.ax53 

random dll error

Hi,

After a couple of days with this error I am kinda desperate. This is what I'm trying to do:

I created a dll in visual basic .net which uses the sforce API 5.0. (The goal is to use this (COM) dll in PHP scripts)

My dll works fine on my windows xp professional machine. When I try the dll on our webserver (windows 2003) I get the following error when I call a method that uses the API:

Warning (null)(): Invoke() failed: Exception occurred. Source mscorlib Description File or assembly name mn3h4itd.dll, or one of its dependencies, was not found

The name of the dll in the error message is different every time the script is loaded. If I don't use the API in my dll it works fine on Windows Server 2003 too, so it is definitely an sforce API related issue.

At first I also had this problem on my XP machine too, but after giving the internet guest account user rights to the windows\temp folder it was fixed. There's a lot of websites mentioning that giving rights to the temp folder is the solution for this problem, but this does not help on windows server 2003.

Any ideas?

Thanks in advance.

Tom Asselman

DevAngelDevAngel

Hi Tom,

What web server are you running on the 2003 machine?

SuperfellSuperfell
The temp directory that's used on 2003 is different to on 2000, i can't remember which on e it is (i think its \windows\temp) the easiest way to tell is to either turn on file auditing or use a tool like the sys internals filemon to see where ASP.NET is trying to write the temporary assembly to.
Tom.ax53Tom.ax53

Hi,

We are using IIS 6.

Thanks in advance

Tom.ax53Tom.ax53
We've been doing a lot of monitoring already. The temp folder on 2003 is winnt\temp
DevAngelDevAngel

Hi Tom,

Well, sorry it took so long to get back.  I have never used php, but, I installed PHP 5 on my windows 2003 server, compiled a .net com object to do a login and describe, then called the following code in a php file:

<?php

/* TODO: Add code here */

$obj = new COM("ComDLL.MainClass");

$val = $obj->HelloWorld();

echo ($val);

$val2 = $obj->LoginResults();

echo ("<BR><BR>");

echo ($val2);

echo ("<BR><BR>Describe Global<BR>");

$val3 = $obj->Describe();

echo ($val3);

?>

 

The HelloWorld just echos hello world, the LoginResuls returns a session id and the Describe returns the describe global results.

 

No errors. ??????

Tom.ax53Tom.ax53

Hi Dave,

First of all thank you for your help !

We are running PHP 4.3.4 on our server but I also gave it a try in PHP5, but i get the same error. This is the error I get:

System.IO.FileNotFoundException: File or assembly name eaed0w5w.dll, or one of its dependencies, was not found.
File name: "eaed0w5w.dll"
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
   at System.Xml.Serialization.Compiler.Compile()
   at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
   at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
   at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
   at SalesForceTester.SforceService..ctor()
   at SalesForceTester.sforceuser.returnstring()

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\WINNT\TEMP\eaed0w5w.dll
LOG: Appbase = C:\PHP5\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINNT/TEMP/eaed0w5w.dll.

In detail; I created my COM as follows:

  • Generated a proxy class using wsdl.exe
  • Added that class to my VB.Net project
  • Compiled a DLL
  • If you want to use .Net DLL's as COM objects, you have to use regasm en gacutil (that is really the way as far as I know) to make it look like a COM DLL, so I did:
  • regasm /tlb:\COM\SalesForceTester.tlb D:\COM\SalesForceTester.dll
  • gacutil /I D:\COM\SalesForceTester.dll

This works fine on my XP Pro machine and a Windows 2000 Server. When I install it on our live 2003 server, I get the error message about the temporary dll. This seems like a know issue when you google for it and in most cases giving your IUSR rights on the winnt\temp folder should do it. Not in my case...

I get the error as soon as my I call a method in my COM DLL which initiates an SforceService. In other words, as soon as the SforceService constructor is called I get the error. I am really getting desperate ...

Maybe you can send me your VB.net project and give me some detail on how you registered it as COM etc. I'll then do exactly the same on our environment and hope that it will work overhere too.

Thanks in advance !

DevAngelDevAngel

Hi Tom,

You don't have to do all the gacutil stuff (at least not for initial testing purposes). 

In the properties of your vb project, you need to simply set a Configuration Property in the Build section.  This is a checkbox to Register for COM Interop.

I basically followed the same steps as you, with the exception of the regasm and gacutil.  One big difference, I developed the dll on the same machine as I tested it on.  I mention this as Visual Studio may be doing the regasm and gacutil for me.  I doubt the gacutil is required though.  I do few enough actual deployments that the gac is pretty much still wizardry for me.

Attached is the project (c#) that I used to test.  Rename the extension from zp to zip once downloaded.

Cheers

Tom.ax53Tom.ax53

Dave,

Thank you so much for your project source code. But I have the same problem with it. The DLL works great on my XP machine, once I try it on our 2003 server I get the same "File or assembly name w4gdseyl.dll, or one of its dependencies, was not found" error.

Tom

SuperfellSuperfell
The Account running PHP (which might be IUSR_XXX or IWAM_XXX or NetworkService or something else, depending on whether your running PHP in proc, or as a CGI) needs access write to that directory.
Tom.ax53Tom.ax53

Hi Simon

The accounts you are mentioning , all have write access to that directory (C:\winnt\temp), I even went so far I gave everyone full control (for testing ofcourse), but still I keep getting that error on 2003.

Tom

SuperfellSuperfell
You'll need to either turn on auditing, or use something like the SysInternals filemon tool to find out exactly what's going on.
Tom.ax53Tom.ax53

For everyone interested in this dll issue. I ended up logging a case at microsoft. After a week of investigation by the support tech the problem was fixed giving the internet guest account rights to cvtres.exe, cvtres.exe.config, csc.exe and csc.exe.config in the .net framework folder.

Tom

DevAngelDevAngel

Tom,

Thanks for the update!