Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
  1. I've created a custom .ashx file called it SyncExcelToList.ashx.
  2. The assembly is GACed and does show up fine in C:\windows\assembly
  3. The ashx file does show up in the proper place within the 12 hive
  4. I'm using WSPBuilder

Is there a web.config entry that needs to be made that allows for this ashx file?

File Not Found.   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.UI.SimpleWebHandlerParser.ProcessDirective(String directiveName, IDictionary directive)
   at System.Web.UI.SimpleWebHandlerParser.ParseString(String text)
   at System.Web.UI.SimpleWebHandlerParser.ParseReader()

UPDATE: I have not solved issue yet. I've added manual entries to both SafeControls and node in the web.config. No help.

I've also troubleshot with the Fusion Assembly Binding Log Viewer. It seems like it's loading okay. here is the output i see:

*** Assembly Binder Log Entry  (1/11/2011 @ 11:40:09 AM) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = ******
LOG: DisplayName = ****.GlobalContent.Sync, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc1cbc87d9829012
 (Fully-specified)
LOG: Appbase = file:///E:/Websites/wss/VirtualDirectories/27307/
LOG: Initial PrivatePath = E:\Websites\wss\VirtualDirectories\27307\bin
LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\b12ddeed
LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\b12ddeed
LOG: AppName = d649a281
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: E:\Websites\wss\VirtualDirectories\27307\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework\v2.0.50727\Aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: ****.GlobalContent.Sync, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc1cbc87d9829012
LOG: Found assembly by looking in the GAC.
LOG: Binding succeeds. Returns assembly from C:\Windows\assembly\GAC_32\****.GlobalContent.Sync\1.0.0.0__bc1cbc87d9829012\****.GlobalContent.Sync.dll.
LOG: Assembly is loaded in default load context.

I created a blog post, so hopefully my troubleshooting steps can help someone else out there trying to debug this issue:

http://shanejordan.com/index.php/2011/01/debugging-the-infamous-file-not-found-in-sharepoint-2007/

share|improve this question
    
Silly things out the way first: did you get the fully qualified name of the assembly correct at the top of the ashx file? –  James Love Jan 10 '11 at 17:20
    
yes, i ensured that they matched up: <%@ Assembly Name="<companyname>.GlobalContent.Sync, Version=1.0.0.0, Culture=neutral, PublicKeyToken=bc1cbc87d9829012" %> –  Shane Jan 10 '11 at 17:23
add comment

1 Answer

up vote 0 down vote accepted

If your web application is running under IIS 6 or 7 "Classic" mode, then you need to add a web.config entry like the following:

<system.web>
   <httpHandlers>
      <add verb="*" path="*.vfs" type="[companyname].GlobalContent.Sync.[additional_namespace],[companyname].GlobalContent.Sync,Version=1.0.0.0,Culture=neutral,PublicKeyToken=bc1cbc87d9829012"/>
   </httpHandlers>
</system.web>

Or, under IIS >= 7.0 "Integrated" mode, you need a similar entry in the following location:

<system.webServer>
   <handlers>
      <add name="SyncExcelToListHandler" verb="*" path="*.vfs" type="[companyname].GlobalContent.Sync.[additional_namespace],[companyname].GlobalContent.Sync,Version=1.0.0.0,Culture=neutral,PublicKeyToken=bc1cbc87d9829012"/>
   </handlers>
</system.webServer>
share|improve this answer
    
Running IIS7. And not using this as a handler in that sense, the ashx is page just to post to. It works fine in SharePoint 2010, just trying to port to 2007. I've also modified the web.config to add the entry in both <assemblies> and <SafeControls> and still no change. :( –  Shane Jan 11 '11 at 13:49
    
Since you're getting a "File not found" exception, is it possible that you are missing a dependency? Maybe something that was present on the SharePoint 2010 environment is missing in the 2007 environment? You might check the version numbers of all of the assemblies referenced by yours, and make sure they are present (e.g. Microsoft.SharePoint 12.0.0.0, and correct versions of .NET framework dll's). –  jason.venema Jan 11 '11 at 16:46
    
good point. let me review that. It's always the simple things you know –  Shane Jan 11 '11 at 16:50
    
That fixed it. Always the simplest, dumbest things. I was going way to far down the rabbit hole. Changed <%@ Assembly Name="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> To <%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> –  Shane Jan 11 '11 at 17:15
    
Thanks @Jason. I created a blog post to maybe help anyone else in the future that is debugging this exception. shanejordan.com/index.php/2011/01/… –  Shane Jan 11 '11 at 21:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.