一次复杂的.net web项目创建

来源:互联网 发布:不可抗力 网络剧 编辑:程序博客网 时间:2024/04/28 14:09
 
今天接到一个新的任务,是个asp.net的项目。爽,好久都没有做过asp.net啦,做winform都做烦了。于是兴致勃勃的打开IDE,new一个WebApp,什么,不行,原来开发工具久了不用也会生锈啊。倒!!!!!
 
重装IIS
看看什么问题,恩~~~~,什么!没有装IIS,强啊,什么时候卸的??不管了,装上就行,于是Settings->control panel->Add or remove programs->add/remove windows components->IIS,哈哈,开始装了,我说简单嘛。什么??出错?不能拷贝文件,“Setup cannot copy the file staxmem.dll.Please insert the "Windows XP Professional Service Pack 2 CD".Setup could not copy one or more files. The specific error code is 0x4b8.”什么意思啊,恩~想起来了,好像跟“secedit.sdb”有关的,试试先。
1、测试 secedit.sdb 的完整性:
esentutl /g C:/Windows/security/database/secedit.sdb
返回
Integrity check successful.
貌似这个数据库没问题。MS 说如果没问题,就要重新制作集成 SP2 的安装文件。晕倒,我只有已经集成好的 ISO. 只好试试数据库有问题时的解决方案。
2、修复数据库:
esentutl /p C:/Windows/security/database/secedit.sdb
Yes~安装成功了,我真天才啊!!!!!!
 
同步密码
IIS新装,必不可少的先要aspnet_regiis –i一下啦,然后再次新建web项目,我靠,又错了,难道注册IIS不行,那再注册一次,顺便把环境也整了(aspnet_regiis -ir),这下应该可以了,再建,不会吧!!!还是不行,出了个“access forbid 403”的错,这个嘛,好像也不难,打开inetmgr.exe把默认站点的home directory tab里面的Execute permissions改成scripts only。好,我再建,还是不行啊~~~变成“500 server error”了,怎么回事啊,建个web项目这么痛苦的。我忍。看看系统日志怎么回事,恩,有两个问题,“DCOM got error "Logon failure: unknown user name or bad password. " and was unable to logon”和一个“The server failed to load application '/LM/W3SVC/1/Root/Supervisor'. The error was '因为配置类型不正确,系统无法开始服务器进程。请检查用户名和密码”,想一下,好像遇到过啊,不管先试试啦,不就是要IUSR_计算机名IWAM_计算机名,还有MTS的密码一致吗,难不倒我。
首先改掉IUSR和IWAM的密码,然后到c:/inetpub/adminscripts下面运行cscript.exe adsutil.vbs set w3svc/anonymoususerpass "password"cscript.exe adsutil.vbs set w3svc/wamuserpass "password",让它们一致先,然后再运行cscript.exe synciwam.vbs –v让MTS和它们一致。(参考http://support.microsoft.com/default.aspx?scid=kb;zh-cn;297989)
再来试试,果然还是不行,等等,好像运行synciwam的时候有个     80070020  error的,什么错误啊?完全不明白,查也查不到,怎办???
 
Reinstall Com+
让我想想,好像之前看到一篇文章说这个问题和什么service有关的,到services.msc去看看吧,恩,好像也没有什么问题呢!诶~有个Com+的服务没有开,这肯定不行嘛,是不是这个导致的啊,不管,先启动一下,又出错了,"could not start the com+ system application service on local computer",是不是用户不对,改下试试,还是不行,恩,估计就是这个了,是它导致的问题???那怎么解决呢??搜一下,google就是好啊,一下就找到了,原来可以重装com+的:
1.查找到“/%WinDir%/System32/Clbcatq.dll”文件,并且把它重命名为“~Clbcatq.dll”(要注意那个符号“~”)“%Windir%”是个环境变量,这个变量通常可以转译成“C:/Windows”
  2.以安全模式重新启动计算机(开机时候一直按F8 就可以进入选择开始界面)
  3.打开注册表,并删除下面的键值:HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/COM3
  4.“/%WinDir%”目录中查找名为“Registration”子目录。把这个目录完全删除,包括其中所包含的一切文件。
  5.以正常方式重新启动计算机。
  6.在命令提示行模式下,键入“regsvr32 /%windir%/system32/ole32.dll”,然后在出现的接受提示上点击确认
  7.打开控制面板,选择添加或删除程序,然后再选择添加/删除Windows组件功能。
  8.点击下一步来重新安装COM+。事实上,你并不需要选择添加或删除任何组件;COM+照例会自动进行重新安装。
  在这一步操作之后你不需要重新启动计算机;重新注册的COM+服务将会立即生效。
尾声
诶~~成了,COM+服务启动了。再重新做cscript.exe synciwam.vbs –v,好了,也成功了,再建Web项目,怎么,还是不行,不过系统日志提示变成了“The server failed to load application '/LM/W3SVC'. The error was '找不到指定的元数据”这是好现象,我再查一下,这里有位老兄是这么说的:
think the problem is very serious since the whole IIS Root's metabase
seems got corrupt. Installing VS.NET won't help because the IIS metabase
setting (or other configuration) concerned with ASP.NET is not created by
the VS.NET , they're done when you installed the .net framework.   So If
you feel possible, the quickest and simplest means is reinstalling the IIS
and .net framework. And to make sure the IIS is configured correctly, we
need to follow the sequence that install IIS first, then .net framework.
 
In addition, does the problem occur after youv'e done some big changes on
the server? One thing I think you can still check is the IIS's meta base
backup. Open the IIS management console (inetmgr.exe)
 
Then select the root node and choose the "All Tasks---->Backup/Restore
Configuration...."
you can look for any former settings that can be used to restore your IIS.
If there hasn't any proper backup can use, I'm afraid maybe we need to do
the reinstallation I mentioned above.
试试吧,再重装IIS然后再重新aspnet_regiis –i,然后再建项目,哇!!!!!!那可爱的连接图标又重现江湖了,成功啦,真是不容易啊。哇哈哈哈哈~~~~~~~~~~~
 
原创粉丝点击