var competitive=new {technique,business}

2007/4/28

WebPart与数据库

问题:
1,无法更新数据库 "C:\INETPUB\WWWROOT\WEBPART\APP_DATA\ASPNETDB.MDF",因为数据库是只读的。
2,主机名\登录名创建ASPNETDB.mdf时错误。
3,local services登录错误
解决方法:
1,删除WEB.config
2,通过vs自带的网站配置工具配置
结论:
WebDev.WebServer以登录用户的权限自动创建数据库(当全局的配置文件中成员资格和角色提供程序连接字符串包含“AttachDBFilename=|DataDirectory|aspnetdb.mdf”时)。
使用local service帐户的应该是w3wp程序,为什么登录使用该帐户,而不是network services(03下的需给该用户某些目录的写入权限)或模拟本机用户登录。

2007/4/27

两篇关于ASP.NET运行时讲解较深入的文章:
1, ASP.NET WebForms底层请求处理机制初探
2,ASP.NET 2.0运行时简要分析
一篇关于prototype.js讲解较全面的文章:
prototype.js开发笔记
一篇关于ASP.NET中页的生存周期的文章,特别讲解了ViewState及MasterPage的生存流程:
asp.net 2.0中页的生存周期(Lifecycle)和动态控件
Session FAQ:
理解Session State模式+ASP.NET SESSION丢失FAQ

2007/4/25

免费的ASP.Net空间

http://vwdhosting.net50M免费空间,30M数据库,速度一般,程序要放在根目录下,可上传zip文件,支持codebehind,masterpage等,aspx文件要保存成Unicode才能正确显示。
http://www.brinkster.com/30M免费空间,速度快,不支持codebehind,masterpage,bin等。

2007/4/22

Session丢失的情况:
1、配置文件中processModel标签的memoryLimit属性(IIS6中的回收)
2、Global.asax或者Web.config文件被更改
3、Bin文件夹中的Web程序(DLL)被修改
4、杀毒软件扫描了一些.config文件。
FileUpLoad控件有上传文件大小限制,解决办法修改斜体字处对应的值:
<system.web>
<httpruntime >maxRequestLength ="4096" executionTimeout="120">
</httpruntime>
</system.web>

图书点评
Pro_C_Sharp_2005_and_the_dot_NET_2.0_Platform(英文-Apress):浅显易懂,实用,较全面
.net框架程序设计(中文-李建忠):深入讲解.net的底层细节,需要慢慢研读,翻译的不错
Effective C#(英文-
Addison Wesley ):总共50条规则,讲解.net细节并给出设计高效程序的建议
oracle精髓(中文-o'reily):对概念讲解的比较深入,入门必备
Webpart In Action(英文-Manning):讲解的比较系统,实战性强


Server Application Error详细解决办法

1,对于asp程序参考:
http://www.tongyi.net/article/20040928/200409284127.shtml
2,对于asp.net程序参考:
As a last resort, you can re-create the IIS packages. To do this, follow these steps:
Browse to Component Services and delete the following packages:NOTE: To delete the packages, you must first open the properties of the package, click the Advanced tab, and then click to clear the Disable Deletion check box.
IIS In-Process Applications
IIS Out-of-Process Pooled Applications
IIS Utilities
Open a command prompt, and then use the following command to switch directories:
cd %windir%system32inetsrv
Run the following commands:
rundll32 wamreg.dll, CreateIISPackage
NOTE: "CreateIISPackage" must be typed exactly; it is case-sensitive.
regsvr32 asptxn.dll
Close and reopen Component Services. You should see all three IIS COM+ applications that have been recreated.
Run IISRESET from a command line and test any ASP page that previously did not load correctly.

启动用户实例的进程时出错[zz]

原文:http://483sr2kpr3b9.spaces.live.com/PersonalSpace.aspx?_c02_owner=1

我 相信很多人在使用ASP.NET 2.0 + SQL2005 + aspnetdb(MemberShip等功能)时出现这个问题:“由于启动用户实例的进程时出错,导致无法生成 SQL Server 的用户实例。该连接将关闭。”,其英文版本的相同问题的错误信息是:“Failed to generate a user instance of SQL Server due to a failure in starting the process for the user instance. The connection will be closed.”
我花了将近3天的时间,终于找到了答案!原来这是微软的bug,并且微软已经承认,详情如下:http://support.microsoft.com/?id=896613
出现此错误的条件是:你用过远程桌面连接,并且安装了SQL2005+VS2005,就有很大可能触发这个问题,微软说会在将来的XP SP3里面解决掉这个问题,要想立即解决这个问题,需要交费…… - -6
不用理会SB M$,咱们自有土办法来解决,请看如下文章:http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=128707&SiteID=1
如 果你看不懂英文,那么我告诉你我的解决办法:删除C:Documents and Settings[USERNAME]Local SettingsApplication DataMicrosoftMicrosoft SQL Server DataSQLEXPRESS目录即可,[USERNAME]是Windows用户名,比如说Administrator
综上所述,为了防止大家像我一样郁闷,特将我的经验公开,谢谢捧场~

server2003+ii6 编译器错误信息:CS0016: 未能写入输出文件解决方案


安装Quick Start后出现错误CS0016,解决方法:
1,重新安装试试。
2,修改windows\temp或Temporary ASP.NET Files文件夹的权限使net services具有写入修改权限。
转:

解 决:编译器错误信息: CS0016: 未能写入输出文件“c:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Fileslistenleaksae3daa38e9fdb67zaie9ij.dll”--“拒绝访问。 ”

一、http://support.microsoft.com/default.aspx?scid=kb;en-us;329065#

PRB: Access Denied Error When You Make Code Modifications with Index Services Running

RESOLUTION

If you do not use Index Server on the server, you can disable it. To do so, follow these steps:
1. Click Start, and then click Services.
2. Locate Indexing Service from the list of services, and then click Indexing Service Properties from the subform.
3. On the General tab of the Indexing Service Properties dialog box, in the Startup type drop-down item list, click Disabled.
4. Click OK.

If you use Index Server, you can exclude the Temporary ASP.NET Files directory from the folders that the Index Server scans. To do so, follow these steps:
1. Click Start, point to All Programs, point to Administrative Tools, and then click Computer Management.
2. Expand the Services and Applications node, expand the Indexing Service node, and then expand the System node.
3. Right-click the Directories folder, point to New, and then click Directory from the subform to open the Add Directory dialog box.
4. Click Browse, and then locate the Temporary ASP.NET Files directory. You typically find the Temporary ASP.NET files in the following path: c:Microsoft.NETFrameworkTemporary ASP.NET Files
Note is the version of .NET Framework installed on your computer.
5. Click No under the Include in Index? option buttons.
6. Click OK to close.
7. Close the Computer Management dialog box.
8.

Restart the Indexing Services service.

二、

另 外还有一个 Access denied 的错误说是不能访问 C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files 下的某个目录。产生这些错误的原因很多,主要的可能包括:Bin 目录或者 Web.config 被更改以及访问文件系统的权限不够。

如果 Bin 目录或者 Web.config 被更改,MSDN 网站上有文章说是因为 Microsoft Index Services(Indexing Service) 服务在运行。详细内容可以访问: PRB: Access Denied Error When You Make Code Modifications with Index Services Running

但是另外还需要注意一些别的问题,

  • 检查 Bin 目录的文件系统访问权限。一般只要确保 Users 容器拥有“读取和运行”、“列出文件夹目录”和“读取”的权限就可以了。
  • 如 果提示说不能访问 C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files... ,可以将 Temporary ASP.NET Files 目录的访问权限列表中添加 Everyone,并设置为拥有所有的权限。然后在访问一次此 Web 应用程序后,将 Temporary ASP.NET Files 目录的访问权限列表中将 Everyone 删除就可以了。

综上所述的方法,主要包括:

  • 禁用或设置 Indexing Service 服务;
  • 检查 Bin 目录的访问权限;
  • 设置 Temporary ASP.NET Files 目录的访问权限。

三、在 Windows2003 下(IIS6),用 VS2003 生成一个 asp.net 应用,然后 F5 进行调试,出现如下错误信息:

“/0124”应用程序中的服务器错误。

编译错误 说明: 在编译向该请求提供服务所需资源的过程中出现错误。请检查下列特定错误详细信息并适当地修改源代码。

编 译器错误信息: CS0016: 未能写入输出文件“e:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files124fea90a4b69167562pw09que0.dll”--“拒绝访问。 ”
源错误:版本信息: Microsoft .NET Framework 版本:1.1.4322.2032; ASP.NET 版本:1.1.4322.2032

我于是用“WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Files”在msdn以及网上搜了一把,搜到两种解决方案:

修改该目录的权限,加上“NETWORK SERVICE”,让它对该目录有控制权限。
修改IIS服务的缺省账户为“本地系统”
经验证,方法二可行,方法一失败。(yzt_andyamy采用方法一却成功了!)但是方法二会导致IIS运行不安全,所以这种方法不太合适。

后来我查看了别人的配置,发现人家IIS服务的缺省账户都是“网络服务”,这就说明我的机器的权限设置在某个地方存在差异。但是问题出在哪里呢?我遍查MSDN和Google/baidu也没有找到答案。

后来不知道抽了哪根筋,灵光一闪,看看 WindowsTemp 的权限设置,把 “NETWORK SERVICE”的权限设置为“控制”级别,再试试Debug,成了!

真是见鬼!难道说这是Windows的一个BUG?还是我的哪个地方的设置出现了问题?

==上面是一个GG的BLOG,偶按照他的方法,设置了 WindowsTemp 的权限,结果好了。
莫名其妙。

Gemini:基于web的bug追踪工具
AspNetCompiler:网站预编译工具
ViewStateDecoder:查看网页ViewState的工具