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) VM compile crashing on .NET error!! (Read 5453 times)
DJDaedalus
Newbies
*
Offline


Posts: 5
Joined: Jul 25th, 2016
VM compile crashing on .NET error!!
Jul 25th, 2016 at 2:22pm
Print Post  
This was building fine before the 1607.22 release.

Compile dump attached.

It would be nice just to get back to the version that works.  From now on I'm keeping a copy of the last good version. Angry
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM compile crashing on .NET error!!
Reply #1 - Jul 25th, 2016 at 2:40pm
Print Post  
Thanks for the output. You haven't give any idea of what version you were on previously but it always make sense to keep versions of mission critical software Smiley

Near the top of your output I think we see the real error

Code
Select All
Library Include Paths (3)
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\EEPROM\src'
Unable to resolve library include path 'spi'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire\src'
 



Can you please confirm the code you have used to #include the spi library?

EDIT: If upgrading from versions of Visual Micro from many months ago there is a new library-in-library discovery feature that is more accurate but less forgiving than the older system. However the new system is optional and can be disabled by un-checking "vMicro>Compiler>Deep Search Includes".

Thanks
« Last Edit: Jul 25th, 2016 at 2:54pm by Tim@Visual Micro »  
Back to top
IP Logged
 
DJDaedalus
Newbies
*
Offline


Posts: 5
Joined: Jul 25th, 2016
Re: VM compile crashing on .NET error!!
Reply #2 - Jul 25th, 2016 at 3:11pm
Print Post  
I don't know what you mean by "real error".

There was a .NET crash during the build.  You don't crash in shipped code.  Ever.

Yes, we have problems resolving includes.  It's been a consistent problem, not helped by Arduino playing musical chairs with the file locations.  The Arduino stuff is very good at automagically finding stuff, until suddenly it stops working.  Which tends to be the case where you start using good SW Eng. practices like splitting stuff into modules.

I'm going to address the resolution problems by removing some of the explicit paths and seeing if the libraries can be found anyway.

Meanwhile, I notice that if I add libraries to a project they now appear in a completely different folder, i.e. no longer under "_libraries" in the project.  Plus all the example code is imported.  That's not what we need.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM compile crashing on .NET error!!
Reply #3 - Jul 25th, 2016 at 3:33pm
Print Post  
Hi,

Quote:
There was a .NET crash during the build.  You don't crash in shipped code.  Ever.


If the software crashed and closed that shouldn't happen and vs shouldn't let it happen. Is that repeatable? So far you just posted an error not a crash report?

Versions

Which version of Visual Studio? Help>About?

Quote:
Yes, we have problems resolving includes.  It's been a consistent problem, not helped by Arduino playing musical chairs with the file locations.  The Arduino stuff is very good at automagically finding stuff, until suddenly it stops working.  Which tends to be the case where you start using good SW Eng. practices like splitting stuff into modules.

I'm going to address the resolution problems by removing some of the explicit paths and seeing if the libraries can be found anyway.


Explicit paths. Uggh. Arduino doesn't use explicit paths and that's difficult to test for or know what results you will get.

You haven't said what happens if you switch off "vMicro>Compiler>Deep Search" or were you aware of the feature and have coded for it. Adding library #includes to the project_name.ino negates most of what "deep search" is designed to do.

Quote:
Meanwhile, I notice that if I add libraries to a project they now appear in a completely different folder, i.e. no longer under "_libraries" in the project.  Plus all the example code is imported.  That's not what we need.


Okay maybe this gives some clue as to the problem. This is an area that changed in the last release (see release notes)

Let;s be clear about what the _libraries folder is/was. The _libraries folder used to appear when you click "vMicro>Toggle Hidden Files". Clicking again removes the folder. The folder has been renamed to src\_micro-api-readonly\libraries.

Toggle hidden files gives "read only" shortcuts to the original source. These additions to a project are ignored by visual micro during compile because they are catered for during core and lib compilation. The hidden files are for display purposes only making it easier to reference them during project code creation.

You can click delete or right click "remove" these files which is the same as clicking the Toggle menu item again. I will do some more testing but it sounds like a bug related to hidden files is confusing the compiler library resolution. 

In the meantime I suggest you remove all library and and core short cuts from the project because they are easy to re-add, don't affect the source and will remove an element of confusion while we resolve the issue.
  
Back to top
IP Logged
 
DJDaedalus
Newbies
*
Offline


Posts: 5
Joined: Jul 25th, 2016
Re: VM compile crashing on .NET error!!
Reply #4 - Jul 25th, 2016 at 3:51pm
Print Post  
Tim@Visual Micro wrote on Jul 25th, 2016 at 3:33pm:


Quote:
There was a .NET crash during the build.  You don't crash in shipped code.  Ever.


If the software crashed and closed that shouldn't happen and vs shouldn't let it happen. Is that repeatable? So far you just posted an error not a crash report?

Versions



At the end of the build output is a .NET stack dump.  That's the VM code crashing out.  VS did not crash.
  
Back to top
 
IP Logged
 
DJDaedalus
Newbies
*
Offline


Posts: 5
Joined: Jul 25th, 2016
Re: VM compile crashing on .NET error!!
Reply #5 - Jul 25th, 2016 at 4:14pm
Print Post  
I have an explanation, if not a resolution.

There were bogus entries in the project file for non-existent copies of Spi.cpp and Spi.h.  They were non-existent because the 1.6.9 release of the Arduino support code moved them to a different place.   

Removing those entries allowed the build to complete.

This doesn't change the problem: VM did not handle a bad condition properly.  But thanks for the responses.  I hope I can go forward without needing to come back, so to speak.

Some suggestions: a lot of your text in various places, including the MSDN web page, is hard to read for anybody over 50.  Avoid gray text on white.  If you must use 8 pt text, as in Visual Micro Explorer, create an option to increase the size.  Thanks.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM compile crashing on .NET error!!
Reply #6 - Jul 25th, 2016 at 4:26pm
Print Post  
Thanks for the info that's useful.

I'll try to see what happens if shortcuts are invalid.

1)
Can you please confirm if the crash was a program close and if it was repeatable?

2)
Did you manually add the shortcut to spi to force it into the project compile?
« Last Edit: Jul 25th, 2016 at 4:28pm by Tim@Visual Micro »  
Back to top
IP Logged
 
DJDaedalus
Newbies
*
Offline


Posts: 5
Joined: Jul 25th, 2016
Re: VM compile crashing on .NET error!!
Reply #7 - Jul 25th, 2016 at 4:36pm
Print Post  
All I know is what I have told you.  The build output contained a .NET stack dump from a "bad instance of an object" exception.  It was highly reproducible: I backed out all my changes and repeated the build until I showed that removing those two bogus entries was the only thing needed to fix it.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: VM compile crashing on .NET error!!
Reply #8 - Jul 25th, 2016 at 4:39pm
Print Post  
Okay that wasn't a crash that was Visual Micro outputting an unknown result to the output window so we can know about the problem. 

The build failed with an error. A crash is when software terminates unexpectedly.

Thanks again for the great reports. Glad it was something simple in the end.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint