0

我有一个由VS2015打开的VC++ 2012项目。我的电脑上都安装了VS2012和VS2015。我加入后生成事件:VS2015 devenv.exe在编译后事件中使用代码1退出

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

的评估值是:

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"

后,我右键单击项目 - >重建,我不断收到以下错误:

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

错误XML日志看起来像这样:

<?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> 

我需要你的帮助,谢谢!

+0

您是否曾尝试从命令提示符或批处理文件运行相同的命令?结果是什么? – roalz

+0

我试过它在命令行上。首先,我将'cd'到'devenv.exe'的位置,然后输入命令。生成成功并生成DLL。 –

回答

-1

我更改为以下格式的命令后,一切正常:

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

DebugDll|x64是自定义生成的配置加入到VC2012项目。