|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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 - In article <eMVvWkjTHHA.***@TK2MSFTNGP05.phx.gbl>, jgeretz@nospam.com
says... > I'd like to break up my aplication into a WinForm executable, plus a class Use different assemblies and CAS (Code Access Security). There was an > 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? overview posted in the newsgroups about a week ago: http://tinyurl.com/2nwefz 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? -- Show quoteHide quoteRegards, 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" <patr***@mvps.org> wrote in message news:MPG.203998da2fc84f689896f4@msnews.microsoft.com... > In article <eMVvWkjTHHA.***@TK2MSFTNGP05.phx.gbl>, jgeretz@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 In article <OiOWIAwTHHA.5***@TK2MSFTNGP06.phx.gbl>, "Alvin Bruney
[MVP]" <some guy without an email address> says... > I'm not sure how and why you see CAS as preventing the access. Were you To me, it sounded like he wanted to break his "utility functions" into a > thinking programmatically? The way I read the question seemed to imply it > was other than programmatically. Perhaps OP can clarify. 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? ;) 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 - Show quoteHide quote "Patrick Steele" <patr***@mvps.org> wrote in message news:MPG.203ceb22fff768be9896fa@msnews.microsoft.com... > In article <OiOWIAwTHHA.5***@TK2MSFTNGP06.phx.gbl>, "Alvin Bruney > [MVP]" <some guy without an email address> says... >> 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 In article <uPXJ5ifUHHA.1***@TK2MSFTNGP06.phx.gbl>, jgeretz@nospam.com
says... > Hi Patrick, I believe the link I posted suggested that you simply strong-name your > > 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? 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. Thanks Patrick,
Yes, that article mentions StrongNameIdentityPermissionAttribute which will do the trick for me. Further explanation at: http://www.morganskinner.com/Articles/StrongNameIdentityPermission/ Thanks, - Joe Geretz - Show quoteHide quote "Patrick Steele" <patr***@mvps.org> wrote in message news:MPG.203fe2364d71835f989709@msnews.microsoft.com... > In article <uPXJ5ifUHHA.1***@TK2MSFTNGP06.phx.gbl>, jgeretz@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
Other interesting topics
Disable a text box when it's not adding new row?
Possible help for Newbie VS 2003, false data concurrency error ImageList performance problem Dataset and scalability issue vs 2003 to vs 2005 conversion problem Strange concurrency error Reason for Application.ThreadExit Render window to video port? Windows CBT Hooks (Help!) |
|||||||||||||||||||||||