473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

'System.IO.FileLoadException' occurred in Unknown Module.

Hi, the only code that is present in main is given below

string filePath;
FileIOPermission FilePermission = new FileIOPermission(PermissionState.Unrestricted);
FilePermission.AllLocalFiles = FileIOPermissionAccess.AllAccess;
StreamWriter SW;
if (args.Length == 0)
{
filePath = string.Copy("C:\\miginfo.txt");
SW = File.CreateText(filePath);
}

this works if I run it locally, but from a network share it gives the following error.

An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module.

Additional information: Could not load file or assembly 'test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)

I had googled a lot and the solutions don't work for me. I dont know why.

1) "Project->Properties->Security->Enable clickonce ....->This is a full trust application" enabled.
2)Added [assembly: FileIOPermission(SecurityAction.RequestMinimum, Unrestricted =
true)] in assemblyinfo.cs

3) Run the command successfully CasPol.exe -m -ag 1.2 -url file://S\* FullTrust
4) Changed All_code properties->Permission set to full trust
5) Created a new code group with the below properties

Added Url: file://192.168.48.125/SHARED/*. with the

Assembly evidence must match this membership condition to belong to the code group: Url: file://192.168.48.125/SHARED/*.

Assemblies matching the membership condition are granted this permission set at the current policy level: FullTrust.

Permission Set Description:
Allows full access to all resources

Still it doesn't work, Im at my wits end. Please help.
Jul 31 '08 #1
1 4765
Plater
7,872 Expert 4TB
You need to change the .NET security settings on your computer to allow .NET programs to run from a networked computer.
I think that will help solve your problem.
Jul 31 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: majed | last post by:
hi I use VS.NET 2003 every time i try to start (debug,Release) any application i get the folowing exceptio System.NullreferenceException occurred in UnKnown Modul befor the form showsup on the...
1
by: Goyit | last post by:
I have just completed a project and everything was run nicely and then I decided to change the project name, assembly name, and add another Blank Solution and add the project into that new...
6
by: Ken Varn | last post by:
I am trying to remote debug a C# application but the debugger is reporting the following exception: An unhandled exception of type 'System.IO.FileLoadException' occurred in Unknown Module....
1
by: Fabian Aichele | last post by:
Hello! When trying to use Novell's C# LDAP library (from http://www.novell.com/coolsolutions/cooldev/features/a_net_cplus_ldap_library_cdev.html) the following exception occurs as soon as I try...
3
by: nick | last post by:
The program runs well on Local harddisk. But it always popup the exception if I run it on Netware mapping disk. After debugger say there is no source code on the exception. Also the following error...
2
by: Bern McCarty | last post by:
I am getting the following error when one of my mixed-mode assemblies trys to call a method in another. Both are strongly named, neither are in the GAC. Execution is in a non-default AppDomain in...
0
by: Yueming | last post by:
Hello, I am using Visual Studio .NET 2003 (7.1) C++ on Windows XP. I created a project using Windows Service (.NET). I used all the default except my project name. After the project is...
1
by: Rui Macdonald | last post by:
I trying some asp from angGoGo PhotoControl and when I star it on my computer always gives the following message, Can you please help me? :-( ------------------------------------------- ...
2
by: Doug | last post by:
I've installed ASP.NET onto our web server (Win2k/unsure of IIS version) this morning. I created a simple ASPX page in Notepad that writes out an asp:Label control to the page and dynamically...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.