Problem solved, after I remove the 'Root namespace' of project 'DALFactory'.
sorry.
"Chrysan" wrote:
> I have download the Enterprise Sample(Microsoft .Net Pet Shop 3.0, which
> source code is written in CSharp) from the web, and try to convert it into
> VB.Net code.
>
> I have done with the 'IDAL' and 'Model' projects, and now is working on
> 'DALFactory' project. I have add a 'IDAL' reference in the 'DALFactory'
> project. But, when I write the 'Public Shared Function Create() As
> PetShop.IDAL.IAccount'.
> I get the error msg "Type 'PetShop.IDAL.IAccount' is not defined."
>
> Why is this happen?
>
> Thanks.
>
>
> Following is my Account.vb code in project 'DALFactory'
> ----------------------------------------------------------------
> Imports System
> Imports System.Reflection
> Imports System.Configuration
>
> Namespace PetShop.DALFactory
>
> ' <summary>
> ' Factory implementaion for the Account DAL object
> ' </summary>
> Public Class Account
> Public Shared Function Create() As PetShop.IDAL.IAccount
> '/ Look up the DAL implementation we should be using
> Dim path As String =
> System.Configuration.ConfigurationSettings.AppSettings("WebDAL")
> Dim className As String = path + ".Account"
>
> ' Using the evidence given in the config file load the
> appropriate assembly and class
> ReturnCType(Assembly.Load(path).CreateInstance(className),
> PetShop.IDAL.IAccount)
> End Function
> End Class
> End Namespace
>
>
|