Barry Kaye Barry Kaye - 11 months ago 48
C# Question

Visual Studio 2010 Build Error - Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))

Recently we migrated our development environment from VS2008 to VS2010 (Ultimate).

For one solution (for now all C#, .NET Framework 3.5 and ASP.NET 2.0) which contains 6 projects VS auto-upgraded it without any problems.

The solution projects are:

  1. ASP.NET website

  2. VS2010 Web Deployment project for above site

  3. Web Services Application

  4. VS2010 Web Deployment project for above WSA

  5. A class library.

  6. Another class library.

However, when we build we have 1 error:

Could not load file or assembly 'ClassLibrary1BLL, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An API call exited abnormally. (Exception from HRESULT: 0x800300FA (STG_E_ABNORMALAPIEXIT))

After research I finally tracked this to one entry in the ASP.NET website config:

If I build with this line the problem occurs:

<identity impersonate="true" userName="DOMAIN\user" password="password"/>

However, if I comment out and build with the following line (without the supplied credentials) the solution builds fine AND then amend the web.config back to the above (with the credentials) the site runs fine - the credentials only cause a problem for the build.

<identity impersonate="true"/>

Now here is the strangest issue - the Web Services Application builds fine with the supplied credentials - the build error ONLY occurs for the ASP.NET website. This all holds true whether the projects are built individually or the solution rebuilt.

Any pointers how I can successfully build with the supplied credentials will be greatly appreciated.

Answer Source

Check the permissions of the impersonation user.

After just setting the flag to false, <identity impersonate="false"/>, it also came to life for me. However, once setting it back to true, it built fine, but when I loaded the site, I got:

The current identity (XN-DTDEV\Fusion) does not have write access to 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files'.

Now this machine is on a domain, and that user is local, which should have administrative privileges. When I checked back, it didn't. It looks like there is a policy re-setting the local administrators each reboot.