ASP.NET/VB.NET with login control, debug works, publish doesn't


I created a simple ASP.NET project, using VB.NET, with a Default.aspx and a login.aspx page. The Default.aspx page just has a simple text box. And the login.aspx page just has a login control. I used the visual studio "asp.net configuration" tool to set up a user and a password. I can run my web page just fine in "debug" mode - the login.aspx page opens fine and after I enter my user name and password, I get directed to my default.aspx page correctly.

When I publish my web-site, first of all I have to close visual studio and re-open it, or it says that another application is using my ASPNETDB.mdf file. After I publish the web site (I publish to http://Kangaroo/test_login - Kangaroo is my computer name and I am using IIS) and I enter my user name and password, I get the error "Your login attempt was not successful. Please try again." I am publishing to the same computer that I am debugging on. Also, if I don't have the login.aspx page in my project, publishing my web site works fine (so I know it is not a publishing problem).

 Any ideas?

0
jkub
10/2/2007 6:05:26 PM
asp.net.config-deploy 12495 articles. 0 followers. Follow

5 Replies
719 Views

Similar Articles

[PageSpeed] 38

did you make sure to specify an applicationname on the membership provider?

If you don't it'll use a different application name on your published site that it will on your local site and the information won't cross over

0
PureWeen
10/2/2007 7:15:40 PM

Thanks for the quick response. I think that I actually just figured this out myself. I did specify a membership provider and I am still developing and deploying on the same machine - so that wasn't the problem. What I actually needed to do was go to C:\Inetpub\wwwroot, right click on my web-site folder (which I called test_login), select the "security" tab, and set "users" to have read and write permissions.

 I'm not sure whether or not this is a good thing to do, from a security point of view, but it does work now. Is there a better way to fix my problem than assiging all "users" to have read/write permission on the web site?

0
jkub
10/2/2007 8:29:33 PM

Yea I figure you had a MembershipProvider I'm just curious if you set the property ApplicationName in that provider....unless of course you're using a custom provider

 As far as the permissions i'm not too sure

it seems strange that it needs write permissions for that to work....Are you using the SQLMembership or a customMembership?

do you have the authentication mode set to forms?

IS the directory propertly configured as an application with scripts access in IIS?
Or are you just using the temporary web server it creates for you?

Just some random guesses :)

 

0
PureWeen
10/3/2007 8:14:53 PM

jkub:
What I actually needed to do was go to C:\Inetpub\wwwroot, right click on my web-site folder (which I called test_login), select the "security" tab, and set "users" to have read and write permissions.
 

Hi jkub,

When you debug with ASP.NET Development Server, the process account which access resource is your Windows Logon account, mostly it is local administrator. However, after publishing the project to IIS and view page through IIS, the process account is ASPNET (IIS 5.x) or NETWORK SERVICE (IIS 6.0) which has restricted permission. This may cause the issue.

Actually “user” is a group that contains several accounts. You can check which accounts it includes by Computer Management tool:

    1. Open Computer Management tool from: Start | Control Panel | Administrative Tools | Computer Management
    2. Expand “Local Users and Groups” node, and then click “Groups” node.
    3. Double click “Users” group, then you can know which members in this group.

Instead of grant to permission to “users” group, you should grant permission to ASPNET or NETWORK SERVICE user.

Since you can grant permission to physical folder to resolve the issue, the above information is enough. If someone also encounter error message of login SQL Server failed, he must check the SQL Server login list to confirm if ASPNET or NETWORK SERVICE has already been added and granted “dbcreator” role (for attaching database). In addition, the account needs read and write permission for the attached database.

About how to create SQL Server login account, please refer to the following link:

How to: Create a SQL Server Login
http://msdn2.microsoft.com/en-us/library/aa337562.aspx

 


Sincerely,
Benson Yu
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
0
Benson
10/4/2007 7:54:23 AM

Thanks! I changed my permissions for my web-site in C:\Inetpub\wwwroot\TM_Website (TM_website is my website) to grant permission to the ASPNET user and removed the "Users" group and this works great. Also, previously, I meant to say that I specified an applicationName, so this part was ok.

0
jkub
10/5/2007 3:24:30 PM
Reply:

Similar Artilces:

.NET Remoting
Hi,I'm trying to write Remote server object , when I write:using System.Runtime.Remoting.Channel.TcpIt looks like this namespace doesn't exist and I can't use instances of objects in this name space as I used in .NET 1.1When I look at the documentation, it looks like there is no change in the syntex or methodology.Can some one please help me.all the best,el System.Runtime.Remoting.Channels.Tcp...

[PATCH lib/Net/Config.pm, MANIFEST, t/lib/Mock/Socket.pm, lib/Net/Config.t] Add Tests for Net::Config
Here's a test suite for Net::Config. In the process of writing this, I've fixed an apparent bug that prevented single values from becoming array references when necessary. I think it's right, but perhaps Graham should weigh in on this. In the process, with some advice from perl-qa, I've added a mock object so the test could control the output of Socket::inet_ntoa() and Socket::inet_aton(). t/lib/Mock/ seemed like as good a place as any. I'm happy to rework this patch if it personally offends anyone whose opinion matters. :) -- c --- lib/Net/~Config.pm S...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

What can c#.net do that vb.net can't?
That's pretty much my question - what can you do with c#, in terms of web application building, that you can't do in vb.net? Thanks Which language you choose is pretty much up you, your preferences and previous experience. There are some differences, but most importantly one have to realize that all .Net compliant languages are translated into an Intermediate Language and at the end of the day, what run is pretty much the same. Read this if you need to know more: "Microsoft Programming Languages" http://msdn.microsoft.com/vstudio/productinfo/whitepapers/default.aspx ...

vb.net Directory.Exists doesn't work
Hi everybody, I have a problem that might look stupid,  but I really don't know why its not working. I've got a web service written in vb.net and the web service is sitting on one server doing manipulation on another server. What I'm trying to do is to check if a directory exists on the server before I copy a file there. For some reason it doesn't work, it always returns false. When I tried doing exactly the same thing in c# it worked fine.  Am I doing something wrong?  What if do is:  If Directory.Exists(\\DomputerName\c$\Test\) Tehn I've tr...

System.web.UI doesn't work in VB.Net Form?
 Hi, I downloaded a little example recently and tried converting it to VB.Net.  Surprisingly I found that while my VB Web projects and CSharp Windows Form projects work with System.web.UI, VB Windows Forms don't seem to. Is there any way I can use System.web.UI features with a windows form? This is the code I'm trying to convert to VB:   using System.IO;using System.Web.UI.WebControls;using System.Web.UI;// render the DataGrid control to a fileusing(StreamWriter sw = new StreamWriter(textBox1.Text)){ using(HtmlTextWriter hw = new HtmlTextWriter(sw)) { g...

Type.GetType does not work in VB.NET but works in C#. VB.NET gurus Please help
Friends,   I am an experienced C# programmer who is working on a VB.NET project now. I am writing different methods covering the following functionalities 1) Take a datareader as input and return an arraylist of class object2) Take an xmlnode (received from a webservice) as input and return an arraylist of class object. The methods are generic methods which take datareader/xmlnode as first parameter and classname (string) as the second parameter. This way it will work trivially. The schema of class object matches with the input (datareader or xmlnode)In C# I used to do th...

Upgrading vb.net 2003 to vb.net 2008 the name '__o' is not declared
Hi I had an application in vb.net 2003. I chose to upgrade it to vb.net 2008. Now I have 153 errors telling me that the name '__o' is not declared. In one page where I get this error, It's on a <tr> statement. I searched in google and I saw that we could put <%=""%> at the beginning of the page, but I still have the error message. Any idea? Hi myriam_giroux,I think you need to be more specific information. When you are receiving errors during compilation in Visual Studio or Visual Web Developer, the Error list window will indicate the line in the sour...

Directory.Delete(path, true); doesn't work (.net 1.1) and admin can't delete
Hello all.  I have a web application that creates a user temp directory, copies files into that directory, manipulates those files, sends files to the user, and then calls Directory.Delete(path, true); to delete the temp directory and all of its contents.  The problem is that this doesn't work and the directory is still there after the method call and code execution is complete.  I also can't delete the directory manually even when logged in as an Administrator.  It says 'Cannot delete <path>: Access is denied.'.  I was under the impression that specifying 'tru...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

.NET Menu Control
Unfortunately for the .NET developers who have struggled with this problem for quite some time, there hasn't been a solution unless I'm missing something. The ASP.net Menu Control simply cannot support the "onclick" command instead of the "onmouseover" command. I have had some success with the method that Roshadar has posted in the past, but unfortunately, the Menu_HoverDynamic functionality still reverts to only the Hover state and not when clicked. My questions are these: Has anyone found a way to allow "onclick" capabilities on the Menu? If not, ...

WDP for VS2008 still doesn't allow web.config file section replacement of 'System.Net'
There were a series of posts on various blogs about the VS 2005 version of the WDP not allowing replacement of the 'System.Net' section. This was a rather significant oversight, in my opinion, as the three parts of web.config you would most likely want to replace would be appSettings for site specific attributes, connectionStrings for the proper database configuration, and System.Net to set up site-generated email. That being said, there was talk in the forums about fixing for the next release. Indeed, in the release notes for WDP for 2008 there was mention of fixes for config file u...

cpan>install NET::SSH ----> Can't install NET::SSH don't know what it is?
Good day! This is the first time I'll be using the cpan to install modules. I run: perl -MCPAN -e shell and answer the questions one by one. When its done, I issued install NET::SSH at the cpan> prompt and I got the message: Can't install NET::SSH Don't know what it is. Question: How will I make cpan> know what NET::SSH is? Is there something I have to update first? How can I search for some useful modules using cpan> rather than using cpan search in www.cpan.org? What is auto bundle? And what does 'cpan -a' does? When I ran it, I can some...

Error in using a VB.NET .exe file on a computer that hasn't studio net installed
I've create an VB.Net Console Application and i'm trying to make the exe run on another computer that has, let's say windows 98. i've installed on this computer the net framework but it doesn't seem to be enough. what do i have to install also? i've used the following references in my application (if it has anything to do with this): Imports System.IO Imports Excel = Microsoft.Office.Interop.Excel I've also copied on the test computer Microsoft.Office.Interop.Excel.dll in the same folder as the exe file. It doesn't give so many error, but one: Object reference not set to an inst...

Net:Net:Net::LDAP::FAQ
------_=_NextPart_001_01C6429F.D89AA417 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, Net::LDAP Net::LDAPS Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, ....) password? I don't like to write the secret password to the perl file. Best regards Barbara Wilbert ------_=_NextPart_001_01C6429F.D89AA417-- Wilbert Barbara (CI/OSI) * wrote: > Hello, > > Net::LDAP > Net::LDAPS > > Is there a possible to LDAP bind with an encrypted (SHA, SSHA, CRYPT, > ......

Web resources about - ASP.NET/VB.NET with login control, debug works, publish doesn't - asp.net.config-deploy

Resources last updated: 2/2/2016 10:21:09 PM