By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,352 Members | 1,593 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,352 IT Pros & Developers. It's quick & easy.

ASP.NET Website Project

P: n/a
Dear all,

When i create a website using Visual Studio 2005 i have an option to
choose based on the local file system or the http:// address;
For the local file system, when i later run my web site, the asp.net
development server starts and it assigns a random port to the web
server while for the second option by choosing a http:// address for
the web site project, no random ports will be assigned.

More convenient for me is let people access my website without the
random port, but my problem is:
Even though i specify the same connection string for both projects, i
can't view if i created the project with http:// file system! i always
get this sql exception: select permission denied on object ........ for
that particular view!
It seems that if the asp.net development server was not started and did
not assign a random port, then i have no permissions!
My assumption then, is that by an addrsss with default port 80, a
different computer account is assigned; i guess NT AUTHORITY\NETWORK
SERVICE, else it would be DOMAIN\ASPNET computer user!

I just simply have no clue how to make my site have no assigned random
ports such as http://localhost:3046/MyProj/Default.aspx, but at the
same time that i would have enough permission to access my DB.

I appreciate your response

Best regards

Apr 24 '06 #1
Share this Question
Share on Google+
13 Replies


P: n/a
I have uploaded two pictures to illustrate what i meant:
Picture #1 => http://www.abuabdou.com/file.gif
Picture #2 => http://www.abuabdou.com/http.gif

Apr 24 '06 #2

P: n/a
On 23 Apr 2006 18:18:15 -0700, coosa wrote:
I just simply have no clue how to make my site have no assigned random
ports such as http://localhost:3046/MyProj/Default.aspx, but at the
same time that i would have enough permission to access my DB.


This has nothing to do with random ports. When you do an HTTP site, then
your code is running under IIS. If you do a filesystem project, then it's
running under the Development server (Cassini). The development web server
runs as the account you are logged in with, while IIS runs as the OS
defined user (under XP, this would be (LOCALHOST)\ASPNET for asp.net code).

If your connection string is using integrated authentication, then you need
to give whatever account you are using access to your database. If you're
using a username/password then you have to give that user access.

Since you mention domains. What's probably happening here is that your SQL
server is on a seperate machine, and you're giving your own domain user
account permission. This works in Cassini, but fails with IIS because IIS
uses a local machine account by default.
Apr 24 '06 #3

P: n/a
"If your connection string is using integrated authentication, then you
need
to give whatever account you are using access to your database" ...
My Connection string includes: "Integrated Security=True"; Besides, my
ASPNET account in the database is already assigned enough permission to
perform all possible operation i require for my application.

Apr 24 '06 #4

P: n/a
re:
I just simply have no clue how to make my site have no assigned random
ports such as http://localhost:3046/MyProj/Default.aspx

To specify the Web server for an already-created Web site,
open your local website with VS.NET and, in the Solution Explorer,
right-click the name of the Web site for which you want
to specify a Web server, and then click Property Pages.

In the Property Pages dialog box, click the Start Options tab.
Under Server, click "Use custom server".

In the Base URL box, type the URL that Visual Web Developer
should start when running the current Web site.

You can use localhost, your machine name, or an assigned domain name for your IP.

From that point on, the VS.NET IDE will not use the internal web server,
but will use IIS to open your pages, i.e., if you are working on default.aspx,
using localhost, it will be opened as : http://localhost/default.aspx and, if you are
working in the myapp directory, it will be opened as http://localhost/myapp/default.aspx .

If you also want to run an application directory as if it was the home directory,
follow the instructions given by Scott Guthrie in this blog :

http://weblogs.asp.net/scottgu/archi...21/431138.aspx

It's a real simple, although not very well known, workaround.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"coosa" <co*****@gmail.com> wrote in message
news:11*********************@v46g2000cwv.googlegro ups.com... Dear all,

When i create a website using Visual Studio 2005 i have an option to
choose based on the local file system or the http:// address;
For the local file system, when i later run my web site, the asp.net
development server starts and it assigns a random port to the web
server while for the second option by choosing a http:// address for
the web site project, no random ports will be assigned.

More convenient for me is let people access my website without the
random port, but my problem is:
Even though i specify the same connection string for both projects, i
can't view if i created the project with http:// file system! i always
get this sql exception: select permission denied on object ........ for
that particular view!
It seems that if the asp.net development server was not started and did
not assign a random port, then i have no permissions!
My assumption then, is that by an addrsss with default port 80, a
different computer account is assigned; i guess NT AUTHORITY\NETWORK
SERVICE, else it would be DOMAIN\ASPNET computer user!

I just simply have no clue how to make my site have no assigned random
ports such as http://localhost:3046/MyProj/Default.aspx, but at the
same time that i would have enough permission to access my DB.

I appreciate your response

Best regards

Apr 24 '06 #5

P: n/a
Thanks alot; it helped alot but still port 80 will not work with the
debugger; any idea why?

Apr 24 '06 #6

P: n/a
Any by the way; since it seems that may have aan answer for that; how
is it possible to type then an intra net address such as:
http://project/ instead of http://localhost/project/ ?
I see this in my university or any intra net enviroment such as the
faculty of information technology address as: http://fit/

Apr 24 '06 #7

P: n/a
As mentioned in the previous post, if you also want to run an application directory as
if it was the home directory, follow the instructions given by Scott Guthrie in this blog :

http://weblogs.asp.net/scottgu/archi...21/431138.aspx

It's a real simple, although not very well known, workaround.

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"coosa" <co*****@gmail.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
Any by the way; since it seems that may have aan answer for that; how
is it possible to type then an intra net address such as:
http://project/ instead of http://localhost/project/ ?
I see this in my university or any intra net enviroment such as the
faculty of information technology address as: http://fit/

Apr 24 '06 #8

P: n/a
i really did read it all through but failed to find some thing about
removing the 'localhost' from the http address.
i added also the address in the web site properties by the start up
options to be http://mysite:8080 instead of http://localhost:8080/ but
it failed.

Apr 24 '06 #9

P: n/a
If you mean the example you requested :
I see this in my university or any intra net enviroment such as the
faculty of information technology address as: http://fit/
that's just the machinename of the server, recognized by your Windows network.

You can connect to the web server of any machine in a Windows network,
running a webserver on port 80, by specifying its machinename in the http address :

http://machinename/

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"coosa" <co*****@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro ups.com...i really did read it all through but failed to find some thing about
removing the 'localhost' from the http address.
i added also the address in the web site properties by the start up
options to be http://mysite:8080 instead of http://localhost:8080/ but
it failed.

Apr 24 '06 #10

P: n/a
I guess i'm bothering you with questions :-) but that's the price of
knowledge you have; people will always keep asking you! :-)

Any way, is it possible to map a certain http address such as
http://localhost:8080/ to http://machinename:80/ ? is the port 80 a
reserved port? can it be shared?

Apr 25 '06 #11

P: n/a
re:
is it possible to map a certain http address such as
http://localhost:8080/ to http://machinename:80/ ?
No. You cannot map a port to another port.

If you use http://localhost:8080/ it will be the same as http://machinename:8080/
If you use http://localhost:8081/ it will be the same as http://machinename:8081/
If you use http://localhost:800/ it will be the same as http://machinename:800/

You can create any number of websites which use different ports, until you run out of ports.

re: is the port 80 a reserved port?
No, but it *is* the default port for most webservers, IIS included.

re: can it be shared?
No. Web servers capture their assigned port and don't allow other software to run on it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"coosa" <co*****@gmail.com> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...I guess i'm bothering you with questions :-) but that's the price of
knowledge you have; people will always keep asking you! :-)

Any way, is it possible to map a certain http address such as
http://localhost:8080/ to http://machinename:80/ ? is the port 80 a
reserved port? can it be shared?

Apr 25 '06 #12

P: n/a
Ok, this is my final question and i will stop bugging you after that
with all the appreciation for your time you've spent to assist me;

I wanted to switch back to to the http:// project location selection
instead of the local file system choice;
So i have an understanding that i will not be using the integrated
windows user account and that the DOMAIN\ASPNET machine account will be
instead used by IIS.
In my connection string i added those lines in my web.conf file:
<connectionStrings>
<add
name="MyConnectionString"
providerName="System.Data.SqlClient"
connectionString="Data Source=127.0.0.1;Initial
Catalog=MyDb;Integrated Security=SSPI; uid=sa; pwd=mypassword"
/>
</connectionStrings>
In my SQL Server Configuration Manager I allowed the "TCP/IP" and
"Named Pipes" Protocols.
However, when I try to execute a query through my browser i receive the
following sql exception:
"{"SELECT permission denied on object 'TableView', database 'MyDb',
schema 'dbo'."}"
Any idea?

Apr 25 '06 #13

P: n/a
re:
However, when I try to execute a query through my browser i receive the
following sql exception:
"{"SELECT permission denied on object 'TableView', database 'MyDb',
schema 'dbo'."}"
That is a *SQL Server* permission problem, not an ASP.NET or an IIS web server problem.

You need to make sure that the account which you are using to access
the database has read/write/change permissions for the database's objects.

If you are using Integrated Security you *still* need to add the user account which
ASP.NET is running as ( usually DOMAIN\ASPNET for Windows XP ) to the
database's users...and assign the appropiate database permissions for all the objects
which you want the account to access.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"coosa" <co*****@gmail.com> wrote in message
news:11**********************@i39g2000cwa.googlegr oups.com... Ok, this is my final question and i will stop bugging you after that
with all the appreciation for your time you've spent to assist me;

I wanted to switch back to to the http:// project location selection
instead of the local file system choice;
So i have an understanding that i will not be using the integrated
windows user account and that the DOMAIN\ASPNET machine account will be
instead used by IIS.
In my connection string i added those lines in my web.conf file:
<connectionStrings>
<add
name="MyConnectionString"
providerName="System.Data.SqlClient"
connectionString="Data Source=127.0.0.1;Initial
Catalog=MyDb;Integrated Security=SSPI; uid=sa; pwd=mypassword"
/>
</connectionStrings>
In my SQL Server Configuration Manager I allowed the "TCP/IP" and
"Named Pipes" Protocols.
However, when I try to execute a query through my browser i receive the
following sql exception:
"{"SELECT permission denied on object 'TableView', database 'MyDb',
schema 'dbo'."}"
Any idea?

Apr 25 '06 #14

This discussion thread is closed

Replies have been disabled for this discussion.