Click here to Skip to main content
15,913,487 members
Home / Discussions / C#
   

C#

 
GeneralRe: Folder Browser Strangeness Pin
Russell Jones2-Jun-04 22:05
Russell Jones2-Jun-04 22:05 
GeneralRe: Folder Browser Strangeness Pin
Stefan Troschuetz2-Jun-04 23:10
Stefan Troschuetz2-Jun-04 23:10 
GeneralRe: Folder Browser Strangeness Pin
Russell Jones3-Jun-04 0:30
Russell Jones3-Jun-04 0:30 
GeneralTask Switching while in Full-Screen mode Pin
strunks2-Jun-04 6:02
strunks2-Jun-04 6:02 
GeneralRe: Task Switching while in Full-Screen mode Pin
Heath Stewart2-Jun-04 6:39
protectorHeath Stewart2-Jun-04 6:39 
GeneralRe: Task Switching while in Full-Screen mode Pin
strunks2-Jun-04 7:01
strunks2-Jun-04 7:01 
GeneralC# and MC++ Pin
Orhun Birsoy2-Jun-04 6:01
Orhun Birsoy2-Jun-04 6:01 
GeneralRe: C# and MC++ Pin
Heath Stewart2-Jun-04 6:31
protectorHeath Stewart2-Jun-04 6:31 
If you want your MC++ assembly to be used only by another assembly, then use a StrongNameIdentityPermissionAttribute at the assembly level. This also means you should sign your assembly, which is a good idea anyway. To generate a key pair, use:
sn.exe -k KeyFile.snk
Use this key pair for all your assemblies or for assemblies for a product. For more information about the benefits of signing an assembly (to give it a strong name), see the .NET Framework SDK documentation.

Then use the file path (relative to the target directory or an absolute path) in the [assembly: AssemblyKeyFileAttribute] for your projects.

Assuming your C# project is called MyCSharpAssembly.dll with version 1.0.0.0 and a public key (you can get this by running sn.exe -Tp MyCSharpAssembly.dll, using the larger number), add an assembly-level attribute to your MC++ assembly like so:
[assembly: StrongNameIdentityPermission(
  SecurityAction.RequestMinimum,
  Name="MyCSharpAssembly",
  Version="1.0.0.0", // Optional
  PublicKeyToken="0123456789abcdef...........")]
The public key token is very long. You can copy this and concatenate lines yourself. See the documentation for the StrongNameIdentityPermissionAttribute in the .NET Framework SDK for more information and a sample or two.

If MC++ can compile a .NET module (the module contains type metadata and the IL), which I don't remember off hand, you can compile a module and then add it to the C# assembly (along with the module containing the IL from the C# source files) using the csc.exe command-line compilers along with the /addmodule switch.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: C# and MC++ Pin
Orhun Birsoy2-Jun-04 7:13
Orhun Birsoy2-Jun-04 7:13 
GeneralRe: C# and MC++ Pin
Heath Stewart2-Jun-04 9:01
protectorHeath Stewart2-Jun-04 9:01 
QuestionSystemPen ? Pin
ongo2-Jun-04 4:13
ongo2-Jun-04 4:13 
AnswerRe: SystemPen ? Pin
Mazdak2-Jun-04 4:35
Mazdak2-Jun-04 4:35 
GeneralRetrieving Username Pin
briby2-Jun-04 3:23
briby2-Jun-04 3:23 
GeneralRe: Retrieving Username Pin
Heath Stewart2-Jun-04 3:38
protectorHeath Stewart2-Jun-04 3:38 
GeneralRe: Retrieving Username Pin
Atilla Ozgur2-Jun-04 3:57
Atilla Ozgur2-Jun-04 3:57 
GeneralRe: Retrieving Username Pin
briby3-Jun-04 0:02
briby3-Jun-04 0:02 
Generalhiding emails Pin
robmays2-Jun-04 2:40
robmays2-Jun-04 2:40 
GeneralRe: hiding emails Pin
Hesham Amin2-Jun-04 4:24
Hesham Amin2-Jun-04 4:24 
GeneralRe: hiding emails Pin
robmays2-Jun-04 4:29
robmays2-Jun-04 4:29 
GeneralOnClosing Pin
thomasa2-Jun-04 2:22
thomasa2-Jun-04 2:22 
GeneralRe: OnClosing Pin
LongRange.Shooter2-Jun-04 2:45
LongRange.Shooter2-Jun-04 2:45 
GeneralRe: OnClosing Pin
JackMartinz2-Jun-04 6:50
JackMartinz2-Jun-04 6:50 
GeneralRe: OnClosing Pin
LongRange.Shooter3-Jun-04 2:21
LongRange.Shooter3-Jun-04 2:21 
GeneralRe: OnClosing Pin
Tom Larsen2-Jun-04 4:37
Tom Larsen2-Jun-04 4:37 
GeneralRe: OnClosing Pin
Heath Stewart2-Jun-04 4:48
protectorHeath Stewart2-Jun-04 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.