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
Normal Topic Problem not compiling after renaming project (Read 5092 times)
JohnAm
Junior Member
**
Offline


Posts: 14
Joined: Jul 25th, 2015
Problem not compiling after renaming project
Aug 18th, 2016 at 9:25pm
Print Post  
Hi,

I tried to rename a project and it stopped compiling. After this i made a copy of the project and then renamed manually.

Now i get this:


System.NullReferenceException: Object reference not set to an instance of an object.
   at Visual.Micro.MiroAppAPI.SketchCode.countLines(String what)
   at Visual.Micro.MiroAppAPI.SketchCode.getLineCount()
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, PdePreprocessor preprocessor, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder.preprocess(String buildPath, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder._build(String lbuildPath, Boolean verbose, Boolean PreProcessOnly)
   at Visual.Micro.MiroAppAPI.SketchBuilder._build(Boolean verbose)
   at Visual.Micro.MiroAppAPI.SketchBuilder.build(Boolean verbose)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp._CompileDo(Project oProject, Boolean IsDebugStartCommand, Boolean isRebuild)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.CompileDo(Project oProject, Boolean IsDebugStartCommand, Boolean isRebuild)
   at Visual.Micro.Visual.Studio.Arduino.AddInApp.OnBeforeCommandEvent(String sGuid, Int32 ID, Object CustomIn, Object CustomOut, Boolean& CancelDefault)


Any ideas?
  
Back to top
 
IP Logged
 
JohnAm
Junior Member
**
Offline


Posts: 14
Joined: Jul 25th, 2015
Re: Problem not compiling after renaming project
Reply #1 - Aug 18th, 2016 at 9:35pm
Print Post  
Ok, it seems i have to start from a clean project created via VM to get different names. 
No prob.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem not compiling after renaming project
Reply #2 - Aug 18th, 2016 at 9:38pm
Print Post  
Hi,

If you right click and rename the project_name.ino visual micro should handle the rename for you.

There is some new caching that might become confused after the rename in which case restart the ide (still to be tested)

The project name, containing folder and a .ino file must all share the same name otherwise visual micro will not attempt to handle the compilation.
  
Back to top
WWW  
IP Logged
 
JohnAm
Junior Member
**
Offline


Posts: 14
Joined: Jul 25th, 2015
Re: Problem not compiling after renaming project
Reply #3 - Aug 19th, 2016 at 11:16am
Print Post  
Thanks

I suppose the easiest procedure is to create a new project via the VM menu and then copy paste the code to the .ino, and include any .h or .c files the project is using. I did that and it works fine. Otherwise (trying to rename from inside AT7) leads to names inconsistency and makes AT7 or/and VM go nuts.

  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem not compiling after renaming project
Reply #4 - Aug 19th, 2016 at 11:46am
Print Post  
Did try what I said by renaming the project_name.ino? Did you see the visual micro workflow that executes when you do that?
  
Back to top
WWW  
IP Logged
 
JohnAm
Junior Member
**
Offline


Posts: 14
Joined: Jul 25th, 2015
Re: Problem not compiling after renaming project
Reply #5 - Aug 20th, 2016 at 3:01pm
Print Post  
Hm, no i haven't tried to be honest. When i renamed the project, i don't remember the sequence of the actions i did, perhaps i also renamed the folder from the outside. or the .ino file. I can't be sure. 

It went mad and i' m still a bit anxious about messing with Atmel studio so when i found how to do it properly i didn't tried again.

Everything works fine, VM is great. Now i moved again to my i-5 laptop and it is way more quick than my i-3. 

I program my c++ interface in vs2008 express and the 6 arduino (3 due + 3 uno) with Atmel Studio and Visual Micro.

Everything is rock solid...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Problem not compiling after renaming project
Reply #6 - Aug 20th, 2016 at 3:16pm
Print Post  
Ok great to hear that thanks.

Don't worry to much about renaming. It's easier than it might seem. as long as project, project folder and an .ino file have the same name visual micro should sort itself out. Atmel studio keeps an internal project name so you also have to use the solution explorer to right click and rename a project (not just rename of .ccproj)

Another thing that might help show the simplicity of the visual studio design is to use notepad to edit/view the .sln file. You will see it simply points to one or more project files. If you also use notepad to edit cppproj or the vs vcxproj files they contain the relative paths to the included files. You can copy/edit these files if need be.
  
Back to top
WWW  
IP Logged
 
JohnAm
Junior Member
**
Offline


Posts: 14
Joined: Jul 25th, 2015
Re: Problem not compiling after renaming project
Reply #7 - Aug 20th, 2016 at 5:19pm
Print Post  
I 'll check this out. Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint