开发者

Build FAILED for Notepad++ with message PostBuildEvent: The system cannot find the file specified

开发者 https://www.devze.com 2023-01-20 20:54 出处:网络
I get a build failure due to a post build event failure when building Notepad++ in VS 2010. Here\'s the message from Output window:

I get a build failure due to a post build event failure when building Notepad++ in VS 2010.

Here's the message from Output window:

PostBuildEvent:
  The system cannot find the file specified.  
  The system cannot find the file specified.  
  The system cannot find the file specified.  
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command "copy ..\src\config.xml ..\bin\config.xml  
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: copy ..\src\langs.xml ..\bin\langs.xml  
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppComm开发者_StackOverflow中文版on.targets(113,5): error MSB3073: copy ..\src\stylers.xml ..\bin\stylers.xml  
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073:  
C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code 1.  

Please help


Posting the answer for others who might run into this issue

After a little research on this subject,
I learned that the XML file names that are specified in the projects Post-Build Event have changed, so you have to update that to use the new file-names

You can fix this by modifying the project file like this: In Visual Studio, Select the Project (Notepad++) and choose Project > Properties from VS Menu (or hit ALT + F7)

In the Property Pages window,
expand the Configuration Properties node
then, expand the Build Events node
Select Post-Build Event to view its properties

Modify the Command Line Property to look like this:
copy ..\src\config.model.xml ..\bin\config.model.xml
copy ..\src\langs.model.xml ..\bin\langs.model.xml
copy ..\src\stylers.model.xml ..\bin\stylers.model.xml

Click OK and Build away...


Also, be careful of spaces in the path. I just wasted a half hour convincing myself that the paths in a Pre-Build copy step were indeed correct (they were).

Got bitten by spaces in the path. Instead of copy d:\a path\*.dll d:\b path\ you want to quote it, like this:

copy "d:\a path\\*.dll" "d:\b path\"


Not specific to Notepad++ but I had a similar problem with a recent post-build step. When you see...

PostBuildEvent: The system cannot find the file specified.

..your source path is wrong. In my case I was using the wrong relative source path. And this fixed it:

copy /Y $(TargetName).* $(ProjectDir)..\Latest
0

精彩评论

暂无评论...
验证码 换一张
取 消