473,725 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Securit y.Principal.Win dowsIdentity.Ge tCurrent().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.Loa dFromSQLServer 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 2045
Just checking but have you set the web.config for your Web service to use
impersonation?

<configuratio n>
<system.web>
<identity impersonate="tr ue"/>
</system.web>
</configuration>

<configuratio n>
<system.web>
<identity>
userName="regis try:HKLM\Softwa re\AspNetIdenti ty,Name"
password="regis try:HKLM\Softwa re\AspNetIdenti ty,Pwd"
</identity>
</system.web>
</configuration>
"Dean R. Henderson" <de**@ifmail.co m> wrote in message
news:O7******** *****@TK2MSFTNG P12.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.Securit y.Principal.Win dowsIdentity.Ge tCurrent().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.Loa dFromSQLServer 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.Securit y.Principal.Win dowsIdentity.Ge tCurrent().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:Acc ess is denied.
(Microsoft Data Transformation Services (DTS) Package (80070005): Access is
denied.)
(Microsoft SQL-DMO (80004005): [SQL-DMO]CreateFile error on
'<servername>.< databasename>.L OG'. Access is denied.)
Step Error code: 80070005
Step Error Help File:sqldts80.h lp
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******** ******@tk2msftn gp13.phx.gbl...
Just checking but have you set the web.config for your Web service to use
impersonation?

<configuratio n>
<system.web>
<identity impersonate="tr ue"/>
</system.web>
</configuration>

<configuratio n>
<system.web>
<identity>
userName="regis try:HKLM\Softwa re\AspNetIdenti ty,Name"
password="regis try:HKLM\Softwa re\AspNetIdenti ty,Pwd"
</identity>
</system.web>
</configuration>
"Dean R. Henderson" <de**@ifmail.co m> wrote in message
news:O7******** *****@TK2MSFTNG P12.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.Securit y.Principal.Win dowsIdentity.Ge tCurrent().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.Loa dFromSQLServer 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%\Micros oft.NET\Framewo rk\v1.1.4322\CO NFIG\machine.co nfig points to
my <domain>\ASPUSE R 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******@onlin e.microsoft.com > wrote in message
news:3I******** ******@cpmsftng xa06.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
1197
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 a form on the application. This assembly is signed with "ControlsKey.snk" I don't want anyone else using the control from MyControl.dll except
0
2821
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 then save the data into a client machine (Intranet) as excel page using the excel component (using Excel = Microsoft.Office.Interop.Excel;) in the code. Please help me. I have wasted so many days on this.
1
15618
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 VB6 was written. I ahve already exposed some of the original classes, and they work fine. Now, I added a new ActiveX component to the windows app (in vb6). I am able to call it by late binding from within the vb6 app. itself, and from a dummy vbs...
2
2444
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 fine. However, when attempting to assing default values as designtime in the propertygrid, nothing is working on the class object. I know that I am doing it wrong, any ideas what it is? Thanks in advance
2
15722
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 WebClient COM component from C++ code it works just fine. However when we try to use that same WebClient in the same machine with following C# code: using GCRYPTOSVRLib; WEBClient WC = new WEBClient();
7
2021
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 CreateInstance returns. Any idea of what could be the problem? Thanks a lot. Here is the code segment I am using: Object target;
122
7397
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 outside of that class. This structured way allows visual tools to host components, and allows programmers to build applications and libraries visually in a RAD environment. The Java language has JavaBeans as its component model which allows Java...
1
1287
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 time in VS.NET 2005 you can not drag the component on to a web form. When I select customize toolbox and select my dll containing the component I can see the component listed and checked. After clicking OK the component is not actually available...
1
3570
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 a file to another application server upon a certain type of data change. The way it works: Anonymous user posts the form - ASP code instantiates the COM+ component which is starting using a Domain User -Calls a method that creates the comma...
0
8752
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9174
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9111
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6702
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4517
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4782
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.