473,508 Members | 2,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exception: "Value cannot be null. Parameter name:s"

Hi there: Well, let me start off by saying that I am a Visual Studio drag
and drop weenie, not a real programmer. So I tend to get confused when
things do not look like the instructions said they were going to look :) .
Here is my current dilemma:

I am having a strange problem with my ASP.NET application. I am building the
application using Visual Basic .Net in Visual Studio.NET 2003. Lately, I
have frequently been getting the following exception (see below) when I
debug the application. If I step through my code and determine what is
actually broken (the exception is not very informative), I find that the
error has nothing whatsoever to do with the exception that is thrown. The
really, really strange thing is this: When I get this error, the "real"
exception always seems to be thrown from my code contained in a .vb class
file. If I create a new .vb file, and cut-and-paste the code into the new
file, delete the old file, and then re-run the application (with no actual
changes to the code whatsoever), then I get the "real" exception instead of
the "value cannot be null" exception. I have dozens and dozens of .vb class
files.. so far have gone through this process on about 10 files. This is
getting annoying. Has anyone experienced anything like this? I searched
newsgroups and ms knowledgebase, but I did not find anything resembling my
problem.
-----------------------
The exception:

Value cannot be null. Parameter name: s
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: s

Source Error:

An unhandled exception was generated during the execution of the current web
request. Information regarding the origin and location of the exception can
be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: s]
System.IO.StringReader..ctor(String s) +78
System.Web.FormatterWithFileInfo.GetSourceFileLine s(String fileName,
Encoding encoding, String sourceCode, Int32 lineNumber)
System.Web.UnhandledErrorFormatter.get_ColoredSqua reContent()
System.Web.ErrorFormatter.GetHtmlErrorMessage(Bool ean
dontShowSensitiveInfo)
System.Web.HttpResponse.WriteErrorMessage(Exceptio n e, Boolean
dontShowSensitiveErrors)
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean canThrow)
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext
context, Exception e)

----------------------

Regards,

Chris Herring
Jul 21 '05 #1
2 57821
Dear Weenie,
without getting too deep into it....
your stack dump shows:
System.IO.StringReader..ctor(String s) +78
where s is (presumably) the parameter it is complaining about beging null.
A quick look in the docs shows the the consrtuctor (ctor) wants to have a
non-null string
since StringReader sits below things like TextReader. Are you passing a
null string when you should be providing a file name??????????

hope this helps.

dlr

"Chris Herring" <ch*********************@comcast.net> wrote in message
news:fd********************@comcast.com...
Hi there: Well, let me start off by saying that I am a Visual Studio drag
and drop weenie, not a real programmer. So I tend to get confused when
things do not look like the instructions said they were going to look :) .
Here is my current dilemma:

I am having a strange problem with my ASP.NET application. I am building the application using Visual Basic .Net in Visual Studio.NET 2003. Lately, I
have frequently been getting the following exception (see below) when I
debug the application. If I step through my code and determine what is
actually broken (the exception is not very informative), I find that the
error has nothing whatsoever to do with the exception that is thrown. The
really, really strange thing is this: When I get this error, the "real"
exception always seems to be thrown from my code contained in a .vb class
file. If I create a new .vb file, and cut-and-paste the code into the new
file, delete the old file, and then re-run the application (with no actual
changes to the code whatsoever), then I get the "real" exception instead of the "value cannot be null" exception. I have dozens and dozens of .vb class files.. so far have gone through this process on about 10 files. This is
getting annoying. Has anyone experienced anything like this? I searched
newsgroups and ms knowledgebase, but I did not find anything resembling my
problem.
-----------------------
The exception:

Value cannot be null. Parameter name: s
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: s

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: s]
System.IO.StringReader..ctor(String s) +78
System.Web.FormatterWithFileInfo.GetSourceFileLine s(String fileName,
Encoding encoding, String sourceCode, Int32 lineNumber)
System.Web.UnhandledErrorFormatter.get_ColoredSqua reContent()
System.Web.ErrorFormatter.GetHtmlErrorMessage(Bool ean
dontShowSensitiveInfo)
System.Web.HttpResponse.WriteErrorMessage(Exceptio n e, Boolean
dontShowSensitiveErrors)
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean canThrow) System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext
context, Exception e)

----------------------

Regards,

Chris Herring

Jul 21 '05 #2
Dennis:

Thanks for your reply.

I think I have figured out what was happening. The second line in the stack
trace:

System.Web.FormatterWithFileInfo.GetSourceFileLine s

made me wonder if perhaps the debugger could not access the source file to
display the stack trace for the "real" exception. Sure enough.. when I
checked the priveleges on the source files the ASP.NET process did not have
access to the files. I gave asp.net read access to the source files and the
problem went away.

Best regards,

Weenie

"Dennis Redfield" <de*************@acadia-ins.com> wrote in message
news:On**************@TK2MSFTNGP12.phx.gbl...
Dear Weenie,
without getting too deep into it....
your stack dump shows:
System.IO.StringReader..ctor(String s) +78
where s is (presumably) the parameter it is complaining about beging null.
A quick look in the docs shows the the consrtuctor (ctor) wants to have a
non-null string
since StringReader sits below things like TextReader. Are you passing a
null string when you should be providing a file name??????????

hope this helps.

dlr

"Chris Herring" <ch*********************@comcast.net> wrote in message
news:fd********************@comcast.com...
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when
things do not look like the instructions said they were going to look :) .. Here is my current dilemma:

I am having a strange problem with my ASP.NET application. I am building

the
application using Visual Basic .Net in Visual Studio.NET 2003. Lately, I
have frequently been getting the following exception (see below) when I
debug the application. If I step through my code and determine what is
actually broken (the exception is not very informative), I find that the
error has nothing whatsoever to do with the exception that is thrown. The really, really strange thing is this: When I get this error, the "real"
exception always seems to be thrown from my code contained in a .vb class file. If I create a new .vb file, and cut-and-paste the code into the new file, delete the old file, and then re-run the application (with no actual changes to the code whatsoever), then I get the "real" exception instead

of
the "value cannot be null" exception. I have dozens and dozens of .vb

class
files.. so far have gone through this process on about 10 files. This is
getting annoying. Has anyone experienced anything like this? I searched
newsgroups and ms knowledgebase, but I did not find anything resembling my problem.
-----------------------
The exception:

Value cannot be null. Parameter name: s
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: s

Source Error:

An unhandled exception was generated during the execution of the current

web
request. Information regarding the origin and location of the exception

can
be identified using the exception stack trace below.

Stack Trace:

[ArgumentNullException: Value cannot be null.
Parameter name: s]
System.IO.StringReader..ctor(String s) +78
System.Web.FormatterWithFileInfo.GetSourceFileLine s(String fileName,
Encoding encoding, String sourceCode, Int32 lineNumber)
System.Web.UnhandledErrorFormatter.get_ColoredSqua reContent()
System.Web.ErrorFormatter.GetHtmlErrorMessage(Bool ean
dontShowSensitiveInfo)
System.Web.HttpResponse.WriteErrorMessage(Exceptio n e, Boolean
dontShowSensitiveErrors)
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean

canThrow)
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext context, Exception e)

----------------------

Regards,

Chris Herring


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
2434
by: Florian Loitsch | last post by:
I'm currently writing a JS->Scheme compiler (which, using Bigloo, automatically yields a JS->C, JS->JVM, JS->.NET compiler), and have a question concerning the function-parameters: According to...
0
3723
by: Dino Hadzic | last post by:
Hallo csharp'ers I am trying to call a function on a COM (dll) object from managed c# code, which will send data to another node using an already existing bluetooth connection. However, I get a...
2
594
by: Chris Herring | last post by:
Hi there: Well, let me start off by saying that I am a Visual Studio drag and drop weenie, not a real programmer. So I tend to get confused when things do not look like the instructions said they...
9
3497
by: Igor Okulist | last post by:
int func(void**); { short* p = NULL; func(&p); //<<< here } Could somebody remind me why is this not allowed ? error message: "cannot convert parameter from 'short **' to 'void **'"
2
7884
by: Dabbler | last post by:
In my Registrant FormView I have a DropDownList which loads data from a secondary SqlDataSource "sdsOfficeParks". I need the user to select an office park but save the selected value in the...
0
1967
by: Reader | last post by:
On a windows form, there is TableLayoutPane. I 1) Increase size of form 2) Increse size of table 3) Add a row in the table 4) Save I receive exception "Value cannot be null. Parameter name:...
0
1271
by: fiona young | last post by:
what do i do when the computer tells me that "works cannot start the OLE server
2
6777
by: dowlingm815 | last post by:
I am attempting to create a table with an index. however, i am receiving an error code "3371: Cannot find table or constraint" as soon as it reads the "create index" statement. The code is as...
2
26493
by: lingjun | last post by:
Hi, I am having problems with this program. I keep on getting the following error messages: testing.c: In function `next_month': testing.c:25: error: parameter name omitted testing.c:27:...
0
7225
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7326
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3194
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3182
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1557
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.