matt

matt

  • NA
  • 3
  • 0

System.IO problem Visual Studio 2008

Jan 14 2008 6:43 AM

Hello,

I have a solution with a web app and multiple class libraries - this solution was created in Visual studio 2005 but was recently converted to a VS 2008 application. Since I've done this, I can no longer perform any method or operation within the System.IO namespace - I get the following SecurityException:

 {"Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."}

Now, if I create a blank solution in 2005 (Which I still have installed) - I can use Directory.Create or File.Create just by adding Network service to the ACL for the folder I want to write to, and it doesn't cause any problems at all.

I have searched on the net for this and nothing has been useful, or worked. I have tried creating a FileIOPermission type and asserting access to the folder, but I don't really know how this works.

How can I make System.IO's static methods and classes work again in Visual Studio 2008? Have I done/not done something that I needed to do when I installed 2008 and .NET framework 3/3.5? - Am I trying to use version 2.0 assemblies when I shouldn't be?

Any help greatly appreciated....

Matt


Answers (2)