|
mihai_1529 wrote: (copy the class files + other files on a CD or something)
Yes, the or something is to put the framework on the CD as well. This is a silly question - if there was an easy way to not use the framework, why wouldn't everyone just do that ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
www.go-mono.com
use mono to compile it to native code. or embed mono. instead of .NET Framework. I may work.
VOX
|
|
|
|
|
hey all,
Is there a tool to monitor handled exceptions of the core of .NET framework which slowes down my application? I need something like this to determine what kind of exceptions are raised when i use a datagrid. While using perfmon i can there are thrown exceptions but not where and why.
Please Help!
Thanks, Bernd
|
|
|
|
|
Hello people,
I was speaking with a friend of mine about which are the most performance-decreasing exceptions that may occurr during the execution of a program.
The application we were talking about is an enterprise one,(for which we're involved all day long in coding) and it has classical structure from PL to DO.
We have taking the conclusion that the System.Xml.Schema.XmlSchemaException class and the Parse one are the ones that teorically can affict our application most.
How can we check the entire production to trace the exception's count?
What are the most common exception that you've found?
Thanks a lot
Paolo Ponzano
-- modified at 3:44 Saturday 22nd October, 2005
|
|
|
|
|
Paolo Ponzano wrote: How can we check the entire production to trace the exception's count?
You can use Perfmon (type perfmon.msc at the command prompt) and the .NET CLR Exceptions Performance object to track the number of exceptions thrown.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
thank you, nut in that way can I also know the type of exception that has been thown?
Thanks
Paolo
|
|
|
|
|
|
Hi
I found a very strange result after trying to exchange some characters:
Public Shared Function change_char(ByVal s As String, ByVal from_char As String, ByVal to_char As String) As String
While s.IndexOf(from_char) > -1
s = Mid(s, 1, s.IndexOf(from_char)) + to_char + Mid(s, s.IndexOf(from_char) + 2, s.Length)
End While
Return s
End Function
If I call this function with german character ÄÖÜ.., everything is OK,
mytext="ÄÖÜßäöüß"
Dim s As String
s = change_char(mytext, "ä", "ae")
s = change_char(s, "Ö", "oe")
s = change_char(s, "ü", "ue")
s = change_char(s, "Ä", "Ae")
s = change_char(s, "Ö", "Oe")
s = change_char(s, "Ü", "Ue")
but
s = change_char(s, "ß", "ss")
goes wrong and bring unlimited ss, because it finds even after the change to ss the character ß.
Does anybody have an explanation for that?
Thanks in advance
Axel Schmidt
|
|
|
|
|
Hard to say, but I am quite sure String.Replace doesn't have the problem - so why not use it?
|
|
|
|
|
Hi,
changed it to
While s.indexof("ß") > -1
s = s.Replace("ß", "ss")
End While
and the problem is still there.
"äß uuuu" becomes "ässssssssssss... uuuu"
This only happens with the ß-character, every other character seems ok.
Axel
|
|
|
|
|
You should NOT use a while loop. Replace will replace all places the ß character is used.
Apparently there is some culture aware comparison between ß and "ss". I do not think you will have any problems with it if you do not loop the replace, but worst case you can always change the thread culture to "en-US" in the function - just remember to use a try/finally (probably called something else in VB, I only program C#) block to ensure the culture is changed back even if an exception is thrown in the code.
|
|
|
|
|
I try to understand the difference between IL and machine code executable so that I can see the relationship between IL and CLR. Suppose that I compiled aPgm.cs
csc.exe /debug+ aPgm.cs
This creates stand alone executable. I can see it using ildasm.exe. Is this exe file machine code? Then which is machine independent code or IL ?
Thank you in advance
Nuray
|
|
|
|
|
Nuray wrote: This creates stand alone executable. I can see it using ildasm.exe. Is this exe file machine code? Then which is machine independent code or IL
The exe file has MSIL and not machine code. That's what makes the exe machine independent. At runtime, the JIT compiler generates machine code on the fly. If you really want to see how IL gets compiled to machine code, download this[^], load the SOS (Son of Strike) extension, let the method you want to execute run once and then give the !u command, which unassembles the JIT code.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Dear Sentil,
Let me ask one more question before downloding. How about other exe files one can produce using any compiler other than .NET. like VC++? I can see their metadata using ILDASM. Then what is the difference those exe file, one created from .NET and the other is created other than .NET
Yours
Nuray
|
|
|
|
|
Nuray wrote: How about other exe files one can produce using any compiler other than .NET
There is no ".NET" compiler, there are C# compilers, MC++ compilers, VB compilers and so forth. For VC++, the same compiler can generate IL or machine code based on a command line switch (/clr). So all the above compilers generate IL, so there is no difference. That's why .NET supports language interoperability i.e you can use VB dlls in C#.
So yeah, there's no difference between code generated by different language compilers, providing they're targeting managed code.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I have created a new keypair: "C:\SOURCE CODE\keypair.snk" and specified it in my AssemblyInfo.cs as [assembly: AssemblyKeyFile(@"C:\SOURCE CODE\keypair.snk")]
When I examine my keypair using "sn.exe -t C:\SOURCE CODE\keypair.snk" it gives me a public key token which is different to that which is returned when examining the output of my app: "sn.exe -T C:\SOURCE CODE\MyApp\bin\MyApp.dll" ???
Am I missing something or Is this right? If so, which Public Key Token should I refer to in my web.config - the keypair.snk or the MyApp.dll one?
Pls help
Thanks in Advance
|
|
|
|
|
Running sn -t on the snk file failed with an error message for me, I wonder how it worked for you? Anyways, AFAIK, you should give the dll file to know the public key token.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
The command works fine for me.The output is as follows:-
C:\Documents and Settings\kdhir\My Documents\Visual Studio Projects\TestApp\Clas
sLibrary1\obj\Debug>sn -t ClassLibrary1.snk
Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Public key token is c559f0648b2f3b60
C:\Documents and Settings\kdhir\My Documents\Visual Studio Projects\TestApp\Clas
sLibrary1\obj\Debug>sn -T ClassLibrary1.dll
Microsoft (R) .NET Framework Strong Name Utility Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.
Public key token is cfc0b9a3c52b17fb
As you can see the public key token extracted from both are diffenent.
If you could tell me the rason for this.
Regards
Kapil
|
|
|
|
|
How to free the display of the form/control? SuspendLayout() can not work.
Thanks!

|
|
|
|
|
what you need is the invalidate function..
invalidate has several constructors.. but to clear out the hole form you simply use "Invalidate()";
ex. if (x==0)
Invalidate();
//This will clear the form surface if the value of X is 0
there are other constructors calling regions, polygons etc but there would be of no use to enumerate them.. another one you could use is the one used to clear a rectangular section of the form:
Invalidate(Rectange rectf)l
ex. if (x==0)
Invalidate(new Rectangle(new Point(0,0),new Point(50,0),new Point(0,50), new Point(50,50));
//This will clear a 50 by 50 pixel square section of the screen starting from coord(0,0)
-- modified at 18:29 Sunday 23rd October, 2005
|
|
|
|
|
Hi,
I have a winform app that is occasionally going into a loop and taking up 99% of CPU. I have stepped through it with the debugger 20 times at least and all appears fine so it seems it's only happening when running standalone (ie: not via VS.Net).
I simply can't work out why it's doing it so what I want to know is how I could catch the app doing this and then throw an exception or display a message showing me where it is in the program. Is there any way in .Net to do this?
Failing that are there any tools that "profile" the running app so I can try and work out where the problem is?
TIA for any suggestions or help...
Mike
|
|
|
|
|
It doesn't have to be looping to hang like this. It just needs to call a function that blocks execution and the function call never returns. But, you never know...
If it does this frequently, you can try recompiling the app in Debug mode and running the application under the debugger and just wait for the problem to happen. When it does, flip back to the debugger and hit the Pause button. You SHOULD see a highlight on the line that's hung or a line inside your infinite loop. If not, you can try looking at the Call Stack to see what method your in inside your app to at least pin down approximately where your app is hung.
I also found the Runtime Debugger helpful a couple times to root out a particularly nasty bug a while back, Runtime Debugger (CorDbg)[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Like Dave said, you can attach to the Visual Studio debugger and hit Break All when you sense 99% CPU usage.
If you want a decent *free* profiler, I'd suggest DevPartner Profiler Community Edition[^]. Plugs into VS .NET and the price is just right
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Thanks Guys... I found what it was in the meantime so I've solved it now... but I have to honest and admit I didn't know about "break all" - seems you really do learn something new every day! (It's also a bit emabarrassing when I've been using VS.Net for 3 years and counting!!)
Anyway, it turned out to be a Regex Match function that was getting stuck finding URL's and email addresses in some HTML I was giving it. The HTML I'm matching is a chunk scraped from one of our client's pages which was not always the same so sometimes the regex would work and other times it would go into an endless loop. I reviewed how I was fetching the HTML from the pages and now it seems to work fine again.
Cheers,
Mike
|
|
|
|
|
i would check all the looping statements and add a message to each.. the one that is displayed while the looping takes place is your problem.. anyway i think either your CPU is not very performant and cannot process a longer loop fast, or your loop is veeeeeeeery long, and in that case u will have to find a simpler way to code that section..that is, in case your loop ever stops.. or there could be that the end-loop condition is never met.. check your code.. there can not be anything wrong with the compiler.. if there are no errors that's its job... you can also use Watch and Breakpoints but I prefer attaching message boxes to suspicious sections
Ravenash
|
|
|
|