473,385 Members | 1,942 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,385 software developers and data experts.

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.SecurityException: 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 1904
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
AllowPartiallyTrustedCallersAttribute. 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.WebControls.WebControl...
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******@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.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
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)...
0
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...
4
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
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...
1
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...
9
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...
13
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...
0
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...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.