Home » C# Programming

Compiled exe not working

I am developing an windows application, a module of which requires collection of data from yahoo finance using httpWebRequest. It is a multi threaded application. The application also uses some external dlls which are properly referenced.

Now the problem is application is running fine from VS2008 IDE.

But when I try to run the compiled exe from bin\debug\compiled exe application opens but nothing happens after that.

I have tried to clean solution and then rebuild it.

It is not an external dll issue which I can assure you.

I have no clue what is going on.

Please Help. 


3 Answers Found


Answer 1

Start the app outside VS then go into VS and attach to the running  process to see what is going on.  Alternatively put a Debug.Assert in your startup code and then start the program outside the debugger.  Either case will get you into the program where you can debug it.  There is something wrong with your code so we can't really help  you with that aspect because we don't know anything about your code.

Michael Taylor - 9/30/2010


Answer 2

Whenever you run  an application  in VS, it will take care & handles your application.

In your case, tt seems that your application got some errors or may be waiting indefinetly for some operation to get completed.

Try to use Exceptiona handling in each & every method on all your classes & throw a messagebox or log the error on to a file

to identify the cause of the issue.


Answer 3

Hi SubhajitDatta,


Thank you for your post.


Some clarification with you

-           Could you please descript your concern more clarifier?


Regarding your description, I created a new project and would like to reproduce your scenario, but it worked well on my machine.

I write an app to simulate C# compiler. It could execute this app.

I would recommend that you could please check the following link, which talks about how to programmatically compile code using C# compiler.



Hope this helps! If you have any issues, please feel free to let me know.






Problem in Windows Server 2008 R2 Standard 64bit running IE8 32bit. The exact same scenarios work perfectly in 2000 Standard, and 2003 (R2) Standard, and XP Pro SP2-3 which are 32bit, running IE8. These are Terminal Servers for our remote sales reps.

We have a Java live chat application (hosted, 3rd party, cannot modify) in which an embedded IE will contain our starting sales page for sales reps. It has a SQL lookup functionality, and displays some customer info. This works fine everywhere. Buttons on that screen for connecting to our phone system, and adding result codes to customer files also work fine everywhere.

One button that opens the full customer screen in its own window (opens small about:blank window that generates code to open the customer screen) will not work. It gives "An error has occurred in a script on this page" - "Server Execution Failed".

If I copy the starter page URL from the embedded IE, and paste it in a standard IE, then everything works with no issues. This problem only exists when run from an embedded IE, and we MUST use that embedded IE.

We managed a first step around this: Get customer screen to load in the first about:blank window, not have it generate code to open another window with parameters. This will allow the customer screen to open without error. HOWEVER, any page refresh (drop down boxes, etc.) cause another script error, but with "Object Expected" instead of "Server Execution Failed", and any button that opens another page (for billing info, etc.) cause the original error again.

Again, everything works perfectly fine if initiated from a standard IE, but we get all these errors when initiated from embedded IE. What am I missing? We can't afford the time to re-develop all of our sales rep screens to jump through random hoops that this is throwing at us.

Seen same problem with embeded IE on forum for Outlook2007, but no solution: http://www.msofficeforums.com/outlook/2097-error-has-occurred-script-page.html

We have tried Java 6 update 7, Java 6 update 22. Opened any security settings that seemed at all possibly related (not much for settings in Java).

Have tried IE settings reset to default, set to minimum, and set to exact same settings as have on all other servers/desktops.

The "Disable debugging" settings, and the "Show all script errors" are all set so we should not even see these errors, but somehow they still show up. These have been set by group policy, group policy preferences, and manually setting while logged in.

Had McAfee ToPS service, but uninstalled during testing, no change.

Either related to crazy unknown security settings that do not take effect in embedded IE, or something 64bit related with embedded IE. Have checked processes during testing, and they are always *32 bit (both iexplore and iembed).

I will accept any solution or workaround, but it needs to be called from within the Java application embedded structure.

Thanks a bunch,
Kristopher Kauth


Regasm.exe no target to Framework 4.0 / Error No compiling Library x64 com visible tlb

Hi, in visual studio 2008 to create a C# library as x64 COM Visible(.tlb) was not possible. I have to use Regasm.exe tool to create the .tlb

In VS2008 I uncheck the Register for COM interop , then do a:regasm "c:\e\Example.dll" /tlb:Example.tlb /codebase to create the .tlb file

Now If I target the framework 4.0 in VS2010 is doing the same error like VS2008

Then try to use regasm.exe tool but it not recognize the 4.0 framework.

Could you please fix this error and also provide a regasm.exe that target 4.0 framework,



I have a solution file with different platform targets in different projects within the solution.

xx.exe (platform:x86)

xy.dll (platform:Any CPU)

When I compile the solution through MSBuild, it compiles all projects with the Any CPU target instead of respecting the multiple platforms in the solution configuration manager.  I am running MSBuild through a NAnt task,  and passing the Configuration setting in to it, but not passing in a platform setting.



Hello WF gurus,

While rehosting the WF designer I had an issue, which I was hoping for some suggestions on.  The posts below seem to be quests for the same piece of information.

I need a way to allow the users of my rehosted application to create multiple custom activities or "function-like" activities that have the ability to reference each other.  They need to behave similarly to howdefining several activities in seperate files would in a Visual Studio workflow project.  I'd like to reference these activities in the rehosted toolbox.

After scouring the internet, one way that was suggested was to do snippet-like DynamicActivities that insert their entire inner XAML when dropped on the design surface.  This won't work for me.  The other more promising solution was to create a solution, and store activity XAML files in it, compiling with MSBuild.  This would work in conjunction with MEF for runtime updates to the assembly, but I'd like to avoid having to call out to MSBuild and have a project on disk.  I would prefer to generate my own dynamic assembly at runtime, adding my activities to it.

Is there a way I can use the CodeDomProvider to compile workflow XAML files at runtime into a dynamic assembly?  Visual Studio has to do this somehow behind the scenes.  Ideally, I'd like to be able to do something similar.

Here are the only relevant links I've been able to find:

Any ideas?




I want some help.. i want to make a program that can compile a.cs file to a.exe file without using VS2008. i want to use DOS Command csc. This works on my pc but not on my laptop. Why?? when i do it myself it shows numerous errors like System.Drawing is missing and all... how shud i correct it...


Process.Start("cmd","csc /out:a.exe a.cs");


Hello, I am currently using VB 2010 Express, and I have an issue that I would like some help with.

In VB6, which I use when I am in college, there is an option to export to a .EXE file. No external files, no hoo-hah. Just a .EXE that runs the program I created.

I was just wondering if there was such an option in VB 2010 Express.

I would appreciate a hasty response, as I am supposed to have a version of my current project ready sooner rather than later.



What is Mibcc.exe ? why should we use it ? How can we use it ?

I dont know what is important to update a MIB file ? I mean why should I update a dhcp or wins or ISA in MIB? I think there is any thing related to DHCP for example in MIB , Is not there?

Thanks a lot



I have made a litle program in Visual Basic 2010 Express.

I have figured out how to compile the project but whenever i want to install it on another computer it says i need to download the full NET framework 4.0 of 2GB.. THat is not very convinient.. if you understand what i mean.

how would i do to not need to install the NET framework.
I have tried to compile the project for Framework 2.0 but it still asks for 4.0

Thank you for any input.


Hi guys!


I have a weird problem with my solution (or perhaps my machine?).

When I try to compile my solution with embedded resources (two .docx documents), I receive the following error

german error message: Die angegebene ausführbare Datei der Aufgabe "ResGen.exe" konnte nicht ausgeführt werden. Zugriff verweigert    my english translation: The executable file for the task "ResGen.exe" cannot be executed. Access denied.

I have no idea, how to resolve this error.

Does anyone have a clue?



P.S.: @moderators: I hope, I've posted in the right forum; if not, feel free to move this thread in the proper place.


We're developing an IronPython WPF/XAML app; it works fine in .NET 3.5 but now trying to move to IronPython 2.6.1 for .NET 4.0. We have a .csproj which we've updated to 4.0 - it mainly bundles our XAML and resources into a .dll - and everything works fine if we run interactively from the command prompt:

ipy program.py


but when we try to build it into a standalone .exe using the pyc.py tool:

C:\hs\dev\program>ipy.exe "c:\Program Files (x86)\IronPython 2.6 for .NET 4.0\Tools\Scripts\pyc.py" /main:program.py /platform:x86 /target:winexe program.py main_window.py model.py presenter.py wpf_helpers.py pyevent.py dialogs.py login.py k_ticket.py hs_quantity.py hssecdll.py debug_settings.py version_info.py

it completes 'successfully' but then if I attempt to run it, the command prompt returns immediately and not even the login dialog appears. There are no error messages, or indications of a problem. This worked fine (with paths as appropriate to reference 3.5) in .NET 3.5, but is now a total mystery. I've tried a variety of pyc.py flags that seemed possibly relevant, but nothing makes it work. Suggestions for what this could be or where to look for problems appreciated! Trying to get this over to customer ASAP.

is it possible to compile the App.config withing the EXE output or as a separate DLL? will I still be able to read and write to the appSetting in this case?



I am compiling my code (contain 300 subroutines).  During compiling, it says: "SS.exe has triggered a breakpoint"

and it shows the following part of my code and shows the green arrow on the following BOLD line.


      dimension IDUMMY(18)

        READ(33,1060) ( IDUMMY(J), J = 1, 18 )
        READ(33,1060) ( IDUMMY(J), J = 1, 18 )
        READ(33,*) NX, NY, NZ



Any help will be appreciated.



There is a beginner's win programming project called Hilo: http://msdn.microsoft.com/en-us/library/ff795784.aspx

  When I try to compile I get this error:


1>------ Build started: Project: Annotator, Configuration: Debug Win32 ------
1> 'uicc.exe' ??????????????????
1> ???????????????? ?????????????????
1> Performing Custom Build Tools
1>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 9009.
2>------ Build started: Project: Browser, Configuration: Debug Win32 ------
2> 'wsutil' ??????????????????
2> ???????????????? ?????????????????
2> Performing Custom Build Tools
2>C:\Program Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(151,5): error MSB6006: "cmd.exe" exited with code 9009.
========== Build: 0 succeeded, 2 failed, 2 up-to-date, 0 skipped ==========



The Annotator won't compile because "uicc.exe" is an internal or external command and is inaccessible.

Browser won't compile because "wsutil" is an internal or external command and is inaccessible.


The respective exes are (I assume correctly)located in the SDK/7.1 folder.


Can't find any info specific to this error w/regards to Visual Studio.  Most information I can pull up indicates an error in a path string somewhere.


I am working on a fairly large C++ project (based on Airplay SDK , but I think my problem is to do with visual studio), which I started a while ago in visual studio. I moved to a mac and XCode for a while and now have moved back to visual studio, but since then when I try to compile my project (in release or debug mode, it makes no difference) I get a message from Visual Studio Just-In-Time Debugger: "An unhandled win32 exception occured in cl.exe" followed by a number which is different every time. I tried debugging cl.exe and it points me to the file "dbghook.c", specifically to the final line of this function:

void __cdecl _CRT_DEBUGGER_HOOK(int _Reserved)
  /* assign 0 to _debugger_hook_dummy so that the function is not folded in retail */
  _debugger_hook_dummy = 0;

What could cause this error? Command line parameters etc? I have searched the internet for a good while and it seems that no-one else has encountered my problem.


Thanks for any help!


I have just installed Visual C++ 2008 Express Edition on my WindowsXP.

After compiling my program with no errors, I can't run my "exe" file, when I try to "Start Debugging" it won't run either.

The error message is:
"This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

In the current environment I still have :
Visual C++ 6.0 Professional Edition
Visual C++ 2005 Express Edition

Need some help



I have been having some issues with compiled exe files.

I want to create a directx program that would work on all windows PCs with directx 9.

I use win 7 64-bit and visual studio 2010 ultimate.

My friend has 2010 since beta.

When he compiles programs, they work (with d3d9_42.dll beside exe),

but when I do the same, it  doesn't.

Also when I send him my solution, his Visual Studio doesn't open it (I can't open his either).

When he manually adds all files and creates his own solution, compiles it, everything is fine.

I have 2010 DX SDK, and he has 2008.

Does anyone know what might be causing this?


I have a asp.net project on a remote server, and it works fine.  I took 2 pages "Mymail.aspx" and "Mymail.aspx.vb" and tried to add them to a visual web express project on my local PC, to see if they compile and I can make changes.  But they do not compile.  I can double-click a 'submit' button, and it will take me to the code-behind page and the handler, but nonethless, the compiler tells me the handler is not associated with that button.

Another problem is that is says "utility.hexencoding" is not found, even though I've imported the correct library for it.

Has anyone else had experiences like this?  I also tried creating the pages from scratch and then pasting in the content of the old pages, but that did not help.





I've made the following simple example of a program for which I get an error when attempting to compile as "C code" but not when attempting to compile as "C++ code":

#include <stdio.h>

int main(void) {
  char filename[256];
  printf("Enter file name: ");
  fgets(filename, 256, stdin);
  FILE * file;
  file = fopen(filename, "r");
<span style="font-family:Consolas; font-size:x-small"><span style="font-family:Consolas; font-size:x-small"><p>Further, I can further refine this to get what I perceive as the "bare minimum" necessary to generate the error:</p><pre lang="x-cpp">#include <stdio.h>

int main(void) {
  FILE * file;

However, if I make the simple change of removing printf, and thereby obtain the following code:

#include <stdio.h>

int main(void) {
  FILE * file;

then this compiles without any problem (except a warning, of course).


To summarize and to be perfectly clear, when set to "compile as C code", the first and second examples result in "error C2275: 'FILE' : illegal use of this type as an expression", while the third example compiles just fine. However, when set to "compile as C++ code", all of the examples compile without anything more serious than a warning.

My question is: why? I can't seem to find an answer anywhere. As I'm a beginner, I'm assuming that this isn't the result of a "bug", and that, in fact, I'm somehow doing something wrong. Any insight would be greatly appreciated. Thanks.



I have a dll which is built on VC6. I am doing some enhancements to it wherein I need to link a static library. This static library is compiled on VS2005. When I try to link the static library to the dll, VC6 compiler  gives a unrecognized or corrupt library error.

Is there a work around by which I can use the static library with my VC6 compiled dll. I cannot port the dll to VC2005 and porting the static library to VC6 would be my last option.

Any help would be great. Thanks



Compile the following with VS2010 and get

Error 1 error C2244: 'WWW<_YYY>::UUU' : unable to match function definition to an existing declaration 

gcc 4.3.4 compiles this test Ok

///////////////////////////////////////////////////////////////////////struct VVV { typedefint Q; };

template<class _YYY>
struct XXX
 typedef _YYY	Q;

template<class _YYY>
class WWW
 typedeftypename XXX<_YYY>::Q		TZZZ;
 typedeftypename TZZZ::Q		TQ;


template<class _YYY> typename XXX<_YYY>::Q::Q
WWW<_YYY>::UUU(TQ& _x) { return TQ(); }

int main(int argc, char* argv[])
 WWW<VVV> _x;

	return 0;


<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure