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 Defines shown in Project Properties do not match what's in .vcxproj file (Read 1438 times)
gruvus
Newbies
*
Offline


Posts: 2
Joined: Sep 4th, 2022
Defines shown in Project Properties do not match what's in .vcxproj file
Mar 4th, 2023 at 11:39pm
Print Post  
I find Project level defines very useful. 
Unfortunately lately I am noticing some inconsistent behavior: sometimes the project builds as if the define was not there. 
Digging into it a bit I could see that the define showing in the Project Properties was not in the <PreprocessorDefinitions> section of the .vcxproj file. I don't know when the .vcxproj should be updated but if I close VS (confirming any proposed saves) and then reopen, the Project Properties match the .vcxproj file (= no define).

The most confusion part is that at some point multiple projects in the solution start showing the same defines in the Project Properties (after only making changes in one). This goes away after deleting the .vs folder under the solution. Seems related to the interaction between Visual Micro and Visual Studio around the display/updates of the  Project Properties panel. 
This happens in a solution with multiple (8) VM (Arduino)projects, some are also grouped in Solution Folders (I find that very convenient). 

I had to switch to dedicated headers just for holding defines I need to share across all compilation units in the projects. Using Project level defines would be much more convenient but is not reliable for me at this point.
This stared happening during the last few weeks. There have been VS updates and VM updates during this time and my solutions also got larger (more projects).

I wonder if anybody had encountered anything similar and hopefully found a fix.   

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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Defines shown in Project Properties do not match what's in .vcxproj file
Reply #1 - Mar 5th, 2023 at 7:44pm
Print Post  
The Visual Studio project properties should be considered Read Only and are used only to ensure intellisense works.

If you need to set project or configuration specific defines or compiler flags then you need to use the Visual Micro project properties which can be viewed by pressing F4 on the project (or using the right mouse menu > properties)

https://www.visualmicro.com/page/User-Guide.aspx?doc=Project-Properties-Referenc...

If you need further assistance then follow the guide in yellow at the top of this page
« Last Edit: Mar 5th, 2023 at 7:45pm by Tim@Visual Micro »  
Back to top
IP Logged
 
gruvus
Newbies
*
Offline


Posts: 2
Joined: Sep 4th, 2022
Re: Defines shown in Project Properties do not match what's in .vcxproj file
Reply #2 - Mar 5th, 2023 at 11:00pm
Print Post  
That's what I did, F4.  I only looked into the .vcxproj file after getting the behavior I described but did not attempt to change anything in the file. 

Right after deleting the .vs folder I can set defines (via Project Properties panel in VS), per each project, and moving between projects the defines are maintained as expected. 
However, at some point (?) when I set a define in one project, the Defines field shows the same content for all  the projects in the solution.
I'm describing what shows in the Project Properties before attempting to build anything yet.

I cannot pinpoint yet what triggers the behavior, I'll try the identify the steps to reproduce. I could take screen shots of the UI if that's useful.

It's not a terrible problem, can be easily worked around with dedicated header files but would be nice to have it.   

thanks







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


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Defines shown in Project Properties do not match what's in .vcxproj file
Reply #3 - Mar 6th, 2023 at 1:54pm
Print Post  
Okay thanks, it sounds like a possible vs bug. When this happens again please open code from each project before checking if the F4 defines are correct.

Vs has some potential for confusion over which project is active. It is possible to be editing the code of Project A whilst Project B is selected in the solution explorer. We can do some more testing around this area but maybe with this knowlege it will help you to spot the issue.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint