Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET C# running application from UNC results in error

I have an application which does not read ANY files from the local disk or does not try to write anything.

It runs perfectly on the local filesystem, but it needs to run on a few 100 workstations, so I put it on a share on a Win2003 server.

But when I try to start it on a XP workstation from the UNC:

system.io.fileloadexception

What can be the issue here?

like image 676
Roger Far Avatar asked Mar 01 '10 18:03

Roger Far


People also ask

Is C# and .NET same?

C# is a programming language and . NET is a framework.

Is .NET written in C?

NET Framework is written in C++ and C#.

Does .NET support C?

NET Languages are computer programming languages that are used to produce programs that execute within the Microsoft . NET Framework. Microsoft provides several such languages, including C#, Visual Basic . NET, and C++/CLI.

Is .NET basically C#?

In summary, C# is a programming language, while . NET is a developer platform. After comparing C# vs . NET, it is clear that both are essential for application development.


1 Answers

The issue is that the XP machine is likely running an earlier version of .Net 2.0. Up until 3.5 SP1 it was a violation of CLR security policies to run a .Net application from an UNC share. To do so you must tweak the CAS (Code Access Security) policy on the local machine. Starting with 3.5SP1 this requirement was removed.

More Details:

  • http://geekswithblogs.net/robz/archive/2008/08/19/.net-framework-3.5-sp1-no-more-need-for-caspol-on.aspx
like image 83
JaredPar Avatar answered Sep 24 '22 00:09

JaredPar