locked
What component in Visual Studio 2017 do I need to install to get MASM support - that's all I want for now RRS feed

  • Question

  • I just installed the "Desktop Development with C++" option in the new Visual Studio 2017. I did not see MASM support when I tried to create a "New Project". No other "Optional" components were selected to keep my install size down. What additional components are absolutely necessary for MASM support. I want nothing more than MASM support at this time to keep the install size at a minimum on my hard disk drive.

    Thanks for reading

    P.S. On the off chance one of the Visual Studio team reads this, it would be nice to include support for this in a future installer.


    • Edited by 7h3D4rkKn1gh7 Thursday, April 6, 2017 2:55 PM additional text added
    Thursday, April 6, 2017 2:42 PM

All replies

  • Masm is still and has always been an extension of the C/C++ toolset. So there is no separate project system for it.

    To get support for it in a project, you need to install the C/C++ support, which you have already done, create a new C/C++ project and when it has been created you must then do one more step. Open up Solution Explorer, right click on your project, find Build Dependencies hover over it and then select Build Customisations. In the window that appears, check masm and select ok.

    This will now build any .asm file in the project with ml/ml64 depending on your project configuration. But there is still no project item for .asm files. To add these you can simply select new C++ file (.cpp) in the add new item window and when you name it, make sure you give it a .asm extension.

    If you added any .asm files to the project before you enabled masm support, these .asm files will not automatically be changed to build with masm, you will need to change them over yourself. The simplest way of doing this is to just remove them from the project (being careful not to delete them) and then add them again.


    This is a signature Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    • Edited by Darran Rowe Thursday, April 6, 2017 4:13 PM
    Thursday, April 6, 2017 4:09 PM
  • I very much appreciate the time you have taken to write the post. But you went over a lot of what I already know. I had this working in Visual Studio 2015.

    It's not working in Visual Studio 2017. And I'm not sure why yet.

    One thing that you said triggers a thought in my head. You used the word "toolset". If you look in the installer for Visual Studio 2017, it shows 2 "Optional" toolsets that I can install. As I stated in my original post I only installed the base "Desktop Development with C++" and no other "Optional" components.

    I "need" something more to get the MASM functionality and my guess now is that it is one of the 2 "Optional" toolsets. So, I'll look in that direction.

    Thanks again for your post.



    Thursday, April 6, 2017 4:43 PM
  • I don't have anything extra though. All I have selected is the VC++ 2017 v141 toolset (x86, x64) which is kind of obvious and the Windows 10 SDK. Since ml.exe/ml64.exe is part of the C++ toolset then it goes in with the same options that puts cl.exe in.

    And this isn't an isolated incident either, I have 3 separate systems available with the VC++ 2017 tools installed on and just those, and all of them have masm installed along with it. With only those two things installed I am able to build .asm files from within visual studio. For example, if I use it to assemble a file with a simple error in (missing end directive) I get the error:

    1>------ Build started: Project: ctest, Configuration: Debug Win32 ------
    1>Assembling test.asm...
    1>test.asm(7): error A2088: END directive required at end of file
    1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\masm.targets(50,5): error MSB3721: The command "ml.exe /c /nologo /Zi /Fo"Debug\test.obj" /W3 /errorReport:prompt  /Tatest.asm" exited with code 1.
    1>Done building project "ctest.vcxproj" -- FAILED.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    As you can clearly see, it is referencing VS2017 here. Without the error it builds cleanly.

    1>------ Build started: Project: ctest, Configuration: Debug Win32 ------
    1>Assembling test.asm...
    ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

    So there should be no real trouble getting masm working.


    This is a signature Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Thursday, April 6, 2017 5:14 PM
  • You installed an "Optional" component of "Desktop Development with C++". Unless you have a different Visual Studio 2017 than I do.

    See my screenshot and let me know.


    Thursday, April 6, 2017 7:11 PM
  • Ahaha, I'm not surprised that you got caught out by that.

    The Visual C++ core desktop features doesn't actually include the compiler toolset, only the C++ project system, intellisense, MSBuild and VS debugger.

    The "optional" features would be better described as one amongst these are mandatory.

    So you need to choose the compiler in the "optional" section if you actually want to compile and link things, and you need to include one of the Windows SDKs in order to link against the C runtime and access the Windows API.

    So while it is under optional, you really need to select VC++ 2017 toolset (x86,x64) to get the compiler, masm and linker installed.


    This is a signature Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    • Proposed as answer by Baron Bi Wednesday, May 3, 2017 7:43 AM
    Thursday, April 6, 2017 8:40 PM
  • Thank you very much for clearing this up. Now, I hope someone from Microsoft will re-think the categories as you stated. This was a stumbling block for me.

    Just out of curiosity though, I did select the 2015.3 toolset and that didn't seem to be enough to work either. Oh well, I'll try adding the 2017 toolset. Here goes more disk space.


    **EDIT**: "Setup operation failed. There is not enough space on the disk". You gotta love it!! At least I know what I gotta do next.

    Thursday, April 6, 2017 9:01 PM
  • i am faced with the same problem. How did you fix this one. I am not able to use masm in visual studio 2017 edition.
    Saturday, January 19, 2019 1:47 PM
  • You really should start your own thread for this, rather than jumping on the end of a thread that may seem like it is similar.

    When you do this, you imply that you are having the exact same kind of problem as the original poster, but since they did figure out the problem but never marked the thread as answered then you can't really be having the same problem as the original poster.

    To install masm you need to make sure the C++ toolset is installed, basically, if you can compile cpp files then you have masm installed.

    If you are somehow paranoid, then open up one of the Native Tools or Cross Tools command prompt and then try to run ml.exe or ml64.exe. If one of these runs then everything is fine.

    After this, you just need to enable masm in the project using the build customisations. You can find this either in the project menu after selecting the project, or right clicking on the project.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Saturday, January 19, 2019 4:34 PM
  • not only & not just enable masm in the project...etc

    (More problem... but solution it...)

    ----------------------------------------------------------

    For the alert error ("The system cannot find the file specified.")

    1.Right click on [Solution Program name] then select Build Dependencies> & left click on Build Customizations... then true-checkbox {MASM} then click OK button. 

    2.Right click on [Solution Program name] then left click on Properties, left click on "Linker" form "Linker" choose "Debugging" left click on "Debugging" from "Debugging" choose "Debugging Assembly" & convert the value of "Debugging Assembly" to "Yes (/ASSEMBLYDEBUG)", form "Linker" choose "System" left click on "System" from "System" choose "SubSystem" & convert the value of "SubSystem" to "Windows (/SUBSYSTEM:WINDOWS)",, left click on OK button. 

    3.Right click on [Solution Program name] then Add> new item, "C++ File(.cpp)" change the name or rename "new item" to "Main.asm" then left click on Add button, Right click on [Main.asm] then left click on Properties select "General" from "General" choose "Item Type" and convert the value of "Item Type" to "Microsoft Macro Assembler" press left click on OK button, then then then Write your assembly code in "Main.asm" file then [[[Debug]]] it using 'step over === F10' from "Debug" tool-bar on top-screen program, all this about how to using assembly code in "Visual Studio 2017".

    Tuesday, March 19, 2019 5:39 AM