borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Disable And Enable Win Key)Next Topic (DataBinding) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : CreateInstance and converting to VB.Net
Poster Message
Zath
Level: Trainee

Registered: 05-10-2006
Posts: 2

icon CreateInstance and converting to VB.Net

In this multi-tiered project,  in one of the layers I create an instance to a class.

Using VB and VS.Net 2005

It is returning Nothing!!!


Public Shared Function Create() As myProject.IDAL.IAccessRequest

'look up the DAL implementation to use

Dim path As String = System.Configuration.ConfigurationManager.AppSettings("WebDAL")

Dim className As String = path + ".AccessRequest"

'create class instance

Return CType(Assembly.Load(path).CreateInstance(className), myProject.IDAL.IAccessRequest)

End Function


The line in C# that has no problems is this:

//create class instance

return ( myProject.IDAL.IAccessRequest ) Assembly.Load ( path ).CreateInstance( className );

So, I am thinking that it was converted wrong.

Suggestions?

Thanks all,

Zath
    

05-10-2006 at 12:48 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
Zath
Level: Trainee

Registered: 05-10-2006
Posts: 2
icon Re: CreateInstance and converting to VB.Net

Ok, I found the problem.

It's a VS.Net 2005 issue/change

In 2003, I usually put my class libraries in the project folder itself, in the wwwroot/projectName folder.

This made it easier when using VSS.
But, in 2005, you can't exclude from project these new folders which show up in the web project.

So, I did a test class and put it in the default mydocs/vsprojects folder, copied and pasted the classes, added new references and it worked!!!!

Zath

05-10-2006 at 03:29 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : VB.Net : CreateInstance and converting to VB.Net
Previous Topic (Disable And Enable Win Key)Next Topic (DataBinding) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder