Impersonate in winforms

  • Thread starter Thread starter rajeshraju
  • Start date Start date
R

rajeshraju

I am using VB.NET winforms application and want to use impersonation.
This is my app.config file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<identity impersonate="true"
userName="userName"
password="password" />

<appSettings>
<add key="LinkLabel1.AutoSize" value="False" />
<add key="MenuItem1.Checked" value="False" />
<add key="mnItemVoid.Checked" value="False" />
<add key="mnItemVoid.Enabled" value="True" />
<add key="mnItemVoid.MergeOrder" value="0" />
<add key="mnItemVoid.Text" value="Void" />
<add key="mnItemVoid.Visible" value="True" />
</appSettings>
</configuration>

I am getting the following error when executing the application

An Unhandled exception of type
"System.Configuration.ConfigurationException" occurred in System.dll.

Additional Information: Unrecognized configuration section identity

I think this is due to the impersonation. Could someone please help me
resolve this.

Thanks
 
(e-mail address removed) wrote in @f14g2000cwb.googlegroups.com:
Additional Information: Unrecognized configuration section identity

I think this is due to the impersonation. Could someone please help me
resolve this.

As mentioned, this is not supported for windows applications. If you want
a user to be able to run a program as someone else, take a look at the
'runas' program installed on WinXP and Win2k (I think) by default.

-mdb
 
I am using VB.NET winforms application and want to use impersonation.
This is my app.config file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>

<identity impersonate="true"
userName="userName"
password="password" />

<appSettings>
<add key="LinkLabel1.AutoSize" value="False" />
<add key="MenuItem1.Checked" value="False" />
<add key="mnItemVoid.Checked" value="False" />
<add key="mnItemVoid.Enabled" value="True" />
<add key="mnItemVoid.MergeOrder" value="0" />
<add key="mnItemVoid.Text" value="Void" />
<add key="mnItemVoid.Visible" value="True" />
</appSettings>
</configuration>

I am getting the following error when executing the application

An Unhandled exception of type
"System.Configuration.ConfigurationException" occurred in System.dll.

Additional Information: Unrecognized configuration section identity

I think this is due to the impersonation. Could someone please help me
resolve this.

Thanks

This comes from a web application config file:
<identity impersonate="true"
userName="userName"
password="password" />
and as such it's handled by the web application host, if you need this in
your Winforms application, you have to write code to impersonate just like
the web host (aspnet_wp.exe) is doing.

Willy.
 
Back
Top