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

How to Create WinForms client and ClassLib server as one assembly?

I'd like to break up my aplication into a WinForm executable, plus a class
library containing application utility functions. But I don't want any
client other than my own application to have access to my application
library. Isn't this the point of an 'assembly'? So how can I generate these
two artifacts as belonging to the same assembly? Is this possible with
Visual Studio 2005?

Thanks!

- Joe Geretz -
Feb 12 '07 #1
6 1929
In article <eM*************@TK2MSFTNGP05.phx.gbl>, jg*****@nospam.com
says...
I'd like to break up my aplication into a WinForm executable, plus a class
library containing application utility functions. But I don't want any
client other than my own application to have access to my application
library. Isn't this the point of an 'assembly'? So how can I generate these
two artifacts as belonging to the same assembly? Is this possible with
Visual Studio 2005?
Use different assemblies and CAS (Code Access Security). There was an
overview posted in the newsgroups about a week ago:

http://tinyurl.com/2nwefz

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 12 '07 #2
I'm not sure how and why you see CAS as preventing the access. Were you
thinking programmatically? The way I read the question seemed to imply it
was other than programmatically. Perhaps OP can clarify.

As a suggestion, why not use a windows control library?

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
Professional VSTO 2005 - Wrox/Wiley
"Patrick Steele" <pa*****@mvps.orgwrote in message
news:MP************************@msnews.microsoft.c om...
In article <eM*************@TK2MSFTNGP05.phx.gbl>, jg*****@nospam.com
says...
>I'd like to break up my aplication into a WinForm executable, plus a
class
library containing application utility functions. But I don't want any
client other than my own application to have access to my application
library. Isn't this the point of an 'assembly'? So how can I generate
these
two artifacts as belonging to the same assembly? Is this possible with
Visual Studio 2005?

Use different assemblies and CAS (Code Access Security). There was an
overview posted in the newsgroups about a week ago:

http://tinyurl.com/2nwefz

--
Patrick Steele
http://weblogs.asp.net/psteele

Feb 12 '07 #3
In article <Oi**************@TK2MSFTNGP06.phx.gbl>, "Alvin Bruney
[MVP]" <some guy without an email addresssays...
I'm not sure how and why you see CAS as preventing the access. Were you
thinking programmatically? The way I read the question seemed to imply it
was other than programmatically. Perhaps OP can clarify.
To me, it sounded like he wanted to break his "utility functions" into a
separate assembly, but only wanted his WinForms app to be able to access
that assembly. The link I posted was to a similar question and showed
how to use strong keys and attributes to control who could make calls
into an assembly.

But perhaps the OP could clarify exactly what they want? ;)

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 14 '07 #4
Hi Patrick,

Yes, you state the case correctly; this is exactly what I'd like to do. I
see how CAS can acheive this, however CAS seems more of an administrative
tool than a development option. For a commercial product which will be
installed all over the place, I don't see how CAS can be a viable solution
unless CAS rules can be manipulated programmatically, or via our installer.
Would this be possible?

Thanks,

- Joseph Geretz -

"Patrick Steele" <pa*****@mvps.orgwrote in message
news:MP************************@msnews.microsoft.c om...
In article <Oi**************@TK2MSFTNGP06.phx.gbl>, "Alvin Bruney
[MVP]" <some guy without an email addresssays...
>I'm not sure how and why you see CAS as preventing the access. Were you
thinking programmatically? The way I read the question seemed to imply it
was other than programmatically. Perhaps OP can clarify.

To me, it sounded like he wanted to break his "utility functions" into a
separate assembly, but only wanted his WinForms app to be able to access
that assembly. The link I posted was to a similar question and showed
how to use strong keys and attributes to control who could make calls
into an assembly.

But perhaps the OP could clarify exactly what they want? ;)

--
Patrick Steele
http://weblogs.asp.net/psteele

Feb 16 '07 #5
In article <uP**************@TK2MSFTNGP06.phx.gbl>, jg*****@nospam.com
says...
Hi Patrick,

Yes, you state the case correctly; this is exactly what I'd like to do. I
see how CAS can acheive this, however CAS seems more of an administrative
tool than a development option. For a commercial product which will be
installed all over the place, I don't see how CAS can be a viable solution
unless CAS rules can be manipulated programmatically, or via our installer.
Would this be possible?
I believe the link I posted suggested that you simply strong-name your
assemblies that want to call your utility assembly. Then, your utility
assembly methods (or maybe the whole assembly?) has an attribute to
demand a specific strong-name public key from all callers. Since only
your assemblies are signed with the proper key, they will be the only
ones allowed to call the utility assembly.

I don't think you'll need to manipulate any CAS rules for that.

--
Patrick Steele
http://weblogs.asp.net/psteele
Feb 16 '07 #6
Thanks Patrick,

Yes, that article mentions StrongNameIdentityPermissionAttribute which will
do the trick for me. Further explanation at:
http://www.morganskinner.com/Article...ityPermission/

Thanks,

- Joe Geretz -

"Patrick Steele" <pa*****@mvps.orgwrote in message
news:MP************************@msnews.microsoft.c om...
In article <uP**************@TK2MSFTNGP06.phx.gbl>, jg*****@nospam.com
says...
>Hi Patrick,

Yes, you state the case correctly; this is exactly what I'd like to do. I
see how CAS can acheive this, however CAS seems more of an administrative
tool than a development option. For a commercial product which will be
installed all over the place, I don't see how CAS can be a viable
solution
unless CAS rules can be manipulated programmatically, or via our
installer.
Would this be possible?

I believe the link I posted suggested that you simply strong-name your
assemblies that want to call your utility assembly. Then, your utility
assembly methods (or maybe the whole assembly?) has an attribute to
demand a specific strong-name public key from all callers. Since only
your assemblies are signed with the proper key, they will be the only
ones allowed to call the utility assembly.

I don't think you'll need to manipulate any CAS rules for that.

--
Patrick Steele
http://weblogs.asp.net/psteele

Feb 18 '07 #7

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

Similar topics

4
by: Julia | last post by:
Hi, My system uses Mail Client component the Mail Client can either wrap exchange or pop3\SMTP server functions in order to do that I declared an abstract named class MailClient and create...
11
by: John Boghossian | last post by:
I know this isn´t spot on for this group, but the problem relates to an asp.net project i am working on. I am trying to develop an windows forms control to be used in IE in an intranet solution....
2
by: John Alesse | last post by:
Hi, I've created a very simple winforms control using the c# wizard in VS .net 2003 that is nothing but a System.Windows.Forms.UserControl. There are no other controls on the form It takes IE 12...
5
by: Segfahlt | last post by:
I need a little help here please. I have 2 win forms user controls in 2 different projects that I'm hosting in 2 different virtual directories. The controls have been test and operate okay in...
1
by: Pieter | last post by:
Hi, In my application VB.NET 2005 application I placed a ReportViewer, and link it to a server-report: Me.ReportViewer1.ProcessingMode = Microsoft.Reporting.WinForms.ProcessingMode.Remote...
5
by: brian.wilson4 | last post by:
Our group is currently comparing winforms vs webforms.....app is Corp LAN based - we have control of desktops.....Below is pros and cons list we have come up with - if anything strikes you as...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
0
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi mister, I have an Winforms app (Client) and Web app + WCF Services + Windows Services (Server). In server, I have installed SQL SERVER 2000. Now, I want create a installer (MSI.exe or...
1
by: =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post by:
Hi mister, I have an Winforms app (Client) and Web app + WCF Services + Windows Services (Server). In server, I have installed SQL SERVER 2000. Now, I want create a installer (MSI.exe or...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.