views:

138

answers:

2

I have a website in Sharepoint 2007. I use control adapters, specifically an adapter for the menu and the login control. These two adapters resides in a signed assembly that it is deployed to the bin folder of the website. The browser

<browser refID="Default">
     <controlAdapters>
      <adapter controlType="System.Web.UI.WebControls.Menu"
       adapterType="NameofEnterprise.SecondName.Adapters.MenuAdapter" />
      <adapter controlType="System.Web.UI.WebControls.Login"
      adapterType="NameofEnterprise.SecondName.Adapters.LoginAdapter" />
     </controlAdapters>
    </browser>

From time to time I get the following exception, just from time to time, let's say once or twice a day:

Unable to create type 'NameofEnterprise.SecondName.Adapters.MenuAdapter'.

Things to take in mind: this happens in the machine I develop, I don't know if there are temporary files that can get the framework crazy. Second, I don't know if the framework perhaps is looking for the class of the Adapter in another assembly, as I have some assemblies that have the same namespaces as this one, that is to say: NameofEnterprise.SecondName.BusinessLayer,NameofEnterprise.SecondName.DataLayer....

Plz could you tell me what can be the problem? Can I be more specific to tell the framework the name of the assembly (in the browser you only write the name of the class and namespace)?

SOLUTION

Finally i have used the 2 advices you have given me. I think that with the first thing is enough, that is to say:

<system.web>
    <compilation>
      <assemblies>
        <add assembly="*<Your assembly name here>*"/>
    </assemblies>
    </compilation>
</system.web>

But i have included two the assembly and public token in the browser:

<browser refID="Default">
    <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.Menu"
             adapterType="NameofEnterprise.SecondName.Adapters.MenuAdapter", YourAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=YourPublicKeyToken"/>
    </controlAdapters>
+2  A: 

You should modify your web.config, adding your assembly to the list of assemblies:

<system.web>
    <compilation>
      <assemblies>
        <add assembly="*<Your assembly name here>*"/>
    </assemblies>
    </compilation>
</system.web>

Add the assembly that contains your controls, and the error should disappear. For future reference, Temp internet files has almost nothing to do with Asp.net errors. Though you can clear them if it makes you feel better.

Matt Lynch
Thanks a lot.I didn't refer to temp internet files, i referred to Framework temporary files, located in: \WINDOWS\Microsoft.NET\Framework\v...\Temporary ASP.NET Files.
netadictos
+1  A: 

It's also useful to use the full qualified name when you add the reference to your assembly:

<browser refID="Default">
    <controlAdapters>
            <adapter controlType="System.Web.UI.WebControls.Menu"
             adapterType="NameofEnterprise.SecondName.Adapters.MenuAdapter", YourAssemblyName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=YourPublicKeyToken"/>
    </controlAdapters>

wroks