VS Arduino
>> >> access denied trying to save/edit Arduino IDE examples
https://www.visualmicro.com/forums/YaBB.pl?num=1565404524

Message started by 557Torino on Aug 10th, 2019 at 2:35am

Title: access denied trying to save/edit Arduino IDE examples
Post by 557Torino on Aug 10th, 2019 at 2:35am
Just installed Visual Micro.  When I try to create a new Arduino project, the following error message appears.

Unable to create new sketch

Access to the path 'C:\Program Files (x86)\Arduino\test5' is denied.

Why is this occurring?

Title: Re: access denied
Post by Visual Micro on Aug 10th, 2019 at 10:18am
This means that you have set your sketchBook folder to the arduino program files folder. That you do not have permissions for the program files folder because vs is not running as admin. You should NOT set the sketchbook to the program files folder. In the IDE Location window clear the value that you have entered into the "SketchBook Location" then Visual Micro will prompt use the default Arduino location which is "Documents\Arduino"

Title: Re: access denied
Post by Don Winchell on Dec 1st, 2021 at 6:26pm
I am getting the same access denied message.  I tried putting in my ... documents/arduino directory.  under optional sketch book directory I have also left it blank (which is where it started).
I have spent about 45 minutes on this but just going around in circles.  I am happy to do a fresh install or whatever it will take to get this working properly.  The problem first arose when I tried to go into the visual micro explorer and use the examples from there.   I get errors that the sketch does not have access to the libraries and now I get a message that I have 5 errors, but no errors are listed.  I am just getting more and more confused and what was a working IDE,  is not really not working at all.  thanks for any help.

Title: Re: access denied
Post by Simon@Visual Micro on Dec 1st, 2021 at 7:02pm
When you open the examples from the Visual Micro Explorer, are you clicking on the *.ino file name (which opens the example from the library), or on the example name (which offers to Open Copy, or Open Original)?

The issue is actually a permissions issue when you attempt to use code from a folder that the current vs user does not have full access too. Running VS in admin mode is an alternative but using the "Open Copy" for examples is a better solution.

If Visual Studio is not run in Admin mode then it is also important to ensure that new Arduino projects are created in a folder that has "write" permissions. Normally we try to create sketches in "Documents\Arduino" for that reason (but the location is entirely up to you)

Title: Re: access denied
Post by Don Winchell on Dec 2nd, 2021 at 1:03pm
thank you, this helps.   I will try the copy mode.  but as an alternative, what is the best way to consitently open vs / vm in administrator mode?  thanks.

Title: Re: access denied
Post by Tim@Visual Micro on Dec 2nd, 2021 at 1:06pm
The "Advanced" button on the right click "Properties" of the shortcut that you click to run Visual Studio provides a "Run as adminstrator" checkbox.


Title: Re: access denied
Post by Tim@Visual Micro on Dec 4th, 2021 at 10:10pm
Good to hear that "Run as adminstrator" solved the access denied problem for you.

I moved the library discussion here for you:-
https://www.visualmicro.com/forums/YaBB.pl?num=1638571805

Examples tutorial link below. It might explain about examples and how to copy them. "Open Copy" for examples that sit below the arduino ide program files folder is the best option, otherwise it is a read only view of the example.

https://www.visualmicro.com/page/vMicro-Videos.aspx#UseExamplesInVM

You can right click any source file (or project) in the solution explorer and click "Open file location". That opens windows explorer on the location where the file or project is located. You can also select an item int he solution explorer and press F4 or "view>properties window" to see the properties of a solution explorer item in a tool window. One of the properties is the physical location (path)

The "copy example" creates a copy in a sub folder of "sketchbook/my examples".

Visual Studio has the concept of a "Solution". A Solution is simply a way to group projects into a single easy to access work space. You can have one project per solution or multiple projects per solution. Multiple solutions can contain the same project. The solution has no relation to the build process, the Solution simply allow you to organise your work. If you don't save a solution during close (when promped), then you need to use "File>Open>Project" or "File>Open>Arduino Project" to reopen the next time you start the ide.

In many cases, the File menu will also show last opened files and last opened projects. That allows you to find things more easily.



Title: Re: access denied trying to save/edit Arduino IDE examples
Post by Don Winchell on Dec 8th, 2021 at 2:58pm
thanks for your help.  I am moving on with my project as I also try to master visualmicro.  I do think it is worth mastering but I am still haveing issues with these file locations.  yeah, dumb I know but I can work around as needed for now.  the project I am working on is using libraries and they work fine, but when I opened "blink" from the application install directory and some other examples that required a library, VM can't find the library. but I will circle back at some point, right now I am wanting to move my project forward.

in any case thanks for all your help and at some point I will make "learning visual micro"  my front burner project.

all the best

Title: Re: access denied trying to save/edit Arduino IDE examples
Post by Tim@Visual Micro on Dec 8th, 2021 at 5:33pm
Ok, if you look at it again let us know and we will help you reset the visual micro settings. Ideally when starting off it is better to use the defaults. The only config setting would be the Arduino IDE location.

When you have time, follow the request in the yellow box above so that we can see what settings you have.

VS Arduino » Powered by YaBB 2.6.12!
YaBB Forum Software © 2000-2024. All Rights Reserved.