ASP.NET网站项目 [英] ASP.NET Website Project

查看:63
本文介绍了ASP.NET网站项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,


当我使用Visual Studio 2005创建网站时,我可以选择基于本地文件系统或http选择
://地址;

对于本地文件系统,当我以后运行我的网站时,asp.net

开发服务器启动并为它分配一个随机端口web

服务器,而对于第二个选项,通过为网站项目选择

的http://地址,不会分配随机端口。


对我来说更方便的是让人们在没有

随机端口的情况下访问我的网站,但我的问题是:

即使我指定了相同的连接字符串对于这两个项目,如果用http://文件系统创建项目,我不能查看
!我总是

得到这个sql异常:选择权限被拒绝对象........对于

特定的视图!

It似乎如果asp.net开发服务器没有启动并且没有分配随机端口,那么我没有权限!

我的假设是,那是一个使用默认端口80的addrsss,分配一个

不同的计算机帐户;我想NT AUTHORITY \ NETWORK

服务,否则它将是DOMAIN \ASPNET计算机用户!


我只是不知道如何让我的网站没有随机分配

端口,例如 http:// localhost:3046 / MyProj / Default.aspx ,但在

的同时,我有足够的权限访问我的数据库。


感谢您的回复


最好的问候

解决方案

我上传了两张图片来说明我的意思是:

图片#1 => http://www.abuabdou.com/file.gif

图片#2 => http://www.abuabdou.com/http.gif


2006年4月23日18:18:15 -0700,coosa写道:

我只是不知道怎么做使我的网站没有分配随机
端口,如 http:// localhost :3046 / MyProj / Default.aspx ,但同时我有足够的权限访问我的数据库。




这个与随机端口无关。当你做一个HTTP站点,然后

你的代码在IIS下运行。如果你做一个文件系统项目,那么在开发服务器(Cassini)下运行它是
。开发Web服务器

作为您登录的帐户运行,而IIS作为操作系统运行

定义的用户(在XP下,这将是(LOCALHOST)\ asp.net for asp.net代码)。


如果您的连接字符串使用集成身份验证,那么您需要

来提供您使用的任何帐户访问您的数据库。如果您使用用户名/密码获得
,那么您必须授予该用户访问权限。


因为您提到了域名。这里可能发生的是你的SQL

服务器是在一个单独的机器上,你给自己的域用户

帐户权限。这适用于Cassini,但因IIS而失败,因为IIS

默认使用本地计算机帐户。


"如果您的连接字符串正在使用集成身份验证,然后你需要

来提供你正在使用的任何帐户访问你的数据库 ...

我的连接字符串包括:Integrated Security = True;此外,数据库中我的

ASPNET帐户已被分配足够的权限,以便我的应用程序执行所有可能的操作。


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

解决方案

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


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.


"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.


这篇关于ASP.NET网站项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆