Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding users from a different asemblyAdding users from a different asembly
Previous
 
Next
New Post
11/4/2007 12:59 PM
 

Hello Everybody.

I need to have an external application create users on my dotnetnuke site. In order to do so, I've decided to create a seperate DLL class.

In this DLL class I'm referencing the DotNetNuke.Security.Membership.AspnetMembershipProvider class, and I'm trying to use its public methods to manipulate memebers tables in the database.

However, It seems I am unable to initialize an object of the AspnetMembershipProvider class. When I try to run the following line of code:

DotNetNuke.Security.Membership.MembershipProvider memProvider = DotNetNuke.Security.Membership.MembershipProvider.Instance();

I get the following Exception


 

System.TypeInitializationException was unhandled
  Message="The type initializer for 'DotNetNuke.Security.Membership.MembershipProvider' threw an exception."
  Source="DotNetNuke"
  TypeName="DotNetNuke.Security.Membership.MembershipProvider"
  StackTrace:
       at DotNetNuke.Security.Membership.MembershipProvider.Instance()
       at Funtactix.Dnn.dnnMediator.MediatorUser.CreateUser(String email, String password, String firstName, String lastName, String charName, String country, String city, String passwordQuestion, String passwordAnswer) in D:\DotNetNuke\dnnMediator\dnnMediator\MediatorUser.cs:line 30
       at ConsoleApplication1.Program.Main(String[] args) in D:\DotNetNuke\dnnMediator\ConsoleApplication1\Program.cs:line 12
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

 


Inner Exception:

 

{"Object reference not set to an instance of an object."}

Stack Trace:

"   at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, String ObjectProviderName, String ObjectNamespace, String ObjectAssemblyName, Boolean UseCache)\r\n   at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType, Boolean UseCache)\r\n   at DotNetNuke.Framework.Reflection.CreateObject(String ObjectProviderType)\r\n   at DotNetNuke.Security.Membership.MembershipProvider.CreateProvider()\r\n   at DotNetNuke.Security.Membership.MembershipProvider..cctor()"

 


 

 

Anyone has an idea what am I doing wrong? Is there a way to initialize a dotnetnuke membershipprovider outside a dotnetnuke site?

Thanks in advance for everyone who helps.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Adding users from a different asemblyAdding users from a different asembly


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out