473,770 Members | 3,983 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating a Wrapper

Hi
I am currently developing a web application that has a third party
component on it. The third party component is a graph component from
Xceed that uses a number of dlls. The problems occur when we attempt
to deploy the application and the third party component causes a
security exception.

Description: The application attempted to perform an operation not
allowed by the security policy. To grant this application the required
permission please contact your system administrator or change the
application's trust level in the configuration file.
Exception Details: System.Security .SecurityExcept ion: Security error.

When I asked our web hosts about this, i was told the following:

Our senior engineers have advised that you need a wrapper for this
assembly. The wrapper assembly should be strong-named, with the APTCA
setting set.
This wrapper assembly will then need to be added to the GAC.
Once this is done, you should be able to use the component from an
assembly without the calling assembly requiring full trust.

I am very new to this and I have no idea what they are talking about.
If someone could please explain to me what they want me to do, it
would be greatly appreciated.
Thank you very much
Stephen van Rees
Nov 19 '05 #1
4 1934
Stephen,

Our senior engineers have advised that you need a wrapper for this
assembly.
A wrapper is simply another layer or link in the calling chain. In this
case, they're asking that you create a class library, that has the sole
responsibility of calling your third party software. So if there's a method
on this software saying CreateGrapth (...), then you should create a method
called GrapthCreate(.. .) (or anything similar), that calls the third part
CreateGraph with the parameters it is passed.

The wrapper assembly should be strong-named, with the
APTCA setting set.
Now we're finding out why they suggest the wrapper. APTCA simply means
AllowPartiallyT rustedCallersAt tribute. Read up to find out more...
googled:
http://www.google.co.uk/search?hl=en...ttribute&meta=
MSDN:
http://msdn.microsoft.com/library/de...ClassTopic.asp
[beware of line wraps]

This wrapper assembly will then need to be added to the GAC.
The GAC is the Global Assembly Cache. This is a cache held by the .Net
framework that simply means the object is registered at some location, and
then any .Net application can create and use objects that exist with in it
without knowing the location. Again more reading on your part would be a
good idea.
http://www.codeproject.com/dotnet/DemystifyGAC.asp
googled:
http://www.google.co.uk/search?sourc...soft%2Ecom+GAC
[beware of line wraps]

Once this is done, you should be able to use the component from an
assembly without the calling assembly requiring full trust.


There basic logic is that this wrapper will allow callers who aren't
entirely trusted to call it (ie, your stuff), but that this wrapper will be
fully trusted by the 3rd party software. Think of it as creating a
mediator...

Let me know if you need anymore help.

Dan.
Nov 19 '05 #2
Hi Dan,
Thank you very much for your help. I think I understand most of this
now. My only remaining query relates to writing the wrapper.
As this component is currently placed on the form at design time, do I
have to generate and position it on the form at run time using my
wrapper class?
And finally, is this a common problem with all third party components
and web hosts, it seems a bit strange that I have to go to such lengths
to use
a commerical product?
Thank you once again
Stephen

Nov 19 '05 #3
Stephen,

It does seem a little strange I must admit. The other thing I would try is
going back to the supplier of the application to see if they've heard of
this problem before.
Have you seen this? http://www.xceedsoft.com/support/FAQ.asp?Pid=676&Gen=0

In terms of writing the wrapper, the fact it's a control means that in the
initial step of creating the project, you should create a "Web Control
Library".
From here add a reference to the Xceed package, and finally change the class
to inherit from the control, rather than from
System.Web.UI.W ebControls.WebC ontrol...
After this, you simply need to make the wrapper strong named so it can be
loaded into the GAC (google on strong named and GAC), then change the APTCA
setting to see if this works.
This should then allow you to drop the wrapper on the dialog you want...

Remember this is doing only what the engineers at your provider have said to
do, so you may need to speak to the relevant people to get this all working.
<sv******@hotma il.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
Hi Dan,
Thank you very much for your help. I think I understand most of this
now. My only remaining query relates to writing the wrapper.
As this component is currently placed on the form at design time, do I
have to generate and position it on the form at run time using my
wrapper class?
And finally, is this a common problem with all third party components
and web hosts, it seems a bit strange that I have to go to such lengths
to use
a commerical product?
Thank you once again
Stephen

Nov 19 '05 #4
Alright, I will give all that a go
Thanks very much for all your help!
Stephen

Nov 19 '05 #5

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

Similar topics

4
2779
by: Edvard Majakari | last post by:
Hi, I was wondering what would be the most elegant way for creating a Python class wrapper for a command line utility, which takes three types of arguments: 1. options with values (--foo=bar) 2. boolean options (--squibble) 3. data lines (MUNGE:x:y:z:frob)
0
2225
by: Brandon Langley | last post by:
I'm trying to utilize some code written in a C# class library (DLL) via a C++ wrapper. The reason for the C++ wrapper is to make the code available from within a Wise dialog, which only allows calls to WIN32 DLL functions. In my testbed, I have C#.DLL and C#Wrapper.DLL sitting in my temp directory. I am trying to invoke them from Wise, which runs from the CD. When I call the DLL function, I get a System.IO.FileNotFoundException. ...
4
1672
by: sm | last post by:
Hi, What is the syntax to create an instance of a class present in a wrapper dll? Thanks in advance
2
1553
by: Amongin Ewinyu | last post by:
Hi, I'm trying to create a Windows service programmatically that will do the following: - When a user logs on, it will automatically run a service that uses BITS (Background Intelligent Transfer Service) to check for the most current version of a file and downloads this version. I have a wrapper class thats imported as a reference in order for me to be
1
2532
by: CES | last post by:
All, I was wondering if someone could point me to a tutorial on creating & accessing functions from within a wrapper function. I've created a group of functions related to a timer event. All works well until I try to enclose these functions into a class like structure ie: function dTimer(div){ //Insert the Javascript Code Below startTimer(); }
9
2340
by: ma740988 | last post by:
Assume I have a vendor file called ' vendor.h'. Within the file there's two methods memalign and cforward. It is my understanding that the memalign function is a wrapper around malloc. cforward is just a vendor function for doing forward FFT's. At issue CSL_COMPLEX is 'cumbersome' to work with. As a result I created a wrapper. So now - given the pseudo code. #include <iostream> #include <complex> #include <vector>
13
2071
by: Jeff | last post by:
Hey ASP.NET 2.0 I'm designing the DAL (Data Access Layer) of my web application. I want every table to have a strongly typed object as wrapper arround the table. So that for example if the DAL found 3 records in the table then it sends a generic collection of 3 objects to the BLL (Business Logic Layer). But here is the problem:
0
7805
by: PracticalApps | last post by:
I looked to find a canned solution to create a Word document in my application and just couldn't find anything that just gets to the point. I would think, and I may be making too strong of an assumption here, that anyone looking for this kind of solution would just want a simple example that they can work from and expand upon. In my case, I just want to output a new Word document. I found that creating a simple wrapper class would make this...
3
1836
by: Anish Chapagain | last post by:
Hi.. What will be the best approach for creating wrapper in python language for the API programmed in C. I came across SWIG, but am having problem as the generated .pyd file is not displaying any output... so, how feasible will be to use ctype for python..it is possible in C to create every c file a dll and link with necessary other one..??
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
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
10228
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...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
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,...
1
7415
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
5312
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...
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
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.