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) Global Project Defines from IDE 1.x to 2.x with unexpected results for strings (Read 521 times)
John Ohniudra
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2021
Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Sep 15th, 2026 at 11:13am
Print Post  
Hello,

Just switched over last week to IDE2(yes, rather late) and the new Solutions/Projects Intellisense format.
I am making extensive use of Macro Defines under the Project Properties - Project Global Defines. 
Like: CVA$BINIDENT="SLAVE";WiFiSlaveClient=1;DEBUG_MODE=1;

As I understand, these are stored now in the project's .vcxproj file, not anymore in .<project>.vsarduino.h
Under IDE1.x the macro is shown as: #define CVA$BINIDENT "SLAVE"

What happens with IDE2, using the macro CVA$BINIDENT in source code, Intellisense shows: SLAVE, without double quotes, in contrast with the previous I-format, warning: SLAVE is not defined. Which is correct because it should be a String.
Checking .vcxproj indeed the entry for the config/platform says: CVA$BINIDENT=SLAVE;
Next: changing it manually in CVA$BINIDENT="SLAVE", reopening the solution, same problem, quotes are deleted.
It is not possible to convert SLAVE in code to "SLAVE", cause the one is an undefined variable and the other a const String.

Currently my bundle of 5 projects and 12 libs is now halted because these main settings prevent successful postbuild steps.
Detail: in the postbuild hooks the binary build output is renamed, using a.o. the CVA$BINIDENT value and copied to a common location.
I have not been able to "google" any complaints about this, so I would like to hereby report a (possible) bug, and any advice is much appreciated.

Finally I tested this with a simple minimal testproject with just 1 string define, same result.

Could you:
Reproduce it
Confirm the problem, or regard it as "new functionality"
Advise a solution?

Kind regards
Johan

Attached: Verbose build output Word doc, and a .vcxproj project file in text format.

VS 2019 Community up-to-date
VM: 2026.422.1901






  

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


Posts: 12240
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #1 - Sep 15th, 2026 at 6:44pm
Print Post  
Thanks for all the info. The <project>.vsarduino.h was for intellisense. it was never a part of the real build. The intellisense and the build are still two separate things but we no longer need the <project>.vsarduino.h for the new c++ intellisense engine.

The arduino ide selection is unrelated. we don't do anything different, when it comes to the ui or project settings, for the various arduino ide choices.

If I understand correctly. The issue appears to be that quotes are stripped from the global defines when they are saved, however visual micro doesn't manipulate the defines.

I've tested in vs2022 and 2026. The quotes are never removed.

So it's difficult to see what could cause this other than another extension.

Can you please click help>about and copy the info. Then put it in a txt file and attach it or email it.

Thanks




  
Back to top
IP Logged
 
John Ohniudra
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2021
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #2 - Sep 16th, 2026 at 8:38am
Print Post  
Thanks for the explanation Tim
It looks indeed something fishy is going on.

Regarding the use of .arduino.h: Because in this .h appeared all the macro definitions from the Project Properties I was under the assumption this was the location.
When using the specific macro in any (sub)project of the solution, the reference came directly from the .h file, e.g. when using Goto Definition.

Anyway, 
As I don't see any button for an attachment(like in the first message) I paste it below:
If you want I could just send a new post with the attachment.

Microsoft Visual Studio Community 2019
Version 16.11.60
VisualStudio.16.Release/16.11.60+37627.13
Microsoft .NET Framework
Version 4.8.09037

Installed Version: Community

Visual C++ 2019   00435-00000-00000-AA319
Microsoft Visual C++ 2019

Arduino IDE for Visual Studio by Visual Micro   19.0
Visual Micro is an Arduino Compatible IDE for Visual Studio 2017-2019. For more information and forum please visit www.visualmicro.com.

ASP.NET and Web Tools 2019   16.11.127.19732
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.11.127.19732
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.11.127.19732
Azure App Service Tools v3.0.0

C# Tools   3.11.0-4.26426.1+e1e6b25daf8df5457f973f33781283768cfc1b0d
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

GitHub.VisualStudio   2.11.106.19330
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

IntelliCode Extension   1.0
IntelliCode Visual Studio Extension Detailed Info

Linux Core Dump Debugging   1.0.9.35731
Enables debugging of Linux core dumps.

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   2.1.126+g11d4cf0d0c.RR
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.2
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

NuGet Package Manager   5.11.5
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Office Developer Tools for Visual Studio   16.0.31424.03
Microsoft Office Developer Tools for Visual Studio

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Razor (ASP.NET Core)   16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   16.0.62205.05200
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   16.0.30526.2002
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.11.0-4.26426.1+e1e6b25daf8df5457f973f33781283768cfc1b0d
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Linux Development   1.0.9.35731
Visual C++ for Linux Development

Visual F# Tools   16.11.0-beta.25257.7+874517c0ed09d1c0ba64810e20ac5ce030375001
Microsoft Visual F# Tools

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Container Tools Extensions   1.0
View, manage, and diagnose containers within Visual Studio.

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.
  
Back to top
 
IP Logged
 
John Ohniudra
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2021
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #3 - Sep 16th, 2026 at 9:38am
Print Post  
Hi Tim

Now all of a sudden the attachment option appears, weird...
So hereby the About file.

Thanks so far
John
  

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


Posts: 12240
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #4 - Sep 16th, 2026 at 4:25pm
Print Post  
let's not discuss the vsarduino.h it's not relevant.

We tested this and didn't see the quotes being removed from the project.

However for intellisense and potentially the correct string passing we defined global defines like this

ss$abc=\"test\";ss$abc2=\"test2\"


unrelated....

I also noticed some confusion in your project file. did you mean to include a share project this way? sounds same as your actual project.
..\ESP8266_EVALTEST\ESP8266_EVALTEST.vcxitem
  
Back to top
IP Logged
 
John Ohniudra
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2021
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #5 - Sep 16th, 2026 at 7:03pm
Print Post  
Thanks Tim,

Allright, this is interesting: you are escaping the double quotes, you mean they must be actually currently entered in the Project Defines like this? 
Seems a "big" change from the previous version where one could simply use the double quotes. 
I must have missed this information, this is new to me. Busy for days.
In C coding this is pretty standard but not in the user interface, until now.

A quick test 1 minute ago solved the problem.

By "we defined" you mean you did, or is this current practice for VM and all customers?
Can I find this somewhere in the release docs?
So after all, it is related to the transition from 1.x to 2.x
I have one of the projects on Github with 1.x which uses the good old double quotes.

Thanks for your help and insight
John

PS unrelated....
You are right about that, in the small EvalProject I added a shared lib containing the actual test. Reason is that all projects in the bundle I'm working on make use of 10-12 libs. 
unrelated.... metoo
This works all perfectly locally, but while switching over to IDE2 I'm also busy uploading it all to Github to tribute to the community, and do real version management. 
But Shared Libs are a disaster: they are regarded as aliens, not part of the project/repository.

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


Posts: 12240
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #6 - Sep 16th, 2026 at 7:13pm
Print Post  
Actually no. I didn't have to add the slash and quoted strings saved fine to the project for me

However in my serial print test it wouldn't compile without having escaped the string

I dont have any idea why the quotes are being stripped for you. 

Using shared projects are not immediately Arduino IDE compatible, unless the sources are combined into the single project. Visual Micro ensures the #includes in shared projects remain capable of a source merge. There is a menu item that creates a zip with the merged sources. 

They can be included in source control easy enough but more difficult if the solution is in the same folder as the source code

« Last Edit: Sep 23rd, 2026 at 5:37am by Tim@Visual Micro »  
Back to top
IP Logged
 
John Ohniudra
Newbies
*
Offline


Posts: 5
Joined: Jul 12th, 2021
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #7 - Sep 17th, 2026 at 9:37am
Print Post  
Using shared projects isn't arduino compatible with the Arduino IDE unless sources are combined. Sources of shared projects such as #includes are compatible with merge. .

When I add a new project/lib the template selection screen is opened, see attachment.
The two on top have the indication of type "Arduino", but that does not mean Arduino compatible?

Thanks so far, I'll give it a rest. If I find a solution to upload main programs + libs to Github I could post it here. Github submodules could work.

Regards
John
« Last Edit: Sep 23rd, 2026 at 5:35am by Tim@Visual Micro »  

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


Posts: 12240
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Global Project Defines from IDE 1.x to 2.x with unexpected results for strings
Reply #8 - Sep 17th, 2026 at 12:51pm
Print Post  
Sorry i wasn't clear. The Arduino ide doesn't know about shared projects. That's all I meant. The code is certainly Arduino compatible in all other respects (including how includes work).

You mentioned publishing the code for others. Non vs users have to combine the code into the single folder structure. Same code.  can also use the \src sub folder and folders below that. it shouldn't require changes to "includes" if it combined properly.

The restrictions are only when we consider users who don't use visual micro. There are many ways in Visual Micro to keep sources together. From a source control point of view. The "Portable" section of the docs might or might not be useful for you.

https://www.visualmicro.com/page/User-Guide.aspx?doc=index
« Last Edit: Sep 17th, 2026 at 9:38pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint