Right now, I have an API and a website running in the same application. And I'd like to split it to 2 applications so, API alone and web alone. In the post request I use this for login:
if (WebSecurity.Login(model.UserName, model.Password,persistCookieInfo))
How can I do something similar then I do not have a Web.config file. I will like to do it without a Web.config file if that possible.
Or can I specify the connectionString
somewhere else?
I have tried:
WebSecurity.InitializeDatabaseConnection("Data Source=.\SQLEXPRESS;Initial Catalog=****;Persist Security Info=True;Integrated Security=true"
, "UserProfile", "UserId", "UserName", autoCreateTables: false);
Tried with DefaultConnection don't know how to specify a default connection. The error I get is:
System.IO.FileNotFoundException
HResult=0x80070002
Message=Could not load file or assembly 'System.Web.ApplicationServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
User contributions licensed under CC BY-SA 3.0