Is this message an error?: "The Operation Can Not Be Completed" - c#

I've got a very simple Solution with a single Project in it.
The project is just a simple WinForms, a config file to connect to sql-server, and 2 class files.
I've published the WinForms into production and it is working ok.
If I now open the Solution in VS and select the WinForms and press F5 I get an message "The Operation Can Not Be Completed" and the Winforms does not appear.
If, instead of F5 I use "Start Without Debugging" then it appears ok.
Should I be concerned about this message? If I should then how do I track down the reason behind it?
EDIT
Here are the debug options I have available:

YES! That is an Error Message!
In the Debug tab of YourProject there is a debugger option for "Enable the Visual Studio hosting process".
for more info check
http://social.msdn.microsoft.com/Forums/en-US/vbide/thread/40d2d241-a0c0-4137-9da9-e40611972c0e/

Related

Debugging C# application - Visual Studio

I am trying to learn C# and have followed the instructions in this tutorial
I have created a project, added the controls to the design surface and added code to the button click event. When I get to the part which asks me to test the application, I click "start debugging" and I get an error message saying
There were build errors, would you like to continue and run the last successful build?
If I click no, nothing happens. If I click yes I get another error saying:
Visual Studio cannot start debugging because the debug target 'C:\Users\hp\source\repos\HelloWPFApp\HelloWPFApp\bin\Debug\HelloWPFApp.exe' is missing.
As a complete beginner I have no idea why this exe file is missing or how to fix it. Could someone point me in the right direction at all?
It's possible that your code has never compiled. Press Ctrl-Shift-B and try again (or look in the Build menu).
First: You should clean the project than Build project again.
Second: Run project by pressing F5
Executable file you can find in bin/Debug folder in your root of project.
I do not have VS now, why don't you rebuild (or rebuild-all) your project, and if successfully rebuilds check whether the executable file exists in that folder, and also check the release folder, if it is there then change rebuild option to debug, as far as i remember you will see a drop down, on the toolbar,

Error while trying to edit code in debugging mode in VS2013

I'm a C# programmer and recently I've installed Visual Studio 2013. The problem is when i set a break point or get an error and trying to edit the codes while debugging I get this error and I couldn't find the same error searching on Google.
Changes are not allowed for this module as it was not built for
changes while debugging or the target .NET runtime version does not
support it
I also tried to check the options on Tools -> Options -> Debugging -> Edit and Continue, But didn't help.
Any idea what the problem is?
To edit a C# program while you're running it in Visual Studio 2013:
Go to Project, Properties, Build.
Set Platform target: x86
Disable "Optimize code"
Set Advanced, Debug Info: Full
I came across the same issue and found that "solution configuration" on the top bar was changed to Release from Debug,because I build the last version into Release folder.Changing back to Debug mode will solve the issue.
The code your probably modifying is included in the exception. Since, your code is not posted here, I can't say. So please refer to this link and check whether it is really not allowed.
We just had the same issue in Visual Studio 2013 and in our case it was because we had disabled the Visual Studio Hosting Process on the Debug tab in Project Settings.
You can try
Right click 'Solution' in the Solution Explorer.
Select Properties.
Choose Configuration Properties from the left menu.
Select 'Debug' from the dropdown list in the upper-left corner labeled 'Configuration:'.
I just had the same problem and found a solution that worked for me right here after trying 100 other things:
https://stackoverflow.com/a/12543388/5367013
1.) execute VsPerfCLREnv /globaloff
2.) reboot your computer
In a Web Forms application, I initially received the "Changes are not allowed for this module as it was not built for changes while debugging or the target .NET runtime version does not support it" error message. Based on suggestions above I completed the following:
Right click the project name, just under the Solution name in Solution Explorer and select Properties, the "Build" tab
Set Platform target: x86 (Note, for me this was already set)
Disable "Optimize code"
Click the “Advanced” button (near bottom) and set, Debug Info: Full
I tried to modify code, but then I received the "Edit and Continue" window stating "Changes are not allowed while code is running."
Here was the important part: I can only make changes while stopped at a breakpoint. If the page is loaded, I get that same "Changes are not allowed..." message. So set a breakpoint to a line above where you need to make the change, complete the update and you should be set.
Or (as I subsequently discovered) another way to modify code without using a breakpoint is to click in Visual Studio "Debug/Break All" (Ctrl+Alt+Break), make your change and then press F5 or click the "Continue" button. (Using this method you will might need a page refresh to see the mods.)
It worked for me by unchecking "Enable optimizations" option.
Please refer below image for more info.

IIS Express Immediately shutting-down running site after stopping web application

I'm using visual studio 2012 in the first days when I want to stop application in IDE, application was still running on IIS Express, I could browse and work with running application, but now I can't. IIS Immediately shutting-down application if I press stop button. Since I remember I didn't make any changes in setting. How should I do that running same as first days.
I recently faced a similar situation when suddenly my IIS Express stopped right after I stopped debugging. This happened after I turned on "Enable Edit and Continue". So if you disable this you will see that IIS Express stays running even after debugging is stopped.
Right click your project > click Properties > select the 'Web' tab on the left > uncheck the Enable Edit and Continue checkbox.
In VS2010 and VS2012, the edit and continue option is disabled by default when creating a new web application project. In VS2013 it is turned on by default.
You can find this option on the Web tab in the web project’s properties window.
With “Enable Edit and Continue” on, the VS debugger starts your web application in IIS Express. When you stop debugging, IIS Express is closed too. With this behavior, you will see the IIS Express system tray shows up during debugging and gone after debugging. This behavior is the same as in VS2012 when the Enable Edit and Continue option is turned on.
If you don’t need "Edit and Continue" functionality during development and would like IIS Express to stay after a debugging session, you can simply turn the Enable Edit and Continue option off.
If you want to use "Edit and Continue" or you are developing an Asp.net 5 site (ASP.NET 5 projects don't have an Edit and Continue checkbox in project properties) you have to use the "Detech all" command to stop debugging.
The debugger will detach from the iis process without closing it.
Clearly "Edit and Continue" feature will not work until you start debugging again.
Instead of hitting the (X) STOP button, you can use the Detach all menu item in the Debug menu. The major difference is that the stop button will terminate any process that is currently being debugged, while Detach All will disconnect the debugger from the processes, but will not terminate them.
The normal IIS worker process would also be terminated, but since it used to be running as a service, it will also automatically start up again and thus you could continue to use it without having to restart the process through |> Debug or |> Start without debugging.
Screenshot for Reference
It seems like since the release of Visual Studio 2015 Update 2 the accepted solution no longer works.
The easiest solution I've found so far is to start the project by selecting "Start Without Debugging" from the Debug menu.
This is probably best categorized as another workaround, but it works for me.
I generally start the project for the first time with the "View in Browser" context menu (or CTRL-Shift-W).
From then on, anything that requires debugging, I usually attach to the new existing iisexpress process. While mousing thru context menues would make this a non-starter, it is nearly as quick as F5 with the following keystrokes:
Shift-F6 to build the current project or Ctrl-Shift-B to build the
entire solution (this is only required if you have made changes but I
thought I should mention it since F5 already does this).
Ctrl-Alt-P opens the attach to process dialog
typing "iis" will then bring you down to the iisexpress process
hit enter and you're attached
If you have more than one iisexpress running, the last one started will generally appear at the top of the list. Another option is to shift-select and attach to all of them.
This has a number of advantages IMO. First and foremost, it doesn't terminate the process. Second, the browser window isn't closed when you stop debugging. It cracks me up when I see a developer repeat 7 steps to get to reproducing a bug, when all he needs to do is hit F5 in an existing browser window to just repost once the debugger is connected. Last, I have to do this already when attaching to nunit, so I get a more consistent experience.

Checking for solution on application crash

How can i disable the "checking for solution" when a error occurs in my program?
What i want is that it directly goes to the error inside Visual Studio 2010. Now i have to wait like 1 minute before i can select debug and see my error.
Did not have this behavior before and not really sure what changed in the environmental settings.
I was debugging with 2 breakpoints when this behavior occurs every time a error happens outside the breakpoints.
This is a settings of the OS rather than of Visual Studio, to disable checking for solution feature on Windows 7 :
Click on start, type: Choose how to report problems, then change it to Never check for solutions .
If Visual Studio stops reponding it shows "Checking for solution".
At this stage VS is trying to fix the problem and promts to "send report" if user allows that.
It makes not so much sense to disable this, nor it is allowed in Visual Studio.
What if you put a tick on the check box:
Debug -> Exception -> Common Language Runtime Exceptions?
Does it stop immediately?

C# can't start debugging application in IDE

I have C# application built in VS2010. Recently I changed something in project properties and now I have strange problem:
I can't start debugging of my application (F5). When I press F5 project compiles but then nothing happens. Even if I put some dummy code to my program.cs main function ie MessageBox.Show() it's not executed.
I can build app using "Build solution", it compiles and executes with no problems
In project properties following options are enabled:
- Define debug consant
- Define trace constant
- Advanced bulid settings / Debug info - full
What should I change to be able to debug my app from IDE?
Try deleting .suo file. Make backup first!
Here is similar thread:
VS2010, F5 - Builds but doesn't run (WPF)
Shutdown and restart VS :) It's happened to me a few times before.

Categories