473,287 Members | 1,946 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

How can I get a component to work in an ASP.NET application that works in a Windows Form?

I have a DTS Package I am able to execute successfully from a Windows Form
application, but I cannot get this to work from an ASP.NET Web Service,
although the Web Service impersonates the same user the Windows Form runs
under.

When I run the Web Service, I make a call to
"System.Security.Principal.WindowsIdentity.GetCurr ent().Name" and this
verifies the user-id is the same account I am logged onto when I
successfully run my Windows Form application.

Both the Web Service and the Windows Form do the same setup and call the
DTS.Package.LoadFromSQLServer method with the same parameter values.

No error is returned when trying to execute the DTS Package from the ASP.NET
Web Service, but the DTS Package does not get executed.

The account that Aspnet_wp.exe runs under has been granted "Act as part of
the operating system" privilege, so it is able to impersonate the user
account the Windows Form is using, but is there some other privilege needed
so it can execute the DTS Package?

Thanks,

Dean
Nov 17 '05 #1
6 2018
Just checking but have you set the web.config for your Web service to use
impersonation?

<configuration>
<system.web>
<identity impersonate="true"/>
</system.web>
</configuration>

<configuration>
<system.web>
<identity>
userName="registry:HKLM\Software\AspNetIdentity,Na me"
password="registry:HKLM\Software\AspNetIdentity,Pw d"
</identity>
</system.web>
</configuration>
"Dean R. Henderson" <de**@ifmail.com> wrote in message
news:O7*************@TK2MSFTNGP12.phx.gbl...
I have a DTS Package I am able to execute successfully from a Windows Form
application, but I cannot get this to work from an ASP.NET Web Service,
although the Web Service impersonates the same user the Windows Form runs
under.

When I run the Web Service, I make a call to
"System.Security.Principal.WindowsIdentity.GetCurr ent().Name" and this
verifies the user-id is the same account I am logged onto when I
successfully run my Windows Form application.

Both the Web Service and the Windows Form do the same setup and call the
DTS.Package.LoadFromSQLServer method with the same parameter values.

No error is returned when trying to execute the DTS Package from the ASP.NET Web Service, but the DTS Package does not get executed.

The account that Aspnet_wp.exe runs under has been granted "Act as part of
the operating system" privilege, so it is able to impersonate the user
account the Windows Form is using, but is there some other privilege needed so it can execute the DTS Package?

Thanks,

Dean

Nov 17 '05 #2
Hi Oliver,

I tried a few ways to perform the impersonation based on Knowledge Base
article 306158, INFO: Implementing Impersonation in an ASP.NET Application.

One of the ways was to use settings in my web.config file similar to how
your show in your email.

The "System.Security.Principal.WindowsIdentity.GetCurr ent().Name" procedure
returns the domain and user account I am trying to impersonate for the
different ways I have tried impersonation, but the DTS Package that I issue
the .Execute method on does not actually execute the Package.

I doing further testing with Events enabled, I have found the following
error is getting logged:

Step Error Source: Microsoft Data Transformation Services (DTS) Package
Step Error Description:Access is denied.
(Microsoft Data Transformation Services (DTS) Package (80070005): Access is
denied.)
(Microsoft SQL-DMO (80004005): [SQL-DMO]CreateFile error on
'<servername>.<databasename>.LOG'. Access is denied.)
Step Error code: 80070005
Step Error Help File:sqldts80.hlp
Step Error Help Context ID:1100

I do not get this error when executing the DTS Package from a Windows Form
application, so the ASP.NET impersonation is different somehow from how my
Windows Form application.

I don't understand why I get the Access is denied error from ASP.NET when
the system says I am the same user account that works without any error from
my Windows program.

Hopefully someone can help provide information to resolve this problem ...
Thanks,

Dean

"Oliver" <DE*******************@hotmail.com> wrote in message
news:Ol**************@tk2msftngp13.phx.gbl...
Just checking but have you set the web.config for your Web service to use
impersonation?

<configuration>
<system.web>
<identity impersonate="true"/>
</system.web>
</configuration>

<configuration>
<system.web>
<identity>
userName="registry:HKLM\Software\AspNetIdentity,Na me"
password="registry:HKLM\Software\AspNetIdentity,Pw d"
</identity>
</system.web>
</configuration>
"Dean R. Henderson" <de**@ifmail.com> wrote in message
news:O7*************@TK2MSFTNGP12.phx.gbl...
I have a DTS Package I am able to execute successfully from a Windows Form application, but I cannot get this to work from an ASP.NET Web Service,
although the Web Service impersonates the same user the Windows Form runs under.

When I run the Web Service, I make a call to
"System.Security.Principal.WindowsIdentity.GetCurr ent().Name" and this
verifies the user-id is the same account I am logged onto when I
successfully run my Windows Form application.

Both the Web Service and the Windows Form do the same setup and call the
DTS.Package.LoadFromSQLServer method with the same parameter values.

No error is returned when trying to execute the DTS Package from the

ASP.NET
Web Service, but the DTS Package does not get executed.

The account that Aspnet_wp.exe runs under has been granted "Act as part of the operating system" privilege, so it is able to impersonate the user
account the Windows Form is using, but is there some other privilege

needed
so it can execute the DTS Package?

Thanks,

Dean


Nov 17 '05 #3
HI Dean,

From error message, the "access is dennied" occur when your DTS package is
tring to access the log file. If you disable this in DTS package, or
specify the log file with a common path like "c:\temp\myfile.log". With
impersonate, you may have same permission with when you logon on and
execute a window app. However, the difference is the account didn't have
some folder like "My Document" and so on when running a in WEB Service.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 17 '05 #4
HI Dean,

Is there any updates? Did my suggestion help?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 17 '05 #5
Hi Luke,

I got the same error with the Log function enabled or disabled and when
enabled, I made sure it had a fully qualified reference to a valid file and
this file when specified would contain log output.

I cannot get impersonation to work for aspnet_wp.exe when the
%windir%\Microsoft.NET\Framework\v1.1.4322\CONFIG\ machine.config points to
my <domain>\ASPUSER account.

I just recently found that if I change the machine.config file to point to
my admin account, then I can execute the DTS Package from ASP.NET, but this
creates a security exposure I want to avoid.

Therefore, it appears there is some security setting my admin account has
that my ASPUSER account does not have that is preventing the ASPUSER account
when running aspnet_wp.exe in the ASP.NET environment from being able to
execute the DTS Package.

I would appreciate any help regarding how to adjust the settings on my
ASPUSER account to allow this account to be used by ASP.NET with the ability
to execute a DTS Package.

Thanks,

Dean

"MSFT" <lu******@online.microsoft.com> wrote in message
news:3I**************@cpmsftngxa06.phx.gbl...
HI Dean,

Is there any updates? Did my suggestion help?

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #6
Hi Dean,

For impersonate solution, you may take a look following KB article:

INFO: Implementing Impersonation in an ASP.NET Application
http://support.microsoft.com/default...;EN-US;Q306158

You may test the System account to see if it can execute the DTS
successfully.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Petri J. Riipinen | last post by:
Hi folks, I have the following situation: - MyApplication.exe is an WinForms-application that is signed with "AppKey.snk". - MyControls.dll contains a MyComponent-class that I want to drop on...
0
by: acharyaks | last post by:
Hi life saver, I am using excel component for the development. The purpose is to connect to excel through the odbc connection string. Then through the connection extract data into a dataset and...
1
by: Rocio | last post by:
I have a windows app. written in VB6, now we need to expose some of its classes through a web service. I am only able to expose the classes using late binding becasue that's the way the original...
2
by: AMDRIT | last post by:
Hello everyone, I have created a custom component and one of its properties is a class object with it's own properties. During runtime, I can assign values to the class object properties just...
2
by: Sakke | last post by:
Hello! We have written a GCryptoSvr.dll COM server in C++. Inside that resides WebClient COM component. WebClient CLSID is {8DC27D48-F94C-434B-A509-C3E1A3E75B9E}. When we are using that...
7
by: jwang | last post by:
I am trying to instantiate a COM component in C# via late binding. The component appears to be launched, then it automatically gets unloaded. That is, the instance is unloaded after the...
122
by: Edward Diener No Spam | last post by:
The definition of a component model I use below is a class which allows properties, methods, and events in a structured way which can be recognized, usually through some form of introspection...
1
by: Michael Lang | last post by:
I have a class deriving from System.ComponentModel.Component. In VS 2003 I could drag it on to a web form. However I'm finding in VS 2005 whilst it functions perfectly at runtime. At design...
1
by: wanaruk | last post by:
Hi all. I am working on a legacy application written in Classic ASP with VB6 COM+ components running on Windows 2003 Adv Server (32bit). There is one page in the app that uses Secure FTP to send...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.