Visual Studio 2012 C++ validate architecture fails and layer references expansion freezes - by Tay Code

Status : 


Sign in
to vote
ID 776187 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/9/2013 6:52:12 PM
Access Restriction Public


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 ( appears to report the same issue for an older version of Visual Studio 2012.

This page ( specifies the elements that can be added to a layer: "These artifacts can be namespaces, projects, classes, methods, and so on."

This page ( 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 ( 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 ( or 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".
Sign in to post a comment.
Posted by Microsoft on 4/23/2013 at 3:33 PM
Hello, Tay,

Thank you for taking the time to provide your feedback. This was a bug in our product. The hang occurred in part of the code that had been modified extensively, and as such, the bug no longer reproduces in our latest internal builds. The fix will be publically available in one of the future releases of Visual Studio.


Oleg Kharitonov
Visual C++
Posted by Microsoft on 1/11/2013 at 12:03 AM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Tay Code on 1/10/2013 at 9:00 AM
I have submitted a restricted attachment containing a zip of the folder containing the project I used to duplicate the issue.
If you are unable to duplicate the issue, I have determined that the Microsoft Problem Steps Recorder is able to capture the hung Visual Studio window, although I'm not sure if this would give much information in addition to the screencaps I already posted.
Posted by Microsoft on 1/10/2013 at 1:46 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 1/9/2013 at 7:55 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(