StrongNameIdentity check only works on my developmemt machine

From: Reggie Chen (reggie_at_magnetargames.com)
Date: 10/28/03

  • Next message: myemail_at_any.where.com: "Wall-paintings, Mural and Monumental Paintings, Frescos"
    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


  • Next message: myemail_at_any.where.com: "Wall-paintings, Mural and Monumental Paintings, Frescos"

    Relevant Pages

    • Re: MVPs: static methods in interfaces. (REDEFINED)
      ... > library) every time an exception of any sort is thrown for logging ... the repeating code is not part of related classes! ... the thing that varies is this: what will we do with this string? ... public class MyEventLogger: IExceptionClass ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Soap Faults
      ... The Web Service encodes full server-side exception traces in the ... > I have had absolutely no luck working out how I can deserialize the custom ... > public string serverStackTraceId; ... > public class FdkExceptionEntry ...
      (microsoft.public.dotnet.framework.webservices)
    • Re: Nullable types in a constructor?
      ... exception case when you have just initialized your entity. ... > | public class MyBusiness ... to int and so although in the ... > | the variables in terms of scope, value, casting and exception. ...
      (microsoft.public.dotnet.languages.csharp)
    • SoapTypeAttribute (System.Xml.Serialization) Example Code Fails
      ... This is for Microsoft .NET Framework 1.1. ... copied verbatim from the MSDN docs. ... it throws an exception like so: ... public class Employee{ ...
      (microsoft.public.dotnet.framework)
    • Re: Casting of derived classes
      ... I searched in the newsgroup and I found some Information ... So sorry for the repost, ... > public class b: a { ... You should get an exception in VB.NET as well - certainly with Option ...
      (microsoft.public.dotnet.languages.csharp)