StrongNameIdentity check only works on my developmemt machine
From: Reggie Chen (reggie_at_magnetargames.com)
Date: 10/28/03
- Previous message: Doug Bahr: "Re: Help on Creating a Custom Permission"
- Next in thread: Reggie Chen: "Re: StrongNameIdentity check only works on my developmemt machine"
- Reply: Reggie Chen: "Re: StrongNameIdentity check only works on my developmemt machine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Tue, 28 Oct 2003 07:17:44 GMT
Hi,
I have a very starnge situation which StrongName Identity verification only
works on the machines that installed with Visual Studio .NET.
Here are the two simple C# files I have.
The strong named assembly "test2.cs"
-------------------------------------------------
using System.Security.Permissions;
using System.Reflection;
using System.Runtime.CompilerServices;
namespace test2
{
public class test123
{
[method:StrongNameIdentityPermissionAttribute(SecurityAction.LinkDemand,
PublicKey =
"00240000048000009400000006020000002400005253413100040000010001005d354ca73d8
560" +
"c3200102cbbb029e23d01eb9f8e56dff38606f37eb8a61190e2440903827badfbf47c915bd9
b56" +
"dbf60adb42c68faa944361d9974863f63add994195767646edcf2fedc1296297d48c4e55656
6c9" +
"a250086983f51438fde6b4d92ea623cc22e1dad53ba04f1ffc46e1d1af482ec15efe19e6322
70c" +
"70a898b0"
)
]
public int m1()
{
return 121;
}
}
}
-----------------------------------
The calling test program "mytest.cs"
------------------------------------------
using System;
using System.Reflection;
using System.Runtime.CompilerServices;
class test1
{
static void Main()
{
test2.test123 t = new test2.test123();
int i = t.m1();
Console.WriteLine("test!" + i.ToString());
}
}
-----------------------------------------
Batch file "compile.bat" to compile the two files
---------------------------------
csc /t:library test2.cs
csc /t:exe /r:test2.dll mytest.cs
******************************
Since mytest.cs is not signed, I expect mytest.exe will throw out a security
exception. It does throw the exception on my development machine, but not
with the computer that just installed with .NET framework 1.1!
I am pulling my hairs off for the situation. Please help!!! What cause a
simple StrongName test like that works on one machine but not the other?
Regards,
Reggie
- Previous message: Doug Bahr: "Re: Help on Creating a Custom Permission"
- Next in thread: Reggie Chen: "Re: StrongNameIdentity check only works on my developmemt machine"
- Reply: Reggie Chen: "Re: StrongNameIdentity check only works on my developmemt machine"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|