Native C++ support to validate architecture via a layer diagram appears to be present but broken. I am not sure if I am experiencing multiple issues or if they are related. Running the architecture validation reports success but actually ignores any rules entered.
Adding anything other than a project to the layer diagram fails, giving warning AV3001. The message specifies that the layer diagram object links to the named binary, but the binary name is given as "BinaryName Global::.objectName", where "BinaryName" is the name of the executable, "objectName" is the name of the C++ object I'm trying to add, and the text "Global::." always precedes the object name. It looks like the namespaces or assembly names are constructed in a way that the validation linker does not understand.
This page (https://connect.microsoft.com/VisualStudio/feedback/details/729428/model-project-layer-diagram-gives-bogus-av3001-warnings) appears to report the same issue for an older version of Visual Studio 2012.
This page (http://msdn.microsoft.com/en-us/library/dd409462.aspx) specifies the elements that can be added to a layer: "These artifacts can be namespaces, projects, classes, methods, and so on."
This page (http://msdn.microsoft.com/en-us/library/vstudio/dd465141.aspx#CreateLayers) has a section "to add binary files to the modeling project" which details how to add binary references to the modeling project. However, following this procedure does not appear to affect anything. Due to the issue described in #3 I can't use "layer references".
This page (http://msdn.microsoft.com/en-us/library/ff657801(v=vs.100).aspx) specifies that C++ code can be validated against layer diagrams following the same procedures as the instructions for .NET code:
"After meeting these requirements, you can follow the same steps as those for .NET code. For these steps, see How to: Validate .NET Code Against Layer Diagrams."
This page is specified for Visual Studio 2010 but likely applies to Visual Studio 2012 as well.
The build output from running "validate architecture" always shows an error for "primary reference". I don't know if this error is related to #1. Immediately following that error it appears to successfully find a reference. In the following output, I have edited out the local paths, but the empty strings are actually output as empty strings.
1> Primary reference "[binaryname]".
1> Could not find dependent files. Could not load file or assembly '[binaryname].exe' or one of its dependencies. An attempt was made to load a program with an incorrect format.
1> Could not find dependent files. An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
1> Resolved file path is "[path to binary file].exe".
1> Reference found at search path location "".
1> Found related file "[path to binary output].pdb".
1> This reference is not "CopyLocal" because at least one source item had "Private" set to "false" and no source items had "Private" set to "true".
1> The ImageRuntimeVersion for this reference is "".
These pages (http://social.msdn.microsoft.com/forums/en-US/adodotnetdataproviders/thread/d0a75221-ee00-4a21-8876-339af840a099 or http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/b48bc916-1805-485d-bb7c-adabf027dcbd/) indicate this error may be related to inconsistent target platforms, but I get this error regardless of what target platforms any of my projects are set to. However, I don't know how to change the target platform of a modeling project because it doesn't use the standard project properties dialog.
I can't check what references my modeling project is actually using because Visual Studio freezes indefinitely any time I try to expand the "layer references" group under my modeling project in the solution explorer. It also hangs, after I click the final "OK", when I right-click on the modeling project or "layer references" and choose "add reference".