5

So I have this project I'm working on, and every time I build, it builds then executes the program, and then finishes with a build error. Why does this happen? I can't seem to find in the project properties where it would execute the file on the build.
It is kind of annoying, and it also ends up spawning an error. Here's an excerpt from the output

2>Link:
2>  Generating code
2>c:\users\d0c\desktop\jlrria.lottery.repo\trunc\hash\hl_hashwrapper.h(277): warning C4706: assignment within conditional expression
2>  Finished generating code
2>  lottery-gui.vcxproj -> C:\Users\d0c\Desktop\jlrria.Lottery.repo\trunc\build\Release\lotteryslayer.exe
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(741,5): warning MSB3073: The command ""C:\Users\d0c\Desktop\jlrria.Lottery.repo\trunc\build\Release\lotteryslayer.exe" /RegServerRedirect" exited with code 2.
2>  The previous error was converted to a warning because the task was called with ContinueOnError=true.
2>  Build continuing because "ContinueOnError" on the task "Exec" is set to "true".<br>
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(744,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
2>
2>Build FAILED.

So I guess I'm looking for help with two things
First and most importantly: Why is it executing the build program
Second: Why am I getting this error?

thanks. ALSO There are no items in the post build, otherwise, the log above would say "post-build" :p

1
  • It looks like you might have a post-build event set up that is executing lotteryslayer.exe Commented Aug 20, 2011 at 18:56

2 Answers 2

13

Start with Visual Studio with Administrator rights. You can do so by right clicking on VS shortcut and Select Run As Administrator. Or create a shortcut where you would enable Run As Admin.

Reason:

Look at the error:

error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.

Also, it seems to be a DLL/ActiveX control project. Look at: Linker->General->Register Output and set it to NO.

Sign up to request clarification or add additional context in comments.

4 Comments

I'm mostly looking for why it's executing a file
It seems to be a DLL/ActiveX control project. Look at: Linker->General->Register Output and set it to NO.
FWIW, I'm having this problem right now and I AM running as admin.
Aaaand your suggestion in the comment fixed it. Should be in the answer, but +1 because it's your comment.
1

You are building an ATL project? Seems to be a bug in VS2010, http://social.msdn.microsoft.com/Forums/en/vcprerelease/thread/11f01ceb-52a4-438f-b7ef-727ce7a3e191 concerning ATL projects.

2 Comments

I'm mainly looking for why it's executing the file
What kind of app is it? The build log suggests that VS thinks you are building some kind of COM component which needs registering after you've built it. If that's not the case I suggest you delete the project and recreate it using the right type of project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.