As a relative newbie I try to read as much as I can about a particular subject and test/write as much code as I can. I was looking at one of Jons Brainteasers (question #2) and my output was different than the answer. Which makes brings me here to ask if something has changed in recent versions and to see what output others are getti...
When you have an object instance in C#, you can use the this keyword inside the instance scope. How does the compiler handles it? Is there any assistance for this at runtime?
I am mainly wondering how C# does it vs in python you have to provide self for every function manually.
...
Hi all
How to call a CLR Stored Procedure from codebehind of an aspx page?
I am using SqlCommand with commandtext as CLR Stored Procedure name and SqlHelper.ExecuteDataSet() as below.
string connectionString = ConfigurationManager.AppSettings["ConnectDB"];
SqlConnection sn = new SqlConnection(connectionString);
SqlParameter[] sqlPar...
I have been using Visual Studio 2008 quite long but lately I am getting this message when I am developing an application in C#:
Common language runtime detected an invalid program
This happens when I try to enter to the properties of a component (text masked box properties, tool box property etc..). But it really became a problem w...
please any one help me
while debugging a CLR sp am getting error like "cancelled by user"
i think i need to enable something?
...
Is this a CLR restriction or a language design decision? I tried to do it in C++/CLI, of course where it works because the need to support native c++:
public ref class Test
{
public:
static Test^ operator &( Test^ msg, int& i )
{
i = i + 1;
return nullptr;
}
};
and then looked at the compiler ...
Hi ,
This is a .net CLR related question.
I have 3 objects object A,B,C
A refres B and B refers c
What happens to these objects in the heap if i kill the Object "A" explicitly.Which will be garbage collected?(Object A or B or c or all?)
Can some one explain the garbage collection process in this scenario in detail.
Thanks in advanc...
Do you know any good book about the workings of the CLR, the .NET Framework and CIL as opposed to any specific .NET language?
...
I know there's nothing in the box ... but does anyone have any tricks.
Managed threads not OS threads please.
Cheers
Answering the comments:
Version is .Net 3.5.
I want all managed threads in the current running process.
I want them so I can get the call stack of everythread.
Thanks
...
C# doesn't allow structs to derive from classes, but all ValueTypes derive from Object. Where is this distinction made?
How does the CLR handle this?
...
Hi All,
I am relatively new to .net. As I was trying to grasp the concept of Garbage Collection(from "CLR via C#"), I came to know how strong is the Garbage collection approach. But then as I read I understood that native resources allocated should be released. The methods are:
i) Making our type derive from CriticalFinalizerObject type...
I have a program which I believe to be running in .NET 4.0, but I am unable to mixed-mode debug it (something new .net 4.0 for 64-bit application)
I wanted to confirm if I'm truly running in .NET 4.0 or is it running .NET 3.5
Is there a way to look in the memory space or something?
...
I am trying to run automated tests on a particular product.
The test consists of installing the product into different locations on the hard drive and then performing some operations on it and then closing the application.
The code that launches the process looks like this:
using (Process process = new Process())
{
...
For example Dim aInt as Integer should have the value as nothing instead of 0.
...
class Program
{
internal delegate int CallBack(int i);
static void Main(string[] args)
{
CallBack callbackMethodsChain = null;
CallBack cbM1 = new CallBack(FirstMethod);
CallBack cbM2 = new CallBack(SecondMethod);
callbackMethodsChain += cbM1;
callbackMethodsChain += cbM2;
De...
There is a similar question targeting the Java VM but I haven't found a question for .net (please close and mark as duplicate if I was missing something).
So - is it possible without nasty unmanaged interop? And with crashing I mean a real "xxx.exe has stopped working" not a StackOverflow- or OutOfMemoryException.
I think it is not pos...
What's the best way to get a chunk of memory (i.e. void*) from a COM server to C#?
We have been using an IStream (using CreateStreamOnHGlobal) and passing that back, which worked. However when we tried this on x64 CLR with x32 C++ COM it blows up.
The COM has to be x32 because it uses external 32 bit DLLs. The C# could be forced to r...
I have recently finished reading C# in depth by Jon Skeet and I'm looking for the next book to read, one that extends a little more "in depth" my knowledge of c# and .NET in general and I'd be open to other kind of books. I've read Code Complete and The Mythical Man-Month, and though I find them both to be awesome, I'm looking more for a...
I've written a method to handle regex validation in AX2009. Problem is that it always returns false, no matter what the expression or input string. Returns no errors, just 'false' Mind taking a look? I'm probably missing something simple.
This post has been updated to included the corrected method, without the error, so you can cut ...
This is a question based on the article "Closing over the loop variable considered harmful" by Eric Lippert.
It is a good read, Eric explains why after this piece of code all funcs will return the last value in v:
var funcs = new List<Func<int>>();
foreach (var v in values)
{
funcs.Add(() => v);
}
And the correct version loo...