Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Opening an Arduino project fails with invalid path error (Read 3472 times)
mael
Newbies
*
Offline


Posts: 4
Joined: Nov 24th, 2018
Opening an Arduino project fails with invalid path error
Nov 24th, 2018 at 5:00pm
Print Post  
Hi,

After installing Visual Micro Extension for VS, restarting VS, then choosing File|Open|Arduino Project, I get an invalid path error.

The reason could be that my (user) name contains a "special" character "ë". But this should usually not be a problem, since it works with VS and the Arduino IDE.

Here is the stack trace:

Translation of the German error message is:
"The path has an invalid format."

Error during processing of the command. Please review or post the stack trace in the www.visualmicro.com forumDer Pfad hat ein ungültiges Format. (Visual.Micro.Visual.Studio.Arduino.Helper.SolutionOpenArduinoSketch)
System.ArgumentException: Der Pfad hat ein ungültiges Format.
   bei System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   bei System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
   bei System.IO.Path.GetFullPathInternal(String path)
   bei System.IO.DirectoryInfo.Init(String path, Boolean checkHost)
   bei System.IO.DirectoryInfo..ctor(String path)
   bei Visual.Micro.MiroAppAPI.MCUApplication.getSketchbookFolder()
   bei Visual.Micro.MiroAppAPI.SketchUtils.OpenSketchFilePicker(MCUApplication mcuApp)
   bei Visual.Micro.Visual.Studio.Arduino.AddInApp.ExecCmd(String commandName)
« Last Edit: Nov 24th, 2018 at 5:02pm by mael »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Opening an Arduino project fails with invalid path error
Reply #1 - Nov 24th, 2018 at 8:03pm
Print Post  
Questions

1)
What happens if you use "file>new>project>c++.arduino project". Does that work okay?

2)
Can you confirm that "IDE Locations > Sketch Book Folder" is empty/unset?
« Last Edit: Nov 24th, 2018 at 8:09pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
mael
Newbies
*
Offline


Posts: 4
Joined: Nov 24th, 2018
Re: Opening an Arduino project fails with invalid path error
Reply #2 - Nov 24th, 2018 at 9:49pm
Print Post  
Tim@Visual Micro wrote on Nov 24th, 2018 at 8:03pm:


1)
What happens if you use "file>new>project>c++.arduino project". Does that work okay?

A window with this message appears:
"Please configure the location of arduino your sketchbook folder by running the arduino.exe once"
I ran arduino.exe again, no change. But I have used the Arduino IDE already in the past, so that was to be expected.

Tim@Visual Micro wrote on Nov 24th, 2018 at 8:03pm:

2)
Can you confirm that "IDE Locations > Sketch Book Folder" is empty/unset?

"Optional sketchbook location" is empty as recommended.

The IDE folder location is "C:\Program Files (x86)\Arduino" (which is correct).

The IDE version is 1.8.5 with installed TeensyDuino 1.44.
  
Back to top
 
IP Logged
 
mael
Newbies
*
Offline


Posts: 4
Joined: Nov 24th, 2018
Re: Opening an Arduino project fails with invalid path error
Reply #3 - Nov 24th, 2018 at 9:56pm
Print Post  
Probably a related error. If I press rescan in the Visual Micro Explorer and then select "Arduino 1.6/1.8", I get this error:
"Error(s) were found loading some package index files."

"Unable to load ide built-in hardware
Create tool preferences: arduino16x
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei r indexer)
   bei Visual.Micro.MiroAppAPI.MCUApplication.initPackages()"
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Opening an Arduino project fails with invalid path error
Reply #4 - Nov 24th, 2018 at 10:17pm
Print Post  
This might be a permissions issue. Did you try running the vs ide with administrator permission?

In the arduino ide file>preferences what is the sketch book folder set to?
  
Back to top
WWW  
IP Logged
 
mael
Newbies
*
Offline


Posts: 4
Joined: Nov 24th, 2018
Re: Opening an Arduino project fails with invalid path error
Reply #5 - Nov 24th, 2018 at 11:48pm
Print Post  
The sketch folder is set to:
C:\Users\Maël\Documents\Arduino

(which I have normal access to, since I am logged in under this name.)

Does VS (or rather the plugin) need to change something in the Program Files directory?
It would be good to know before trying to run it as administrator, to avoid that the install gets damaged.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Opening an Arduino project fails with invalid path error
Reply #6 - Nov 24th, 2018 at 11:52pm
Print Post  
no it does not need to change program files

the c:\users\[your name]\appdata\local\arduino15 folder is important

you could rename it then restart visual micro to see if there is a difference.

do you see a list of boards in the board list?
  
Back to top
WWW  
IP Logged
 
mael
Newbies
*
Offline


Posts: 4
Joined: Nov 24th, 2018
Re: Opening an Arduino project fails with invalid path error
Reply #7 - Nov 25th, 2018 at 11:25am
Print Post  
I renamed it and then it works (a new folder of the same name is created).
But the new folder is missing the folders packages and staging.
There is also no preferences.txt

library_index.json has more than 24000 differences, so it's not practical to find out what might be causing it.

Any ideas?

P.S.: Adding more debugging information when errors are thrown might help to narrow down the cause faster. Such as the actual strings that triggered the issue.
« Last Edit: Nov 25th, 2018 at 11:34am by mael »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Opening an Arduino project fails with invalid path error
Reply #8 - Nov 25th, 2018 at 1:19pm
Print Post  
It was a good test. The index files are re-downloaded when you click "check for updates" in board or library manager. The preferences.txt is auto created when you run the arduino ide. There is nothing that is changed specifically for your machine in the arduino15 folder.

The error happens because of one of the board support .json urls you have added. I can prevent these errors in the next release but if you give me your index file list I can also find the issue.

You should see your board support list in arduino ide "file > preferences" unless you installed packages via the visual micro board manager then see IDE Locations window
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint