|
-
Oct 15th, 2002, 09:22 PM
#1
Thread Starter
Addicted Member
HTTP 405 - Resource not allowed
Hi,
I created ASP.Net project using VB.Net (code behind), with the SQL2000 database. It works fine at my computer. To test an application, I added a WebSetup project and created setup project for this application. After installing it at the same (development) computer, it worked OK.
But when this project was installed at the clients PC, it didn’t work. The very first (login.aspx) page displayed correctly, next the user entered username & password and opens TestLogin.aspx page. The IIS gave such error: “HTTP 405 - Resource not allowed
“.
The application should write some data into a database at the first page (Login.aspx) and the second one (TestLogin.aspx). In spite the Login.aspx was loaded correctly and tried to open the second page, none of the data was written into a database.
I found at MSOFT Knowledge Base one article: “INFO: Permissions to Connect to a Remote Access Database from ASP.NET”
http://support.microsoft.com/default...;en-us;Q307901
which seems to describe my problem. The only one difference: it related to MS Access database (I am using MS SQL2000 database and this database was properly attached to the clients SQL server.). My connection string as follows: "server=MYServer;database=KNASP;uid=sa;pwd=".
This article contains some topics related to the Microsoft Jet database engine, so I am not sure how to configure my database.
If someone has an idea, I would greatly appreciate your help.
-
Oct 17th, 2002, 06:27 PM
#2
Hyperactive Member
When you say you installed it on the clients pc what do you mean? A client pc just needs to open the web page. Have you installed asp.net on the client pc. Does it have access to the sql server (can it see it on the network?) or is it connecting to sql server on it's own machine?
With a little more info we might get to the bottom of it.
-
Oct 18th, 2002, 05:02 AM
#3
Thread Starter
Addicted Member
The client PC in this case is the computer which hosts IIS where the ASP application will be running. (At my computer I only developed and tested the application). So I used Web Setup project to install it. The clients computer has a Visual Studio Net installed at it. It also has MS SQL server 2000 installed at the same computer (and has an access to another SQL server via network). So after an installation of the ASP application, it wasn’t allowed to write into the database. (I almost sure that it was the case: if it would be only querying using SELECT statement, it should be OK).
Next: I tried to copy the ASP project to the clients computer, and to run it from the VSudio IDE. Basically the error message was the same: ‘You have no permissions to execute …”, although I set in IIS for this virtual folder execute permissions: scripts and executables, set in Directory security section for Anonymous access foe ASPNet user, with the blank password, set ASP Net account for the physical folders wwwroot and the application physical folder as the ‘full’ permissions and tried different combinations of the settings.
Now I am wondering: the database physical files (.mdf and .ldf) do not located at the wwwroot/MyApplication subfolders, they are in the ‘C:\Program Files\Microsoft SQL Server\MSSQL\Data’ folder. So it may be necessary to set permissions for the ASPNet user to the ‘Data’ folder?
I found info about ASP.Net security at: the Visual Studio . Net documentation.
ms-help://MS.VSCC/MS.MSDNVS/dwamish7/html/vtconSecurity_DU.htm
This link plus heaps of related topics, so I will try to find solution there.
Best regards
-
Oct 20th, 2002, 01:58 PM
#4
Hyperactive Member
You dont give access to the database files directly. You possibly need to give aspnet user access to sql server if you are using windows authentication (default on installation) in sql server.
-
Oct 21st, 2002, 05:46 AM
#5
Thread Starter
Addicted Member
The problem was caused when trying to write to the database ( originally I used SQL server authentication ).
When I commented that part of a code at the Page_Load() event everything became OK.
Eventually I set the authentication at SQL server to the Windows authentication, used connection string as:
"Integrated Security=SSPI;Initial Catalog=MYDatabaseName", set the Permissions at the Security tag of the physical database folder to the MyComputerName/ASPNET account, added login account and user account: MyComputerName /ASPNET to the database, at the IIS for the project properties under the DirectorySecurity tag, put the MyComputerName /ASPNET account, selected anonymous access and the Windows authentication, added the line:
<identity impersonate="true" />
to the Web.config file.
Now it works.
Thanks for your suggestions, Musician.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|