Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
HTML
Server Error in '/realestate' Application.
Value cannot be null.
Parameter name: path
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: path

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: path]
   System.IO.Directory.CreateDirectory(String path) +10588921
   LogError.AddLog(Exception ex) +308
   DreamLogin.AssionSession() +1771
   DreamLogin.btnlogin_Click(Object sender, EventArgs e) +464
   System.Web.UI.ImageClickEventHandler.Invoke(Object sender, ImageClickEventArgs e) +0
   System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +115
   System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +124
   System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1724


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18034
Posted
Updated 20-Sep-13 0:33am
v3
Comments
♥…ЯҠ…♥ 19-Sep-13 9:24am    
Hi Kumar,
As seeing stack trace, i believe the error is because the parameter is missing its value which is required while running, is it working in your local machine?
Parmendra choudhary 21-Sep-13 4:50am    
yes its working all server as well as local, But the GoDaddy Create a Problem

1 solution

Problem

You have called the CreateDirectory function, which always expects parameter path.
C#
System.IO.Directory.CreateDirectory(String path)

But the value of path you have passed is null.
C#
[ArgumentNullException: Value cannot be null.



Solution

So, check if it null or not before you call that method.
C#
if(!string.IsNullOrEmpty(path))
{
    System.IO.Directory.CreateDirectory(String path);
}
 
Share this answer
 
v2
Comments
Parmendra choudhary 19-Sep-13 10:47am    
same error please help me
Debug and see why the value of path is always null?
If you have written as I suggested, then it won't go inside the "if" block when value of path is null. So, debug and see what is the issue.
Did you find anything? Else post the codes here. I will also take a look at it.
Parmendra choudhary 20-Sep-13 1:12am    
this problem is only for GoDaddy Server.....Other server worked fine

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900