Sai Stuff to Developers

November 30, 2012

Error: the exec task needs a command to execute in visual studio

Filed under: DotNet — tosaik @ 6:02 am
Tags: , ,

Got Error:

the exec task needs a command to execute in visual studio

Solution:

This is a common issue in visual studio and this error could be a cause when we add/remove the Pre-build event command line(s) and in Post-build event command line(s)…

Generally visual studio gives every line as a new command line to the command prompt to execute with “EXEC” command, if we by mistake keep any empty line… visual studio also send this empty line as a new command line and command prompt throws an error as it expects a valid command but what we sent is not a valid command to it…

as you can see the below image as i selected the empty line which by mistakenly entered in the project->properties Build Events Tab section…

ExecError

Hope this solution work for you….

Happy Coding 🙂

November 19, 2012

BadImageFormatException: Could not load file or assembly ‘x’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Filed under: DotNet — tosaik @ 12:01 pm
Tags: , , , , ,

Exception:

BadImageFormatException: Could not load file or assembly ‘x’ or one of its dependencies. An attempt was made to load a program with an incorrect format.

Solution:

Hi Recenty i had faced this exception and when i digg in to this issue…. and i forgot that when we are using any COM Interop DLL components in our .EXE application we need to target the respective .EXE application platform as x86

Please change the target platform to x86 in the properties section and build again before using it..

 

 

 

 

 

 

 

Hope this solution works for you too………

Create a free website or blog at WordPress.com.