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 MSB4018 error after install and tried to use a VS (Read 3726 times)
P.Ferenc
Newbies
*
Offline


Posts: 6
Location: Budapest
Joined: Apr 1st, 2018
MSB4018 error after install and tried to use a VS
Apr 1st, 2018 at 6:24pm
Print Post  
Hi I tried tuo install and use a vmicro licensed version, but I cant finish with working system.
After I installed a visual studio 2017 Community Edition with Linux and Android components and installed a Arduino extension I tried to compile an empty test project (File->New->Arduino project)...

I got an "empty" test.ino -> ok, I tried to run/compile it but receive a:
1>------ Build started: Project: Fade, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018: The "VCMessage" task failed unexpectedly.
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at System.String.Format(IFormatProvider provider, String format, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at  messageResourceName, Object[] messageArgs)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.CPPTasks.VCMessage.Execute()
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Host.Execute()
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "Fade.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

output and got a 

Severity      Code      Description      Project      File      Line      Suppression State
Error      MSB4018      The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
   at  messageResourceName, Object[] messageArgs)
   at Microsoft.Build.CPPTasks.VCMessage.Execute()
   at Host.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()      Fade      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets      57      

Error...

How can I get a working system or what step I missed to do..?

Thanks your help!

Best regards...



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


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: MSB4018 error after install and tried to use a VS
Reply #1 - Apr 1st, 2018 at 11:06pm
Print Post  
These are visual studio build errors which means that visual micro is not attempting a build

When you use file>open arduino project it creates an example project for you that adheres to THREE simple rules

The following must all have the same name:

Folder name
One .ino file name
Project name

The first two are also required by the arduino ide.

Your code ....

You have test.ino in a project called "Fade"

I assume you originally created a project called "Test". Then you renamed the project to "Fade" but that doesn't comply to the rules. 

Fix

Rename the project back to "test". So you have a folder called test, a project called test and an ino called test.

If you want to rename a project then rename the .ino and visual micro will attempt to follow the rules for you. However you can rename things manually but maybe easier to delete the vcxproj and .sln from the project folder and then rename the ino and folder. Then use file>open>arduino project again

  
Back to top
IP Logged
 
P.Ferenc
Newbies
*
Offline


Posts: 6
Location: Budapest
Joined: Apr 1st, 2018
Re: MSB4018 error after install and tried to use a VS
Reply #2 - Apr 2nd, 2018 at 8:53am
Print Post  
Thanks you fast answer...
I created a fresh new project with name test2_180402. THe situation is same...

Best regards,

Ferenc Pereszlenyi

1>------ Build started: Project: test2_180402, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018: The "VCMessage" task failed unexpectedly.
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018: System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at System.String.Format(IFormatProvider provider, String format, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at  messageResourceName, Object[] messageArgs)
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.CPPTasks.VCMessage.Execute()
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Host.Execute()
1>C:\Program Files (x86)\Microsoft Visual ,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
1>Done building project "test2_180402.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Severity      Code      Description      Project      File      Line      Suppression State
Error      MSB4018      The "VCMessage" task failed unexpectedly.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(IFormatProvider provider, String format, Object[] args)
   at Microsoft.Build.Shared.ResourceUtilities.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatString(String unformatted, Object[] args)
   at Microsoft.Build.Utilities.TaskLoggingHelper.FormatResourceString(String resourceName, Object[] args)
   at  messageResourceName, Object[] messageArgs)
   at Microsoft.Build.CPPTasks.VCMessage.Execute()
   at Host.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()      test2_180402      C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.Cpp.Platform.targets      57      

(I tried to attach a screenshot, but I havent rights to do it)
  
Back to top
 
IP Logged
 
P.Ferenc
Newbies
*
Offline


Posts: 6
Location: Budapest
Joined: Apr 1st, 2018
Re: MSB4018 error after install and tried to use a VS
Reply #3 - Apr 2nd, 2018 at 9:21am
Print Post  
May be I found a workaround...

I did a following:
- devenv /ResetUserData
- devenv /ResetSettings (as Run As Adminsitrator)
- Delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{version}
- Delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{version}_Config
- Delete the %USERNAME%\AppData\Local\Microsoft\VisualStudio\{version} directory.

After restarted a VS and created a new ARduino prject at vMicro->New Adruino Project then I can build from menupoint vMicro->Build...

The next question how can I debug with btreakpoints and etc. but first I look trough the documentation...
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12144
Location: United Kingdom
Joined: Apr 10th, 2010
Re: MSB4018 error after install and tried to use a VS
Reply #4 - Apr 2nd, 2018 at 11:42am
Print Post  
Interesting. Sounds like your VS needed repair but nice you found a solution.

It's possible that some other extension was preventing visual micro from working. The reset might have uninstalled it.
« Last Edit: Apr 2nd, 2018 at 11:43am by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint