[Mono-dev] ObjectDataSourceView/Type problem

Robert Jordan robertj at gmx.net
Thu Jul 27 10:40:38 EDT 2006


Hey,

>   I am having a problem with the TypeName property of ObjectDataSource it is been used bound to a DropDownList and works fine under MS.NET, but when I try to run under Mono I get the folowing error:
>    
>   System.InvalidOperationException: Type not found: EnderecoHelper
>   at System.Web.UI.WebControls.ObjectDataSourceView.get_ObjectType () [0x00000] 
>    

[..]

>    
>   EnderecoHelper is a class that was used in App_Code in MS.NET in order to make it work in Mono I compiled it and now I have a EnderecoHelper.dll file in bin directory.
>    
>   Looking at the source of ObjectDataSourceView at ObjectType property, where the error occurs, we see this:
>    
>   Type ObjectType {
>       get {
>           if (objectType == null) {
>               objectType = Type.GetType (TypeName);
>               if (objectType == null)
>                   throw new InvalidOperationException ("Type not found: "  + TypeName);
>           }
>       return objectType;
>       }
>   }
>    
>    
>   which means that Type.GetType(EnderecoHelper) ir returning null, but that wasn't supposed to heppen. Any ideas why this is happening? Am I doing something wrong or this is a bug?

You have to specify the partial type name, which is:

"<namespace>.EnderecoHelper, <assemblyName>"

<assemblyName> is the file name of the assembly w/out the path and w/out
the ".dll" extension. <namespace> is the namespace of EnderecoHelper,
if it has one.

Robert




More information about the Mono-devel-list mailing list