开发者

Why is the executable placed in the obj\Debug or obj\Release folder in Visual Basic of VS2005?

开发者 https://www.devze.com 2023-03-15 02:19 出处:网络
I am trying to update an application that was developed a couple of months ago on VB of Visual Studio 2005.

I am trying to update an application that was developed a couple of months ago on VB of Visual Studio 2005.

The "Build output path:" for the project is pointing to a folder in which I collected a few executables related to my activity, BinDir/. It is just next to the project's folder ProjName/ on my disk.

Contrary to the past, 开发者_运维技巧when I build my project now, the .exe is created in the ProjName/obj/Debug folder, instead of being directed to the BinDir/Debug folder.

In the IDE's Output tab (while building), the path of the generated executable appears correctly, but in reality it is located somewhere else.

Why is it so?

UPDATE: Something very peculiar is going on my computer today... A couple of hours later I tried again and now it seems like the executable is created in both places. The obj/ version is just redundant now.


What you describe seeing in the Update is what usually happens with Visual Basic builds in Visual Studio 2005. The build creates the executable in an intermediate directory (obj\debug) and then copies the executable from there to the final build output directory (bindir\debug)

With the usual minimal logging turned on, if you examine the build output, you should see the vbc command include the switch /out:obj\Debug\yourproject.exe which tells the compiler to create the executable in the obj\debug fdirectory. Then you should see the file get moved to the build output yourproject -> C:\TestPrograms\Vb.net\yourproject\bin\Debug\yourproject.exe

If you use Tools | Options | Projects and Solutions | Build and Run to set the "MSBuild project build output verbosity" property to "Detailed" you can see a lot more activity against the obj\debug directory and then see the various project output files being copied from that intermediate directory to the build output directory.

The macros $(Targetdir) and $(IntermediateOutputPath) can be used to access these two directories as can be seen using a build event like this...

echo target: $(Targetdir)
echo intermediate: $(IntermediateOutputPath)

In the original question, it sounds like the copy from intermediate to build output either failed or was not attempted leaving you with only one copy of the exe in the intermediate directory.

It's too late to go back and look now but typically the build output window will tell you more about why the copy failed.

0

精彩评论

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