Application for web development (silverlight) not debugging - c#

I am beginner to Visual Studio 2010 Express, I am trying to debug a C# web application using XML (as GUI buttons etc.) and using Silverlight.
Before running the application i have Step Into and Step Over (which can be pressed, and it's color is in dark where as Step Out color is light and that can't be pressed). You can see the screenshot on this link.
And on clicking the Start Debugging button I don't have any option for attach process and it don't debug actually when i see on my break points it not at all debug. Now all Step Into and Step Over and Step Out, all are in light color and none can be pressed.Please see the screenshot on this link also on clicking "Web" i get this see the link please prntscr.com/34eya9
I am using Firefox Could that be a problem for not debugging ? But it is displaying the GUI i have created using xml and c#

right click on the project, go to "properties", select "web" tab, scroll at the bottom, and you will find that under "debuggers" silverlight is not checked.
check that, and rebuild the solution.
this should then enable silverlight debugging.

Related

Debugging c# in Xamarin or Visual Studio (preview) for mac [duplicate]

I'm starting to use Xamarin Studio, and migrating from VS to it, but when I try to run a console application (the unique one loaded at the moment), fails and throws an exception in Console.Clear() (Supposing I can't do that in an integrated debugger), then i thought that one way to solve it was by compiling it and running it, like Visual Studio does, and Debug the application outside the IDE, but I can't figure out how. Could someone tell me how to solve this problem? Thanks.
EDIT: For any reason, it runs in the embedded window when selecting Release, but it can't read input, so it gets stuck.
You need to set the project option to have it run your console app in an external console:
Visual Studio For Mac:
Project Options / Run / Configurations / Default / Run on external console
Xamarin Studio:
Project Options / Run / General / Run on external console
You can fix this by running your program in a separate console window. It’s easy to do, although you need to follow the steps closely.
The first step is to bring up the project’s options window. You do this by finding your ‘Solution’ panel (normally on the left side of the Visual Studio window), and within that panel you much right-click on the project (this is pointed to by the “1” arrow in the below picture). Once that context menu appears you need to click on “Options”, which may be very close to the bottom)
Once the Project Options window appears, you should click on Run  Configurations  Default (next to the ‘1’ arrow, below), and then check off Run On External Console (next to the ‘2’ arrow, below)
Once that’s done you’ll need to click the ‘Ok’ button.
Everything should work fine at this point, but it’s always good to double-check: try running a program that asks you to type something and verify that it’s working correctly.

External Terminal / Debug outside the IDE

I'm starting to use Xamarin Studio, and migrating from VS to it, but when I try to run a console application (the unique one loaded at the moment), fails and throws an exception in Console.Clear() (Supposing I can't do that in an integrated debugger), then i thought that one way to solve it was by compiling it and running it, like Visual Studio does, and Debug the application outside the IDE, but I can't figure out how. Could someone tell me how to solve this problem? Thanks.
EDIT: For any reason, it runs in the embedded window when selecting Release, but it can't read input, so it gets stuck.
You need to set the project option to have it run your console app in an external console:
Visual Studio For Mac:
Project Options / Run / Configurations / Default / Run on external console
Xamarin Studio:
Project Options / Run / General / Run on external console
You can fix this by running your program in a separate console window. It’s easy to do, although you need to follow the steps closely.
The first step is to bring up the project’s options window. You do this by finding your ‘Solution’ panel (normally on the left side of the Visual Studio window), and within that panel you much right-click on the project (this is pointed to by the “1” arrow in the below picture). Once that context menu appears you need to click on “Options”, which may be very close to the bottom)
Once the Project Options window appears, you should click on Run  Configurations  Default (next to the ‘1’ arrow, below), and then check off Run On External Console (next to the ‘2’ arrow, below)
Once that’s done you’ll need to click the ‘Ok’ button.
Everything should work fine at this point, but it’s always good to double-check: try running a program that asks you to type something and verify that it’s working correctly.

New Blank Page(XAML) projects = Controls are not showing on the MainPage(only their borders are)

I'm new to Visual Studio and couldn't find my answer anywhere else for hours over the internet..
I'm Using "Visual Studio Express 2012 for Windows" and everytime I create a new project with a blank page (XAML), the designer only shows me the frame of the page with its missing background.
And any control I drag to it, is invisible (I can only see the square border of the control I dragged but no texture..)
This is only happening during design time. On RunTime it actually shows up..
This is happening to me since I had the first fresh install. Just to be clear, I am NOT opening an existing previous project.. I have non. This is the first time I make a project in C# and I'm surprised I didn't find anything useful so far over internet search..
Also tried installing, uninstalling, repairing and changing to different versions...
The problem didn't show on Visual Studio 2012 Express for Desktop, but this product doesn't seem to be fit to my needs.. (I'm trying to also learn how to develop for Windows Store and other products)
The IDE doesn't show any errors or warnings..
Help would be much appreciated!
P.S - I'm running Windows 8.1
You can try Blend to open the project and render the xaml,if the problem appear too, maybe you should check out your graphics card or update driver.
try with this!
Check the following:
Tools -> Options
Expand Text Editor -> XAML -> Miscellaneous
Make sure that "Always open documents in full XAML view" is not checked
Or perhaps the default program for opening .xaml files has changed:
Right-click your .xaml file in Solution Explorer
Click Open With...
Select XAML UI Designer
Click Set as Default button
Click OK
If it's related to the video driver, maybe disabling hardware acceleration will help?
Or you could try Visual Studio Community Edition (http://www.visualstudio.com/, click on the Download button under "Free developer tools"
Did one of these suggestions work?

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.

is it possible to edit code while debugging in visual studio, like in eclipse (java)

Is there an option to edit the code when debugging in a breakpoint in Visual Studio. When I stop, all files seems locked for editing.
Is there a way to change this behaviour? It is possible in Eclipse
EDIT: after trying all suggested below (including move it to debug from release) now it is telling me I don't have the correct ms-office version and debug cannot start in debug mode. However, in release mode it was working. I am trying to debug an outlook add-in.
Yes, it's called "Edit and Continue", in Tools | Options under Debugging. Note that it's not compatible with IntelliTrace, so you have to disable that if you're using it. (Thank you Anton Semenov for that info.)
Edit: If you're using a really old version (the original VS.Net, as opposed to VS.Net 2005 or later), it was pretty fiddly about this (or didn't have it, I can't quite recall; I just remember being frustrated). But if you're using VS.Net 2005 or later, in my experience, it's enabled by default and works very well. When execution is paused (and you said you'd hit a breakpoint, so...), you can make quite a variety of changes and the environment will happily compile them and continue. Make sure all of the projects you want to debug are in the solution.
In general, it is possible, but you have to make sure you are compiling your project to x86 platform.
For this, right click on the project name in the Solution Explorer, go to Build and set the Platform Target to x86.
Edit:
Of course, in order to be able to edit a file, the execution need to be paused (in a breakpoint, for example)
yes you can update code in debug mode. Set the break point to the point which u want to edit . When the execution comes to this point then edit your code then press f5. It will take the changes.
win7
Yes, it's called "Edit and Continue", in Tools | Options under Debugging. Note
that it's not compatible with IntelliTrace
win10
can turn on IntelliTrace
# How to set a Visual Studio breakpoint to pause execution of your program at that point
To set a breakpoint, first decide which executable line of code you want the program to stop on 'Before' that line of code is executed.
Set the cursor flashing anywhere on that line.
Press [F9] to set the breakpoint, and a red circle appears on the far left.
Press [F5] to run program.
To close the program, click on the program window so that it is your active window, and press [Ctrl]+[Pause].
To disable the breakpoint, but not delete it, set your cursor flashing on that line again, and press [Ctrl]+[F9], which turns the circle white. (Or Right-click the red circle, and click "Disable Breakpoint")
To delete the breakpoint, Right-click the red circle, and click "Delete Breakpoint".
Using the mouse as an alternative way to set, disable, or delete breakpoints
Once you know where the breakpoints show up on the left side of the Visual Studio window, you can set a breakpoint by double-clicking at the point where you want the breakpoint to be placed, and it will be placed there.
If you double-click a red breakpoint, it will be removed.
If you hover your mouse pointer on a breakpoint, two little icons appear slightly above, and to the right of the breakpoint.
Clicking that right-side icon toggles the breakpoint from active to disabled, and vice-versa.
For many more details, see the topic:
"Getting Started with the Debugger"
https://msdn.microsoft.com/en-us/library/mt243867.aspx
Also, see the left column on the page from the link above for the additional pages:
"Navigating through Code with the Debugger"
https://msdn.microsoft.com/en-us/library/y740d9d3.aspx
"Using Breakpoints"
https://msdn.microsoft.com/en-us/library/5557y8b4.aspx
Video: And for a 5-minute introductory video, see:
"Debugging in VS Code"
https://code.visualstudio.com/docs/introvideos/debugging

Categories