web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to deal with security permissions when creating a file/folder from plugin

(0) ShareShare
ReportReport
Posted on by 645

I am trying to create a folder on my local computer from plugin' my code is :

string currentFIlePath = "C://myGeneralFile";
bool isFileInDir = Directory.Exists(currentFIlePath);
            if (!isFileInDir)
            {
                System.IO.Directory.CreateDirectory(currentFIlePath);
            }
            FileInfo fInfo = new FileInfo(currentFIlePath);
            fInfo.IsReadOnly = false;          
            return currentFIlePath;

At the line : System.IO.Directory.CreateDirectory(currentFIlePath);
I get an error

Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=' SOME NUMBER ' failed.
What can I do to solve this?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    You can refer to the below discussion.

    community.dynamics.com/.../181245

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans