Trouble deploying an ASP.NET project that uses a SERVICE

A

Afshar

Hi Group,

Please help ending my Nightmare! There's a Windows Service written in
VC++ and I have an ASP.NET project that uses this sevice as a COM
library. It just works fine in VS Internal Web Server and also in my
IIS. I can publish it on my computer easily, But CAN'T publish or
deploy it on other machines with almost same configuration. The Service
in working on all other machines too.
I've tried several ways to set all permissions and security rights to
all users and tried to put that service within the BIN directory but it
doesn't help. The Error message that I get in all situatuions is:
Retrieving the COM class factory for component with CLSID
{3304F12E-4A78-4F49-AF4E-C6E92617249E} failed due to the following
error: 80070005.

Please Help!
Afshar
 
N

Norman Yuan

Are you sure the said Windows Service was installed and running (if set to
Automatically Start), either somehow by your publishing/deploying, or
someone did it manually, on the target web server computer? How did you get
the Windows Service installed and running?
 
A

Afshar

Dear Norman,
I've found the problem, that Service wasn't the problem It was working
and configured fine.

I enabled anonymous access in IIS and set an ASPNET user for it.
Granted administrative rights to ASPNET user and everything went OK!

Thanks for your help,
Afshar
 
N

Norman Yuan

If the project is not used only for test purpose, I strongly suggest you to
consider the security risk of that practice: just having to use that Windows
service, you have lift a web user's priviledge to Administator, that is
definitely not a good way.
 
J

Juan T. Llibre

re:
But I don't know what rights to grant the anonymous user.

Please review this article :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/paght000009.asp
for instructions on how to create a service account for ASP.NET

and this article :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetht01.asp
for the list of directories to which the ASP.NET service account needs permissions.

This last article is written for 1.1, but the directories haven't changed for 2.0
 
A

Afshar

Dear Juan
The first article is compeltely about Windows 2003 and the Second seems
to not be very realted with Services problem. I'm using Windows XP Pro,
ASP.NET 2.

Thanks:
Afshar Mohebbi
 
J

Juan T. Llibre

re:
The first article is compeltely about Windows 2003

Actually, it's about ASP.NET 2.0 running under Windows 2003 Server.

The only difference you'll find is in the Application Pool info.
You can ignore that. The rest is quite accurate for IIS 5.1.

re:
the Second seems to not be very realted with Services problem.

The first article deals with ASP.NET 2.0 and the second one with ASP.NET 1.1.

You can ignore the second one, but it has the correct list of directories to which
you need to assign permissions to whichever account ASP.NET runs as.

The first article doesn't have them, because ASP.NET 2.0 has a nifty
command to assign permissions to all necessary directories :

aspnet_regiis -GA machinename\accountname
or
aspnet_regiis -GA domainname\accountname


re:
I'm using Windows XP Pro, ASP.NET 2.
I enabled anonymous access in IIS and set an ASPNET user for it.
OK...

re:
Granted administrative rights to ASPNET user and everything went OK!

That may bite you in the future.
The ASPNET account should *not* have administrative rights.

What you should do is to *only* assign the rights the account needs.

The list of directories and the type of permissions the ASP.NET
account needs are listed in the second article I sent to you.

If you still have doubts, review this list of ACLS which ASP.NET (all versions) requires :
http://msdn2.microsoft.com/en-us/library/kwzs111e.aspx

If you assign those permissions to *any* account which ASP.NET is running as,
ASP.NET will run just fine, including Web Services.

Don't expose your machine by giving administrative rights to the ASP.NET account.
That is easy to do, and does solve the problem, but it may bring you headaches later on.





Dear Juan
The first article is compeltely about Windows 2003 and the Second seems
to not be very realted with Services problem. I'm using Windows XP Pro,
ASP.NET 2.

Thanks:
Afshar Mohebbi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top