简体   繁体   中英

Visual Studio Web Deployment project breaks ASPNET account permissions

I have built an ASP.NET web application with Visual Studio 2008 and target framework version 2.0. I have created a Web Setup project to deploy this at multiple target OSes.

For the setup project, I have written a custom action which gets executed on "OnCommitting" event. This custom action adds wildcard script mapping for routing all requests through ASP.NET engine.

FileMon suggests that an error occurs while creating a file in the following directory:
C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\Temporary ASP.NET Files

The user account which was attempting this action was IWAM_<host name>.

The problem is after running this setup, if I try to access any url on the newly installed site, I received the error message:

Server Error in '/myapp' Application.

Failed to access IIS metabase.

An unhandled exception occurred during the execution of the current web request. 执行当前Web请求期间发生未处理的异常。 Please review the stack trace for more information about the error and where it originated in the code.

System.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase. System.Web.Hosting.HostingEnvironmentException:无法访问IIS元数据库。





An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

I have already tried these options after 2 days of googling:

  1. Run aspnet_regiis -i
  2. Run aspnet_regiis -ga \\ASPNET
  3. Run aspnet_regiis -u and then aspnet_regiis -i

Option 3 has worked for me as of now, but, I want avoid using this, since, my web app will be deployed on a machine which might already be hosting some other app on IIS and I do not want to disturb these apps.

Can anyone suggest me a workaround for this?

BTW my current system has .Net framework 3.5 and VS2008 installed on Win XP SP3 and IIS 5.1.

Thanks,
Vamyip

Your best bet is a custom bit of script in the installer package that checks permissions and then runs the command based on that information.

On a server OS this shouldn't be necessary since the default user for the application group will be in the IIS_WPG and have permissions to the temp directories. Windows XP has a bugged up version of IIS that is non-standard and doesn't follow all the rules. If your expected deployment environment is Windows Server 2003 or better then your installer should work as-is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM