Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
I am having a really strange problem. I am developing a WPF Application and the problem i am facing is when i try to publish the application it's just says
"Cannot publish because a project failed to build." but i can compile the project without error.
Another thing is if i run the application from VS2010 then it runs fine but if i go to the bin/Debug dir and run it from there it gives me a old version of the software.

i am using VS2010 and framework 4.0. Have any of you guys had this kind of problem. Any help/suggestion is appreciated
Posted

I see it being a quite common issue on web. Most of them fix it following this: Cannot publish because a project failed to build[^]

It suggests some issue with add-in in VS2010, based on which you need to use the right-click option for publishing, and not the project page option.


Other common solution is around signing of the project. Details here: "Cannot publish because a project failed to build" in MS VS2010[^]
 
Share this answer
 
Comments
bbirajdar 4-Sep-12 5:41am    
+5 countered
CS2011 4-Sep-12 8:39am    
Thanks Sandeep. Right click option worked. Looks like a VS bug.
Sandeep Mewara 4-Sep-12 11:06am    
Welcome. :)
You have imported the code from some other machine along with the application dlls . Browse to the solution folder and delete the 'obj' folders from all the class libraries and applications and build the solution once again. It will work 100%,
 
Share this answer
 
Comments
Sandeep Mewara 4-Sep-12 5:27am    
My 5! I see our answers downvoted. Bad! Looks like someone didn't like us. :doh:
bbirajdar 4-Sep-12 5:41am    
:) .. Seems somebody is really irritated...
CS2011 4-Sep-12 8:38am    
Thanks for the suggestion but i had not imported it from other system and all the reference were there already.
bbirajdar 4-Sep-12 8:55am    
"not imported it from other system and all the reference were there already" is a contradictory statement....Let us know how the error was fixed...
CS2011 4-Sep-12 9:18am    
for publish problem solution provided by Sandeep worked and about getting the old version of EXE was solved using command line CSC compiler and now after resetting my VS201 setting to defaults it's working fine now.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900