Question: I know that struct is a value type , that means it defined on stack .

But I can do A a = new A(); (A my struct of course). and it defined on heap , and only the reference variable is on stack.

Can you explain me this one please .

Answer: 
Value types are stored on the stack *sometimes*. It's a complex topic and usually the exact storage of a variable (stack or heap) is irrelevant for programming issues. The real difference between value and reference types lies in their *behaviour* (for example, value types are always copied *by value*).

Eric Lippert covers this issue in detail:

* <http://blogs.msdn.com/b/ericlippert/archive/2009/04/27/the-stack-is-an-implementation-detail.aspx>
* <http://blogs.msdn.com/b/ericlippert/archive/2009/05/04/the-stack-is-an-implementation-detail-part-two.aspx>
* <http://blogs.msdn.com/b/ericlippert/archive/2010/09/30/the-truth-about-value-types.aspx>
> 
> But I can do A a = new A(); (A my struct of course). and it defined on heap , and only the reference variable is on stack.
> 
> 
> 

If `A` is a value type as you say, and `a` is a method local, it will be allocated on the stack. *Unless* `a` is used in a closure -- then it will be allocated as part of a heap-allocated object of a compiler-generated class.

If you want further analysis, you will have to post the definition of the `A` type as well as the entire method where you define this variable.