[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.setup

Cannot start Dotnet 2.0 Windows Service after install - Access is denied

juliensellgren

2/10/2008 9:47:00 AM

I have created an MSI installer using Visual Studio 2005, to install a
Dotnet 2.0 Windows Service. In the OnAfterInstall() method of the
ProjectInstaller class, I am using
System.ServiceProcess.ServiceController to start the service. The
service never starts however, and in the Eventlog, I get:

EventID: 1509, Source: UserEnv, Type: Warning
Windows cannot copy file C:\Documents and Settings\Default User.WINDOWS
\Application Data\Microsoft\CLR Security Config
\v2.0.50727.832\security.config.cch.3352.681328 to location C:
\Documents and Settings\<user.MACHINE>.000\Application Data\Microsoft
\CLR Security Config\v2.0.50727.832\security.config.cch.3352.681328.
Possible causes of this error include network problems or insufficient
security rights. If this problem persists, contact your network
administrator.

DETAIL - Access is denied.

I can get the service to start with some users, but not others.
Granting local Administrator priviledges to the service user doesn't
help. I have tried experimenting with permissions on the C:\Documents
and Settings\ directory, granting the service user Full control - with
no luck.

This problem never existed when my service was a Dotnet 1.1 app. This
problem only started happening with Dotnet 2.0. This problem exists
whether or not I try to start the service in code from the MSI or
whether or not I press 'Start' from the Service Control Manager. What
rights does my user need to have? And what is the temporary .000
profile directory that gets created when a service tries to start?
Note: I am trying to use a local user, as opposed to a Domain Account
for my service.

Any help would be greatly appreciated.

Julien
3 Answers

Phil Wilson

2/12/2008 8:51:00 PM

0

1) What OS is this? Wondering if it's Vista.
2) You should be using InstallAllUsers set True, just in case you're not.

--
Phil Wilson
[MVP Windows Installer]

<juliensellgren@hotmail.com> wrote in message
news:be338d66-5ea5-45dd-822c-97b06473f364@s8g2000prg.googlegroups.com...
>I have created an MSI installer using Visual Studio 2005, to install a
> Dotnet 2.0 Windows Service. In the OnAfterInstall() method of the
> ProjectInstaller class, I am using
> System.ServiceProcess.ServiceController to start the service. The
> service never starts however, and in the Eventlog, I get:
>
> EventID: 1509, Source: UserEnv, Type: Warning
> Windows cannot copy file C:\Documents and Settings\Default User.WINDOWS
> \Application Data\Microsoft\CLR Security Config
> \v2.0.50727.832\security.config.cch.3352.681328 to location C:
> \Documents and Settings\<user.MACHINE>.000\Application Data\Microsoft
> \CLR Security Config\v2.0.50727.832\security.config.cch.3352.681328.
> Possible causes of this error include network problems or insufficient
> security rights. If this problem persists, contact your network
> administrator.
>
> DETAIL - Access is denied.
>
> I can get the service to start with some users, but not others.
> Granting local Administrator priviledges to the service user doesn't
> help. I have tried experimenting with permissions on the C:\Documents
> and Settings\ directory, granting the service user Full control - with
> no luck.
>
> This problem never existed when my service was a Dotnet 1.1 app. This
> problem only started happening with Dotnet 2.0. This problem exists
> whether or not I try to start the service in code from the MSI or
> whether or not I press 'Start' from the Service Control Manager. What
> rights does my user need to have? And what is the temporary .000
> profile directory that gets created when a service tries to start?
> Note: I am trying to use a local user, as opposed to a Domain Account
> for my service.
>
> Any help would be greatly appreciated.
>
> Julien


juliensellgren

2/13/2008 12:05:00 AM

0

The OS is Windows Server 2003. InstallAllUsers is set to true. It
appears to be a Dotnet framework issue, since the 1.1 version of the
service starts fine under the same user account. The only other thing
I could see it being would be a permissions issue on one of the
related DLL's of my service... For example, my 1.1 service references
the SharePoint 2003 dll, and my 2.0 service references the SharePoint
2007 dll... However, OnStart() would not cause the SharePoint DLL to
load at that time.

All my OnStart() method does is register a TCP channel, using the
System.Runtime.Remoting .dll. This registration attempt never gets
called however because otherwise I would have seen something in the
eventlog. So I am wondering if it might be happening when this dll is
loaded by framework, right after the call to OnStart(), but before any
of my code executes. Could Dotnet 2.0 have some stricter permissions
requirements over Dotnet 1.1 here?

On Feb 12, 12:50 pm, "Phil Wilson"
<phil.wil...@wonderware.something.com> wrote:
> 1) What OS is this? Wondering if it's Vista.
> 2) You should be using InstallAllUsers set True, just in case you're not.
>
> --
> Phil Wilson
> [MVP Windows Installer]
>
> <juliensellg...@hotmail.com> wrote in message
>
> news:be338d66-5ea5-45dd-822c-97b06473f364@s8g2000prg.googlegroups.com...
>
>
>
> >I have created an MSI installer using Visual Studio 2005, to install a
> >Dotnet2.0WindowsService. In the OnAfterInstall() method of the
> > ProjectInstaller class, I am using
> > System.ServiceProcess.ServiceController to start theservice. The
> >servicenever starts however, and in the Eventlog, I get:
>
> > EventID: 1509, Source: UserEnv, Type: Warning
> > Windows cannot copy file C:\Documents and Settings\Default User.WINDOWS
> > \Application Data\Microsoft\CLR Security Config
> > \v2.0.50727.832\security.config.cch.3352.681328 to location C:
> > \Documents and Settings\<user.MACHINE>.000\Application Data\Microsoft
> > \CLR Security Config\v2.0.50727.832\security.config.cch.3352.681328.
> > Possible causes of this error include network problems or insufficient
> > security rights. If this problem persists, contact your network
> > administrator.
>
> > DETAIL - Access is denied.
>
> > I can get theserviceto start with some users, but not others.
> > Granting local Administrator priviledges to theserviceuser doesn't
> > help. I have tried experimenting with permissions on the C:\Documents
> > and Settings\ directory, granting theserviceuser Full control - with
> > no luck.
>
> > This problem never existed when myservicewas aDotnet1.1 app. This
> > problem only started happening withDotnet2.0. This problem exists
> > whether or not I try to start theservicein code from the MSI or
> > whether or not I press 'Start' from theServiceControl Manager. What
> > rights does my user need to have? And what is the temporary .000
> > profile directory that gets created when aservicetries to start?
> > Note: I am trying to use a local user, as opposed to a Domain Account
> > for myservice.
>
> > Any help would be greatly appreciated.
>
> > Julien- Hide quoted text -
>
> - Show quoted text -

juliensellgren

2/16/2008 1:32:00 AM

0

As a follow up, I believe I figured out what my problem was. As it
turns out, I was off on the wrong track, thinking that this issue had
to do with the specific user accounts being used for the service. The
permissions error I was getting was inconsequential. These were
occuring due to some other issue I have on my network to do with newly
created accounts.

The issue I was having with Dotnet 2.0 services not being able to
start, was due to the fact that the service executable was signed.
Apparently, the CLR does some additional checking with a signed
service, whereas the Dotnet 1.1 framework did not do this checking. It
wasn't my OnStart() method that was timing out. Presumably the CLR was
busy looking for some certificate authority over the internet, which
was preventing the service from starting in a timely fashion. It seems
like a lame solution to simply not sign my service executable, but if
that's what it takes...

On Feb 12, 4:05 pm, juliensellg...@hotmail.com wrote:
> The OS is Windows Server 2003. InstallAllUsers is set to true. It
> appears to be a Dotnet framework issue, since the 1.1 version of the
> service starts fine under the same user account. The only other thing
> I could see it being would be a permissions issue on one of the
> related DLL's of my service... For example, my 1.1 service references
> the SharePoint 2003 dll, and my 2.0 service references the SharePoint
> 2007 dll... However, OnStart() would not cause the SharePoint DLL to
> load at that time.
>
> All my OnStart() method does is register a TCP channel, using the
> System.Runtime.Remoting .dll. This registration attempt never gets
> called however because otherwise I would have seen something in the
> eventlog. So I am wondering if it might be happening when this dll is
> loaded by framework, right after the call to OnStart(), but before any
> of my code executes. Could Dotnet 2.0 have some stricter permissions
> requirements over Dotnet 1.1 here?
>
> On Feb 12, 12:50 pm, "Phil Wilson"
>
>
>
> <phil.wil...@wonderware.something.com> wrote:
> > 1) What OS is this? Wondering if it's Vista.
> > 2) You should be using InstallAllUsers set True, just in case you're not.
>
> > --
> > Phil Wilson
> > [MVP Windows Installer]
>
> > <juliensellg...@hotmail.com> wrote in message
>
> >news:be338d66-5ea5-45dd-822c-97b06473f364@s8g2000prg.googlegroups.com...
>
> > >I have created an MSI installer using Visual Studio 2005, to install a
> > >Dotnet2.0WindowsService. In the OnAfterInstall() method of the
> > > ProjectInstaller class, I am using
> > > System.ServiceProcess.ServiceController to start theservice. The
> > >servicenever starts however, and in the Eventlog, I get:
>
> > > EventID: 1509, Source: UserEnv, Type: Warning
> > > Windows cannot copy file C:\Documents and Settings\Default User.WINDOWS
> > > \Application Data\Microsoft\CLR Security Config
> > > \v2.0.50727.832\security.config.cch.3352.681328 to location C:
> > > \Documents and Settings\<user.MACHINE>.000\Application Data\Microsoft
> > > \CLR Security Config\v2.0.50727.832\security.config.cch.3352.681328.
> > > Possible causes of this error include network problems or insufficient
> > > security rights. If this problem persists, contact your network
> > > administrator.
>
> > >DETAIL - Access is denied.
>
> > > I can get theserviceto start with some users, but not others.
> > > Granting local Administrator priviledges to theserviceuser doesn't
> > > help. I have tried experimenting with permissions on the C:\Documents
> > > and Settings\ directory, granting theserviceuser Full control - with
> > > no luck.
>
> > > This problem never existed when myservicewas aDotnet1.1 app. This
> > > problem only started happening withDotnet2.0. This problem exists
> > > whether or not I try to start theservicein code from the MSI or
> > > whether or not I press 'Start' from theServiceControl Manager. What
> > > rights does my user need to have? And what is the temporary .000
> > > profile directory that gets created when aservicetries to start?
> > > Note: I am trying to use a local user, as opposed to a Domain Account
> > > for myservice.
>
> > > Any help would be greatly appreciated.
>
> > > Julien- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -