John Wang John Wang -4 years ago 239
C++ Question

VS2015 devenv.exe exited with code 1 in post build event

I have a VC++ 2012 project opened by VS2015. Both VS2012 and VS2015 are installed on my computer. I added post build event:

devenv.exe "$(SolutionPath)" /Build "$(Configuration)Dll|$(Platform)" /Project "$(ProjectPath)"


The evaluated value is:

devenv.exe "C:\Users\Wang-Tzu-Chao\Documents\Visual Studio 2015\Projects\KORAT\NCUTAS.sln" /Build "DebugDll|x64" /Project "C:\Users\Wang-Tzu-Chao\Documents\Visual Studio 2015\Projects\KORAT\OCRScan\TinyOCR.vcxproj"


After I right-click the project -> rebuild, I keep receiving the following error:

Error MSB3073 The command "devenv.exe "C:\Users\Wang-Tzu-Chao\Documents\Visual Studio 2015\Projects\KORAT\NCUTAS.sln" /Build "DebugDll|x64" /Project "C:\Users\Wang-Tzu-Chao\Documents\Visual Studio 2015\Projects\KORAT\OCRScan\TinyOCR.vcxproj"
:VCEnd" exited with code 1. ocrscan C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppCommon.targets 134


The error XML log look like this:

<?xml version="1.0" encoding="utf-16"?>
<?xml-stylesheet type="text/xsl" href="ActivityLog.xsl"?>
<activity>
<entry>
<record>1</record>
<time>2017/02/21 15:42:45.240</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Microsoft Visual Studio 2012 version: 11.0.50727.1</description>
</entry>
<entry>
<record>2</record>
<time>2017/02/21 15:42:45.240</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Running in User Groups: Administrators Users</description>
</entry>
<entry>
<record>3</record>
<time>2017/02/21 15:42:45.240</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Available Drive Space: C:\ drive has 170573537280 bytes; D:\ drive has 407639183360 bytes</description>
</entry>
<entry>
<record>4</record>
<time>2017/02/21 15:42:45.241</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Internet Explorer Version: 11.0.14393.693</description>
</entry>
<entry>
<record>5</record>
<time>2017/02/21 15:42:45.241</time>
<type>Information</type>
<source>VisualStudio</source>
<description>.NET Framework Version: 10.0.14393.0</description>
</entry>
<entry>
<record>6</record>
<time>2017/02/21 15:42:45.242</time>
<type>Information</type>
<source>VisualStudio</source>
<description>MSXML Version: 6.30.14393.321</description>
</entry>
<entry>
<record>7</record>
<time>2017/02/21 15:42:45.242</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Creating PkgDefCacheNonVolatile</description>
</entry>
<entry>
<record>8</record>
<time>2017/02/21 15:42:45.247</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Double-checking master pkgdef file</description>
</entry>
<entry>
<record>9</record>
<time>2017/02/21 15:42:45.249</time>
<type>Information</type>
<source>VisualStudio</source>
<description>PkgDefManagement initialized</description>
</entry>
<entry>
<record>10</record>
<time>2017/02/21 15:42:45.249</time>
<type>Information</type>
<source>VisualStudio</source>
<description>RootFolder</description>
<path>C:\Program Files (x86)\Microsoft Visual Studio 11.0\</path>
</entry>
<entry>
<record>11</record>
<time>2017/02/21 15:42:45.249</time>
<type>Information</type>
<source>VisualStudio</source>
<description>ShellFolder</description>
<path>C:\Program Files (x86)\Microsoft Visual Studio 11.0\</path>
</entry>
<entry>
<record>12</record>
<time>2017/02/21 15:42:45.249</time>
<type>Information</type>
<source>VisualStudio</source>
<description>PkgDefSearchPath</description>
<path>C:\Program Files (x86)\Microsoft Visual Studio 11.0\\Common7\IDE\Extensions;C:\Program Files (x86)\Microsoft Visual Studio 11.0\\Common7\IDE\CommonExtensions;C:\Program Files (x86)\Microsoft Visual Studio 11.0\\Common7\IDE\devenv.admin.pkgdef</path>
</entry>
<entry>
<record>13</record>
<time>2017/02/21 15:42:45.249</time>
<type>Information</type>
<source>VisualStudio</source>
<description>ApplicationExtensionsFolder</description>
<path>C:\Program Files (x86)\Microsoft Visual Studio 11.0\\Common7\IDE\Extensions</path>
</entry>
<entry>
<record>14</record>
<time>2017/02/21 15:42:45.249</time>
<type>Information</type>
<source>VisualStudio</source>
<description>&quot;ZeroImpact&quot; = dword:0, &quot;MergeRegistry&quot; = dword:1</description>
</entry>
<entry>
<record>15</record>
<time>2017/02/21 15:42:45.250</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Could not find ConfigurationChanged timestamp.</description>
<hr>80070002</hr>
</entry>
<entry>
<record>16</record>
<time>2017/02/21 15:42:45.250</time>
<type>Information</type>
<source>VisualStudio</source>
<description>User extensions enabled by setting</description>
<path>HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\ExtensionManager\EnableAdminExtensions</path>
</entry>
<entry>
<record>17</record>
<time>2017/02/21 15:42:45.250</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Could not find ConfigurationChanged timestamp.</description>
<hr>80070002</hr>
</entry>
<entry>
<record>18</record>
<time>2017/02/21 15:42:45.250</time>
<type>Information</type>
<source>VisualStudio</source>
<description>PkgDefManagement startup complete</description>
</entry>
<entry>
<record>19</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Configuration file to be used for CLR initialization</description>
<path>C:\Users\Wang-Tzu-Chao\AppData\Local\Microsoft\VisualStudio\11.0\devenv.exe.config</path>
</entry>
<entry>
<record>20</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>AppId setting up registry detouring</description>
</entry>
<entry>
<record>21</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Adding detour rule 1: from HKLM</description>
<path>Software\Microsoft\VisualStudio\11.0</path>
</entry>
<entry>
<record>22</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Detour to HKCU</description>
<path>Software\Microsoft\VisualStudio\11.0_Config</path>
</entry>
<entry>
<record>23</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Adding detour rule 2: from HKLM</description>
<path>Software\Microsoft\VisualStudio\11.0</path>
</entry>
<entry>
<record>24</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Detour to HKCU</description>
<path>Software\Microsoft\VisualStudio\11.0_Config</path>
</entry>
<entry>
<record>25</record>
<time>2017/02/21 15:42:45.251</time>
<type>Information</type>
<source>VisualStudio</source>
<description>AppId starting registry detouring</description>
</entry>
<entry>
<record>26</record>
<time>2017/02/21 15:42:45.264</time>
<type>Information</type>
<source>VisualStudio</source>
<description>AppId stopped registry detouring</description>
</entry>
<entry>
<record>27</record>
<time>2017/02/21 15:42:45.264</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Shutting down pkgdef registry</description>
</entry>
<entry>
<record>28</record>
<time>2017/02/21 15:42:45.264</time>
<type>Information</type>
<source>VisualStudio</source>
<description>Released pkgdef cache usage tracker</description>
</entry>
<entry>
<record>29</record>
<time>2017/02/21 15:42:45.264</time>
<type>Information</type>
<source>VisualStudio</source>
<description>PkgDef registry shutdown complete</description>
</entry>
</activity>


I need your help, please, and thank you!

Answer Source

After I change the command to the following format, everything works:

"$(DevEnvDir)devenv.exe" /Build "DebugDll|x64" /Project "$(ProjectName)" "$(ProjectPath)"

The DebugDll|x64 is the custom build config added to the VC2012 project.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download