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) Visual Micro fails to create a new project with dots in its name (Read 4120 times)
aleab
Newbies
*
Offline


Posts: 4
Joined: Jan 18th, 2018
Visual Micro fails to create a new project with dots in its name
Jan 18th, 2018 at 2:15pm
Print Post  
Hi, I just started using Visual Micro today and noticed that when I create a new project that has a dot in its name, Visual Micro fails to correctly initialize it (no error messages, though) and leaves me with a broken project.

This is what I have in the solution explorer. Strangely, though, the "My_Project.ino" file doesn't actually exist in the "My.Project" directory.


Also, the vMicro menu seems to be incomplete:



All of this, however, doesn't happen if I add the dots later both in the Visual Studio project name (by renaming it in VS) and in the project's directory and files (by renaming them manually and changing the project and file references in the .sln and .vcxproj files). The renamed project is built correctly.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro fails to create a new project with dots in its name
Reply #1 - Jan 19th, 2018 at 12:35pm
Print Post  
Hi,

The Arduino IDE does not allow this you should use simple names. The "File>New>Arduino Project" creates projects in the Arduino sketchbook folder so you don't want "invalid" project names in that folder if you can avoid it because arduino looks in the same place.

However, if you use File>New>Project>C++ you will find Visual Micro new templates that will work. The File>New project wizard is supported and uses standard Visual Studio names and locations.
  
Back to top
WWW  
IP Logged
 
aleab
Newbies
*
Offline


Posts: 4
Joined: Jan 18th, 2018
Re: Visual Micro fails to create a new project with dots in its name
Reply #2 - Jan 19th, 2018 at 1:36pm
Print Post  
Hi, thanks for the reply.

I'm sorry, but unfortunately you got everything wrong.

Tim@Visual Micro wrote on Jan 19th, 2018 at 12:35pm:
The Arduino IDE does not allow this you should use simple names.

You most certainly can create sketches with dots through the Arduino IDE; I just did, and it compiled correctly too.
If that's not what you meant, you should be more specific.


Tim@Visual Micro wrote on Jan 19th, 2018 at 12:35pm:
The "File>New>Arduino Project" creates projects in the Arduino sketchbook folder so you don't want "invalid" project names in that folder if you can avoid it because arduino looks in the same place.

However, if you use File>New>Project>C++ you will find Visual Micro new templates that will work. The File>New project wizard is supported and uses standard Visual Studio names and locations.

I didn't use "File>New>Arduino Project" to create the project; I used "File>New>Project>Visual C++>Arduino Project" and the resulting behaviour is what I described in my original post.

Do you mind taking an actual look at it and try to reproduce the issue?


Anyway, I found out that using a plain C++ project and custom build events suits my needs more than Visual Micro. I just wanted to let you know of this issue, though, since it doesn't seem to be caused by neither Arduino nor VS.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro fails to create a new project with dots in its name
Reply #3 - Jan 19th, 2018 at 5:09pm
Print Post  
Hi,

Thanks. Okay arduino must have updated that. So maybe now it is just a problem if the file contains spaces?  I ask because I have a lot of projects in the standard "mydocuments/arduino" with strange names. When I launch the arduino ide I get a warning notification prompt for every file that is not simple. Try it yourself.

So the general issue is different to I thought. You can create files with spaces in the name unlike the arduino ide but you can not have more than "one file extension" per file name. Does this now summarize correctly?





  
Back to top
WWW  
IP Logged
 
aleab
Newbies
*
Offline


Posts: 4
Joined: Jan 18th, 2018
Re: Visual Micro fails to create a new project with dots in its name
Reply #4 - Jan 19th, 2018 at 7:06pm
Print Post  
Hi.

Tim@Visual Micro wrote on Jan 19th, 2018 at 5:09pm:
So the general issue is different to I thought. You can create files with spaces in the name unlike the arduino ide but you can not have more than "one file extension" per file name. Does this now summarize correctly?

Slightly incorrect. I never mentioned spaces; I didn't even try to create a project with spaces with Visual Micro, though. I'm just talking about dots (or periods, points, full stops, decimal ASCII code 46). So yeah, you can not have more than "one file extension" per file name.

Tim@Visual Micro wrote on Jan 19th, 2018 at 5:09pm:
When I launch the arduino ide I get a warning notification prompt for every file that is not simple. Try it yourself.

This notification?


I tinkered a bit with the Arduino IDE (v1.8.5) and found out that file names can only contain the following characters:
  • 0-9, i.e. decimal ASCII codes 48-57
  • A-Z, i.e. decimal ASCII codes 65-90
  • a-z, i.e. decimal ASCII codes 97-122
  • -, . and _, i.e. decimal ASCII codes 45, 46 and 95

Everything else is replaced with an underscore.


Anyway, to answer the question "Why does this guy wanna use strange characters?" many may have, the reason is that the project I'm working on (or rather the Visual Studio solution) has several different sub-projects (the Arduino project is just one of them) and the naming convention I use (which is pretty popular, especially in C#; see for example CodeHub or ShareX, two of the most popular C# repositories on Github) is to prefix a sub-project with the name of its parent project separated by a dot.
So, for example, I have:
- MyProject.Core
- MyProject.UI.Windows
- ...
- MyProject.Arduino
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro fails to create a new project with dots in its name
Reply #5 - Jan 21st, 2018 at 2:21pm
Print Post  
Thanks very much for the clear info. I will implement for the next release.

We do allow spaces because Visual Studio users expect to be able to use them.

I suspect the dot issue is related to some old Visual Micro code that needs to be removed.

If you need to change the name of a project you can either delete the vs files from the project and reopen or ensure the folder name, project name and an .ino name all match.

Q: Does arduino create your sketch in a folder that also have a dot in the name?

ps: In the next release using file>New>Project will not replace invalid chars with _ but "File>New>Arduino Project" will. Dots will be supported using either.
« Last Edit: Jan 21st, 2018 at 2:24pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
aleab
Newbies
*
Offline


Posts: 4
Joined: Jan 18th, 2018
Re: Visual Micro fails to create a new project with dots in its name
Reply #6 - Jan 21st, 2018 at 3:01pm
Print Post  
Tim@Visual Micro wrote on Jan 21st, 2018 at 2:21pm:
Q: Does arduino create your sketch in a folder that also have a dot in the name?

Yes, it does.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro fails to create a new project with dots in its name
Reply #7 - Jan 21st, 2018 at 11:15pm
Print Post  
Ok thanks for all the testing
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Visual Micro fails to create a new project with dots in its name
Reply #8 - Jan 27th, 2018 at 10:11pm
Print Post  
Thanks again for the report. Periods (dots) are now supported in all places (next release over next few days). 

The period has been removed from the reserved chars list and we no longer use the visual studio "$projectname" variable instead of "$safeprojectname" to create the initial .ino file.

In previous versions of visual micro the only way to have a period in the name was to use "File>Open>Arduino Project" to open empty (or populated) source code that already had the correct .ino and folder name.
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint