Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
DotNet
acad.assignment.mngr
academic
adonet
aspnet
aspnet.announcements
aspnet.build.controls
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
clr
compactframework
component_services
datatools
distributed_apps
drawing
faqs
framework
framework.wmi
general
internationalization
interop
languages.csharp
languages.jscript
languages.vb
languages.vb.controls
languages.vb.data
languages.vb.upgrade
languages.vc
languages.vc.libraries
myservices
odbcnet
performance
remoting
scripting
sdk
security
setup
vjsharp
vsa
webservi.enhancements
webservices
windowsforms
windowsforms.controls
winforms.databinding
winforms.designtime
xml
  
 
date: Thu, 3 Jul 2008 12:06:11 +0200,    group: microsoft.public.dotnet.security        back       


Installing the exe assembly on each and every computer just isn't an option   
I think I'm going nuts! I have a perfectly fine exe assembly built with 
Microsoft Visual C# 2008 Express Edition. When executed from my local hard 
drive it runs as exactly as expected. However, when trying to launch it from 
a network drive it just won't run. I've been googling like crazy, and 
thought I had found the solution, but oh no! One suggestion was to start the 
"Microsoft .NET Framework 1.1 Wizards" and run "Trust an Assembly". However, 
after having browsed to the assembly the wizard simply reported that it 
wasn't possible to load the assembly. So I continued my search and added 
this to the AssemblyInfo.cs file of my project:

[assembly: SecurityPermission(SecurityAction.RequestMinimum, UnmanagedCode = 
true)] // Request to run unmanaged code
[assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted = 
true)] // Request complete File IO functionality
[assembly: RegistryPermission(SecurityAction.RequestMinimum, ViewAndModify = 
"*")] // Request complet access to the registery key
[assembly: ZoneIdentityPermission(SecurityAction.RequestMinimum, Zone = 
SecurityZone.NoZone)] // Request unrestricted zone

I then recompiled the project (had to add the namespaces 
"System.Security.Permissions", "System.Security.Policy", and 
System.Security), copied it to the network drive, and tried the Microsoft 
.NET Framework 1.1 Wizards again. Same result: "not possible to load the 
assembly".

I realize this is a .NET security issue, but there must be some easy to 
understand way to get this working, or at least some tutorial that can 
explain what needs to be done. The assembly "talks" to a SQL Server 2000 
server on the network. And, as already said, it works perfectly fine when 
executed from my local hard drive.

Regards Carl Johansson
date: Thu, 3 Jul 2008 12:06:11 +0200   author:   Carl Johansson

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us