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 Mixed Arduino/C# Solution (Read 1740 times)
Nathan Phillips
Newbies
*
Offline


Posts: 7
Joined: Jan 6th, 2020
Mixed Arduino/C# Solution
Jan 6th, 2020 at 11:06am
Print Post  
Is having a solution with a Visual Micro project in it as well as a C# desktop project supported? If so what might I be doing wrongly? Whenever I try to debug the C# project, Visual Micro steps in and builds/runs the Arduino project.
« Last Edit: Jan 6th, 2020 at 11:37am by Nathan Phillips »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Mixed Arduino/C# Solution
Reply #1 - Jan 6th, 2020 at 11:20am
Print Post  
Which is the startup project?

If you din't know then also say and I will explain.
« Last Edit: Jan 6th, 2020 at 11:21am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Nathan Phillips
Newbies
*
Offline


Posts: 7
Joined: Jan 6th, 2020
Re: Mixed Arduino/C# Solution
Reply #2 - Jan 6th, 2020 at 11:38am
Print Post  
I had left the C# project as the startup project but setting it to the Arduino project and explicitly selecting the C# project to debug still builds/runs the Arduino project.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Mixed Arduino/C# Solution
Reply #3 - Jan 6th, 2020 at 11:41am
Print Post  
If you set the c# project as the startup project debug>start should debug the c# project. F5/Debug start always uses the startup project this is how Vs works.

Do you agree?

I know there might be more to this discussion but my question is to establish the facts one by one.
« Last Edit: Jan 6th, 2020 at 11:42am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Nathan Phillips
Newbies
*
Offline


Posts: 7
Joined: Jan 6th, 2020
Re: Mixed Arduino/C# Solution
Reply #4 - Jan 6th, 2020 at 2:05pm
Print Post  
I agree that's how I would expect it to work. Do you see this behaviour when you try it? If so then perhaps you could send a solution file where it works. I'm using VS 2019. Alternatively I could try creating new solution files with different combinations of projects to see if I can find a combination where it works.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Mixed Arduino/C# Solution
Reply #5 - Jan 6th, 2020 at 5:01pm
Print Post  
I looked at this and the only time the arduino project starts is when arduino code is the active code in the code editor. If the c# code is active then start debug for specific project works for me regardless of startup project.

You can change this functionality by switching off "vMicro>General>Active Code Has Priority over Soltion Explorer". The default is ON but users like yourself who know what a Visual Studio Startup Project is might prefer it OFF.

OFF is confusing for Arduino users wo don't know VS, they expect build and upload to be related to the code they are currently editing.

In future releases we might be able to improve the difference between specific project start and general start, but my suggestion above should resolve for you?
  
Back to top
WWW  
IP Logged
 
Nathan Phillips
Newbies
*
Offline


Posts: 7
Joined: Jan 6th, 2020
Re: Mixed Arduino/C# Solution
Reply #6 - Jan 6th, 2020 at 8:48pm
Print Post  
Goodness - that was it - this is actually the way visual micro is designed to work. That is so completely not what I would expect. If I click on a project and select Debug I don't expect a different project to run. Anyway, thank you for answering my query, I will continue to try out your software for my current project.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Mixed Arduino/C# Solution
Reply #7 - Jan 6th, 2020 at 9:02pm
Print Post  
In Visual Studio it is possible to be editing code open from Project A yet to select Project B in the solution explorer. For most users that is a confusing an alien concept. If they are editing the code of Project A and they press F5 they expect Project A to be uploaded.

This is not what you want to happen. In your case you want to be able to be editing Project A and press F5 causing Project B to be uploaded. No possibility to upload the currently edited code without clicking the Solution Explorer (which in itself is an alien concept to most Arduino users) 

It makes more sene to give the simple use as default and allow more advanced users to know what setting they might be looking for or at least understand the words required to ask on the forum.

I am sure you can imaging the reports would be "Help, when I edit my code and press F5 (or Debug>Start/Green Arrow) a different project is uploaded"

Your report was easier to explain  Smiley

  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint