Determining High CPU Usage on my C# Console App [closed] - c#

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I am working on a C# console application. It mostly just hosts a soap service, and listens for messages coming in to process. However, even when no soap messages are received, all 6 cores on my laptop are being heavily used. From a code walk through I can't see what is causing it.
Is there are any debug tools in Visual Studio that can help pinpoint where CPU is being eaten up.

You can use the Profiler that is built into Visual Studio.
For Visual Studio 2013, select the menu ANALYZE / Performance and Diagnostics
Use the Performance Wizard.
It will show you hot spots in your code (where the most CPU cycles are being burned).
Note that you may need to launch Visual Studio as Administrator for proper profiling.
NOTE:
You can download stand-alone profiling tools for VS 2010 from Microsoft. See https://stackoverflow.com/a/11197203/141172

Related

Window application what written in c# by myself not appearing [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
Today I run into a strange error.
When I start my program without Visual studio 2010 Express, start to running, but the gui not appear, and inpossible do stop it in task managger.
But if I run it in Visual studio, it work without any problem.
It do it with my all c# program,even what I write years before, but not any other program.
Tried to check, if a virus do it, but it can't find anything.
Operting system is Windows 7
It can be antivirus who stops execution of your application. Try to turn off it.

Debug a compiled program? c# wpf [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
i am currently developing an alternate shell for windows( to be replaced with explorer).
the problem is the program runs fine when run as a normal executable.
but when i set it as default shell for windows and re-log in into my user account the program runs for a few seconds and then it force closes.
is there anything i can do what might be going wrong?
BTW working on c# wpf.
You are always debugging a compiled program.
However, when you run it from Visual Studio, the debugger is automatically attached (so you can see exceptions, set breakpoints, etc).
You can do the same thing to an already running process by using the "Attach to Process" option in the "Debug" menu.
Other things to try:
Add try/catch blocks around areas that can blow up
Add logging, especially to the try/catch blocks
Put a "sleep" at startup if the program closes before you can attach the debugger.
Also, from #ScottChamberlin, you can directly ask that a debugger be attached from the running executable via System.Diagnostics.Debugger.Launch().

Delete 'bad stuff' from Visual Studio [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
Our company has very strict guidelines in what technologies our employees are allowed to program. Because of that, I'm looking now for a way to delete 'bad stuff' from all Visual Studio installations on every development machine (similiar to group and machine restrictions that can be configured in a Active Directory domain environment).
This includes:
Everything related to Visual Basic
Everything related to Windows Forms
Default WPF templates (as we want to enforce our employees to strictly use MVVM)
I know Visual Studio has certain folders for "Project Templates", "Item Templates", but they're cluttered everywhere (for each framework version, language, .NET syntax) and even if the templates are gone, one can still use e.g. Windows Forms components through the .NET framework (Windows.Forms namespace)
Is there a way to achieve this?
I will write it as an answer because it may be useful to others.
You can try to implement a check-in policy for unwanted file types
http://msdn.microsoft.com/en-us/library/ms364074(v=vs.80).aspx
see under "Tracking Tasks and Enforcing Standards" header
You can control VB.NET support from Visual Studio, through Unattended installation options.
You cannot completely prevent someone from using Windows Forms, or even VB.NET components.
They are a part of the core .NET platform (not visual studio), even removing template support from Visual Studio you can still add references to those assemblies.
This appears to be a human problem, not a development problem. If management has dictated certain development standards, and those standards are not being adhered to - that's something that management needs to handle. eg: Disciplinary action.

StatsD and Graphite-like tools for .Net and Windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I was recently sent this link to Statsd which would be an interesting tool for us to monitor various aspects of our product, but it would be a hard-sell for us because of the PHP and non-Windows toolset. (This question asks about installing this on Windows, without an answer...)
Can anyone recommend Windows / .Net toolsets that might provide similar low-overhead monitoring of systems? Within reason, paying for a toolset should not be a problem.
I did find this microsoft page that looks quite interesting, but let's be honest, it does not have as many cool graphs that show the kind of thing that would be nice to have as an end-result :)
Your experiences and thoughts on direction would be appreciated: I think our ultimate goal would be 'wall-boards' e.g. large screens cycling through several key graphs or views so the whole team could understand and monitor some key metrics of the products we are supporting. Our client uses SQL Server Reporting Services for this, but their reports seem to be mostly statistical and very little graphical.
I've ported Graphite to Windows. It was pretty easy to do this. I've issued a pull request to the main project. I hope it will get merged. Until then, you find the fork under:
https://github.com/stephanstapel/carbon
Graphite installation requires some additional steps I published here:
http://www.s2-industries.com/wordpress/2012/12/running-graphite-on-windows/
Why not run Graphite in a Linux VM on top of a windows server? You get the full support of the graphite community, while being completely hosted on windows.
If you were wanting to replicate statsd, I would create a Windows service listening via UDP on a specific port. With a fairly open database schema, you could mimic its low-friction fluidity. That would take care of statsd and Carbon, the data collector piece of Graphite. You would then need to write a management tool that analyzes and presents the data in place of Graphite.
I would, for this reason, encourage you to just take the Linux route. Otherwise, you'd be fighting every battle the developers of those tools fought all over again.

which language / tool to use [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Here's the situation:
I need to develop a desktop tool that will take in an input from Oracle (text) and it's output is a print of a layout generated by that tool.
The tool needs to be fast and able to print easily and not much extra software required on client PC's which ALL run Windows.
Now i've studied Java, PHP in the past however I don't want to use PHP for the Desktop App
and I have my doubts about Java in regards to Printing and developing the GUI.
It seems to me like with C# I can develop the GUI easier and faster, and most PC's have a lot of the tools required for the GUI in the OS (.net framework).
A tool like NetBeans helps, but more often than not the GUI design is either broken
or shoots across the screen when I make a simple change.
So now I'm thinking about starting in Visual C#, however I would like to get your
opinion.
And from my past VERY short .NET programming experience, I can still remember that deploying over the internet is easy as well, with JAVA I've had some issues with that as well before I got it to work.
So in short:
Windows environment
Lot of GUI design
Fast app that runs on client Windows PC's without much 'extra' software installing
Easy print programming
THANK YOU!
My preference would be C# or VB.NET with Windows Forms. WPF is also worth looking at, and will give you the most modern UI, but it has debatably a steeper learning curve attached.

Categories

Resources