Assembly & Security
-
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
-
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
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 **************************
-
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
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
-
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
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?
-
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 **************************
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:
-
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:
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 **************************
-
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 **************************
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?