By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,052 Members | 1,551 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,052 IT Pros & Developers. It's quick & easy.

Why SOMETIMES when i try to assign an object to null in immediate window i can't?

P: n/a
TS
I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why?

thanks
Sep 28 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(object sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=null" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 29 '06 #2

P: n/a
TS
any comments?

"TS" <ma**********@nospam.nospamwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
>I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why?

thanks

Oct 5 '06 #3

P: n/a
TS <ma**********@nospam.nospamwrote:
any comments?
There was one from Jeffrey Tan of Microsoft, which was full of
pertinent questions. Please answer those. Most importantly, please
provide a short but complete program which demonstrates your problem.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 5 '06 #4

P: n/a
TS a écrit :
any comments?

"TS" <ma**********@nospam.nospamwrote in message
news:ug**************@TK2MSFTNGP04.phx.gbl...
>I get this message in the window "cannot assign 'null' into 'xxxxx'". this
is an object and hence a reference type. Sometimes this isn't
permitted...why?
Hello,

Perhaps about Structure type, like a DateTime : you cannot assign null toa
DataTime object because it is a srtuct.

HTH.
Oct 5 '06 #5

P: n/a
Hi TS,

I am reviewing this issue thread. It seems Jeffery's reply is omitted. I am
not sure of whether this is a system error. So I pasted it again in the
following. Your further information is quite helpful for the issue
resolution. Thanks very much and look forward to your reply.

-----
From: je***@online.microsoft.com ("Jeffrey Tan[MSFT]")
Date: Fri, 29 Sep 2006 08:57:54 GMT
Subject: RE: Why SOMETIMES when i try to assign an object to null in
immediate window i can't?
Newsgroups: microsoft.public.dotnet.languages.csharp

Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(object sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=null" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
-----

Sincerely,
Yanhong Huang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #6

P: n/a
TS
i've been viewing posts thru outlook express and it never came over. I just
now see this post and Cyrille37 and Yan-Hong. That is aggrevating because
i've been checking this post every day.

thanks for informing me, i guess OE is quirky. (This has happened before).
i'll check out the other post from the website.

"Jon Skeet [C# MVP]" <sk***@pobox.comwrote in message
news:MP************************@msnews.microsoft.c om...
TS <ma**********@nospam.nospamwrote:
>any comments?

There was one from Jeffrey Tan of Microsoft, which was full of
pertinent questions. Please answer those. Most importantly, please
provide a short but complete program which demonstrates your problem.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too

Oct 6 '06 #7

P: n/a
TS
First off i'd like to say that I never got this post thru outlook express and
only just now see this post thru the website...

vs 2003, web app, C#

i'm also sorry to say that i have shutdown VS since my post so long ago, and
i cannot retrieve that line from the command window and don't recall which
object i was working with.

When i come across it again, i will make sure to get the code to simulate it
and post it. I do know that i have run across this more than a couple of
times in the last year at different spots.

thanks

""Jeffrey Tan[MSFT]"" wrote:
Hi TS,

Can you tell me what version of Visual Studio you are using, VS.net2003 or
VS2005? What type of project you are creating, winform, console or Asp.net?
Finally, what language you are using, C# or VB.net? These information will
be helpful for us to accurate identify the problem context. Thanks.

I have tried to use VS2005 with C# language to perform a test in a winform
project. My testing code snippet is listed below:

Form f = new Form();
private void button1_Click(object sender, EventArgs e)
{
}

I set a breakpoint in button1_Click method, once the breakpoint is hit, I
input "this.f=null" in the "Immediate window", I will get the following
result:

this.f=null
null

So, it seems that it works well on my side.

Can you provide a little sample project and detailed reproduce steps to
help me reproduce your problem? I look forward to your feedback. Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 6 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.