This post originated from an RSS feed registered with .NET Buzz
by Steve Hebert.
Original Post: System.IO.FileNotFoundException - running a webservice on Win 2k3
Feed Title: Steve Hebert's Development Blog
Feed URL: /error.htm?aspxerrorpath=/blogs/steve.hebert/rss.aspx
Feed Description: .Steve's .Blog - Including .Net, SQL Server, .Math and everything in between
Here's a bizarre problem I ran into today that I thought could use some google-juice.
I am getting the following error when I try to run a new webservice I have placed on any one of 4 windows 2003 servers. (Running under ASP.NET 1.1)
To minimize the problem, I created a simple webservice called "TestApp" that exposes [ public int Add( int x, int y ) ] as the lone method on the service. I create a simple installer package for the msi and run it on the server.
When I go to http://.../TestApp/Service1.asmx, the generated page and test page appear fine. When I run the test page, supplying values for x and y and upon pressing the submit button, I receive the error message listed below. Each time I execute this, the name of the dll changes. The names of the dlls seem pretty random, none of them turn up on a Windows Live or Google search. The text of this message is completely unformatted - no headers like the sample methods normally show on errors.
The problem appears to be security related - when the application pool user is given admin rights the problem goes away. Based on the call stack, I'm guessing the CLR JITter is running into problems with the provided assembly. (?)
System.IO.FileNotFoundException: File or assembly name kciklf5_.dll, or one of its dependencies, was not found. File name: "kciklf5_.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.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos) at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos) at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos) at System.Web.Services.Protocols.HttpServerType..ctor(Type type) at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
=== Pre-bind state information === LOG: Where-ref bind. Location = C:\WINNT\TEMP\kciklf5_.dll LOG: Appbase = file:///C:/Inetpub/wwwroot/TestApp LOG: Initial PrivatePath = bin 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/kciklf5_.dll.