Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Assembly & Security

Assembly & Security

Scheduled Pinned Locked Moved ASP.NET
questionsysadminsecurityhelp
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anzy
    wrote on last edited by
    #1

    Hi all, I'm having a security problem with an assembly/dll that is not strong named. Here are the detail: Say I have a file {x} ... - If I use my dll to access {x} locally everthing runs fine. - If I use my dll to access {x} over the network (using UNC) it throws exception. - If I use the System.IO.File object to access {x} over the network (using UNC) everything runs fine. My conclusion is that my dll doesnt have enough permission to access network files/directories. My questions is, how do I change the permission level of a dll that's not strong named or registered? Thanks

    S M 2 Replies Last reply
    0
    • A Anzy

      Hi all, I'm having a security problem with an assembly/dll that is not strong named. Here are the detail: Say I have a file {x} ... - If I use my dll to access {x} locally everthing runs fine. - If I use my dll to access {x} over the network (using UNC) it throws exception. - If I use the System.IO.File object to access {x} over the network (using UNC) everything runs fine. My conclusion is that my dll doesnt have enough permission to access network files/directories. My questions is, how do I change the permission level of a dll that's not strong named or registered? Thanks

      S Offline
      S Offline
      sreejith ss nair
      wrote on last edited by
      #2

      hi, Do some R and D on the .NET security featues which is avilable in administrative tools. ************************** S r e e j i t h N a i r **************************

      A 1 Reply Last reply
      0
      • A Anzy

        Hi all, I'm having a security problem with an assembly/dll that is not strong named. Here are the detail: Say I have a file {x} ... - If I use my dll to access {x} locally everthing runs fine. - If I use my dll to access {x} over the network (using UNC) it throws exception. - If I use the System.IO.File object to access {x} over the network (using UNC) everything runs fine. My conclusion is that my dll doesnt have enough permission to access network files/directories. My questions is, how do I change the permission level of a dll that's not strong named or registered? Thanks

        M Offline
        M Offline
        Mike Hodnick
        wrote on last edited by
        #3

        What is the exception that is thrown? If it is not a security exception, it may not be a security issue. Another place to start is to perform a search for your exception type on Google or MSDN. Michael Hodnick www.kindohm.com blogs.kindohm.com

        A 1 Reply Last reply
        0
        • M Mike Hodnick

          What is the exception that is thrown? If it is not a security exception, it may not be a security issue. Another place to start is to perform a search for your exception type on Google or MSDN. Michael Hodnick www.kindohm.com blogs.kindohm.com

          A Offline
          A Offline
          Anzy
          wrote on last edited by
          #4

          Unfortunately that's what makes things abit harder. The exception I'm getting is: "Exception from HRESULT: 0x80040A08." I've searched online but hasn't found any clues as what this exception stands for. And from the tests I've specified in previous post, it seems security is the most likely explanation?

          1 Reply Last reply
          0
          • S sreejith ss nair

            hi, Do some R and D on the .NET security featues which is avilable in administrative tools. ************************** S r e e j i t h N a i r **************************

            A Offline
            A Offline
            Anzy
            wrote on last edited by
            #5

            Hi, I'm not quite sure what you mean by 'R and D' but I did give the administrative tools a few attempts before posting my question here. In .NET Configuration tool, I've tried adding the assembly but failed because it's 'Not a strong name'. Searched online and tried a few methods but still couldn't make my assembly 'a strong name' - currently still trying... In .Net Wizards, I've use 'Trust an Assembly' function to give my assembly 'Full Trust'. But the problem is still there. :confused:

            S 1 Reply Last reply
            0
            • A Anzy

              Hi, I'm not quite sure what you mean by 'R and D' but I did give the administrative tools a few attempts before posting my question here. In .NET Configuration tool, I've tried adding the assembly but failed because it's 'Not a strong name'. Searched online and tried a few methods but still couldn't make my assembly 'a strong name' - currently still trying... In .Net Wizards, I've use 'Trust an Assembly' function to give my assembly 'Full Trust'. But the problem is still there. :confused:

              S Offline
              S Offline
              sreejith ss nair
              wrote on last edited by
              #6

              hi, Will you try this after injucting strong name into your assembly. To create a go to .NET command promt. C:\>sn.exe -k name.snk. Now you will get a file with .snk extension in your c:\ dive. Now come back to your assembly and try to add few attribute on your AssemblyInfo.cs file which is located inside your solution file. Here you will see this information. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] What you need to do is give appropriate value for attribtes. Say [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("name.snk")] [assembly: AssemblyKeyName("C:\\name.snk")] Then compile your assemly again. Now your assemly have a strong name.:) ************************** S r e e j i t h N a i r **************************

              A 1 Reply Last reply
              0
              • S sreejith ss nair

                hi, Will you try this after injucting strong name into your assembly. To create a go to .NET command promt. C:\>sn.exe -k name.snk. Now you will get a file with .snk extension in your c:\ dive. Now come back to your assembly and try to add few attribute on your AssemblyInfo.cs file which is located inside your solution file. Here you will see this information. [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("")] [assembly: AssemblyKeyName("")] What you need to do is give appropriate value for attribtes. Say [assembly: AssemblyDelaySign(false)] [assembly: AssemblyKeyFile("name.snk")] [assembly: AssemblyKeyName("C:\\name.snk")] Then compile your assemly again. Now your assemly have a strong name.:) ************************** S r e e j i t h N a i r **************************

                A Offline
                A Offline
                Anzy
                wrote on last edited by
                #7

                Hi, Really thank you for your patience. But I've actually tried this method before but am getting an error that doesn't make sense. This is exactly what happened: Say the DLL has the name CONTROLLib: 1. Created keyfile.snk & moved it to C:\ 2. Typed in the [assembly:...] codes and changed the 'name.snk' to 'keyfile.snk' 3. Tried compiling and it threw an error: "Assembly generation failed -- Referenced assembly 'Interop.CONTROLLib does not have a strong name" But I thought the whole point of this is to make CONTROLLib.dll a strong name? Am I missing something trivial here?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups