what is http://localhost:60496 ?
when we run on IIS why it comes http://localhost why not http://localhost:60496?
what is that number?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Manj NPosted Aug 16, 2013, 2:03 AM
when i run program locally it gives correct answer.. when i run on IIS it gives error...
error when download the excel page.... the error is
The remote procedure call failed. (Exception from HRESULT: 0x800706BE)
the code is
protected void Expgo_Click(object sender, EventArgs e)
{
/*************************************
* On export click, select date range
* Generate weekley TimeSheet Report
************************************/
QueryRet Value = new QueryRet();
String StartCalDate;
String EndCalDate;
StartCalDate = ExpCalStart.SelectedDate.ToString();
EndCalDate = ExpCalEnd.SelectedDate.ToString();
if (StartCalDate == EndCalDate)
{
Weekview.SetActiveView(Blank);
lblerr.Text = "Please Select Range of Dates.";
lblerr.Visible = true;
}
else
{
ExcelApp = new Excel.Application();
ExcelApp.Visible = false;
ExcelWork = (Excel._Workbook)(ExcelApp.Workbooks.Add(Missing.Value));
string strCurrentDir = Server.MapPath("~/TimeSheets/");
RemoveFiles(strCurrentDir);//removes all .xls files in directory
DateTime Daylist;
String Query;
/********************************************************
* Select all WeekStartDates in the given range of dates
********************************************************/
Query = "SELECT DISTINCT WeekStartDate FROM TimeSheetBreakDown";
Query += " Where Date >= '" + Convert.ToDateTime(StartCalDate).ToString("yyyy/MM/dd") + "' AND Date<='" + Convert.ToDateTime(EndCalDate).ToString("yyyy/MM/dd") + "'";
ArrayList DistinctStart = Value.ExecuteQry(Query);
if (ExcelWork.Worksheets.Count <= DistinctStart.Count)
{
ExcelWork.Worksheets.Add(Missing.Value, Missing.Value, DistinctStart.Count - ExcelWork.Worksheets.Count + 1, Missing.Value);
}
for (int s = 0; s < DistinctStart.Count; s++)
{
/******************************************************
* For each of the week which come under date selected
* Generate One Excel Work Sheet
******************************************************/
try
{
Query = "SELECT distinct Date FROM TimeSheetBreakDown WHERE (WeekStartDate = '" + DistinctStart[s] + "' AND Day='1') order by date";
Daylist = DateTime.Parse(Value.SelectQry(Query));
/******************************************************************
* From the Distinct StartDate Get (Date of) Monday of that week
* From Monday Calculate other Days From TimeSpan
* ****************************************************************/
mon = Daylist;
tue = Daylist + new TimeSpan(1, 0, 0, 0);
wed = Daylist + new TimeSpan(2, 0, 0, 0);
thu = Daylist + new TimeSpan(3, 0, 0, 0);
fri = Daylist + new TimeSpan(4, 0, 0, 0);
sat = Daylist + new TimeSpan(5, 0, 0, 0);
sun = Daylist + new TimeSpan(6, 0, 0, 0);
}
catch (Exception X)
{
lblerr.Text = X.Message + " Looks like you are Exporting Blank TimeSheet";
lblerr.Visible = true;
}
finally
{
GC.Collect();
/**************************************************************
* Generates one Excel WorkSheet (Gives TimeSheet of that Week)
**************************************************************/
GenerateExcel(s + 1);
}
}
DistinctStartCount = DistinctStart.Count + 1;
SummarySheet();
ExcelApp.Visible = false;
ExcelApp.UserControl = false;
String FileName = "" + User.Identity.Name + ".xlsx";
ExcelWork.SaveCopyAs(strCurrentDir + FileName);
String TimeSheetPath = (String)System.Configuration.ConfigurationManager.AppSettings["TimeSheetPath"].ToString();
string strMachineName = Request.ServerVariables["SERVER_NAME"];
Expgo.Text = "Download TimeSheet";
//TODO: CLean Up...
ExcelApp.Quit();
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelRange);
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelApp);
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelSheet);
System.Runtime.InteropServices.Marshal.ReleaseComObject(ExcelWork);
ExcelSheet = null;
ExcelWork = null;
ExcelApp = null;
GC.Collect();
}
}
Iftikar HussainPosted Aug 16, 2013, 12:43 AM
Regards,
Iftikar
Manj NPosted Aug 16, 2013, 12:36 AM
Iftikar HussainPosted Aug 16, 2013, 12:18 AM
Regards,
Iftikar
Manj NPosted Aug 16, 2013, 12:17 AM
my program in f:/abc/ab/programname
when i run the program, localhost/programname comes?
why it not takes localhost/f/abc/ab/programename ?
Manj NPosted Aug 16, 2013, 12:11 AM
i want to know why that port number assign automatically when i run locally?
y it is not in IIS?
Deependra KhangarotPosted Aug 16, 2013, 12:05 AM
The number in url is port number.
You can change this number following below steps:
You can configure IIS too to use port number.
Iftikar HussainPosted Aug 16, 2013, 12:03 AM
When you run your application locally (i.e. by press F5 or view in browser) that time it will assign portnumber automatically. since it uses Visual Studio Development server instead of your local IIS. This port number you can set for each application by setting the value assign port under Web->Servers.
Regards,
Iftikar