9 Replies - 1534 Views - Last Post: 13 May 2013 - 12:53 PM Rate Topic: -----

#1 Tech4LLC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-May 13

Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 08 May 2013 - 06:48 PM

Hello Dream-in-Code Forum > This is my first time in the forum, although I've read useful information here many times. I'm working on an industrial application where I need to import data from a machine into a SQL database, and then extract information from the database for various Web Forms reports in an ASP.NET environment. I'm working in Visual Studio 2008 using C# 3.0 for the development. It's a large program that I inherited from a programmer who is no longer with the company, and now I need to make some changes to the reports and/or add a few new reports.

So here is the current situation:
- The original deployment of the program on the host machine works well.
- The original and modified versions of the program work well on my laptop computer (which is the computer being used to develop the code, apart from the host machine - the program will be deployed back to the host machine after my work is complete).
- The modified program works only within Visual Studio itself. If I run it in debugging mode (F5), run it without debugging (Ctrl+F5), or View -> View page in browser, it works fine.
- The original and modified verions of the code will *not* work outside of Visual Studio; this also applies on the host machine, if I try to redeploy either the old or modified versions (yes, it won't work even if I try redeploying with the exact same version as the original). After building the program, if I run the program via the URL http://localhost/Pro...nReporting.aspx, it errors out with the following details:


Server Error in '/ProductionReporting' Application.
Length cannot be less than zero.
Parameter name: length

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.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length

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: 

[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) +10084024
   _Login.Page_Init(Object sender, EventArgs e) +163
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42
   System.Web.UI.Control.OnInit(EventArgs e) +132
   System.Web.UI.Page.OnInit(EventArgs e) +16
   System.Web.UI.Control.InitRecursive(Control namingContainer) +143
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1477


I have verified IIS and .NET framework are successfully installed and running. If there are other specific parts of the code you need to see, let me know. I sincerely appreciate any help or guidance; I have been beating my head against this stone wall for one long weekend and several work days. THANK YOU! - - AJ

Is This A Good Question/Topic? 0
  • +

Replies To: Cannot display ASP.NET Web Forms outside of Visual Studio

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9059
  • View blog
  • Posts: 34,021
  • Joined: 12-June 08

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 08 May 2013 - 06:51 PM

You are publishing this somewhere, right? I mean when you say 'redeploy' you are just not copying your project's folder somewhere and expecting it to work right?
Was This Post Helpful? 0
  • +
  • -

#3 Tech4LLC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-May 13

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 08 May 2013 - 07:26 PM

View Postmodi123_1, on 08 May 2013 - 06:51 PM, said:

You are publishing this somewhere, right? I mean when you say 'redeploy' you are just not copying your project's folder somewhere and expecting it to work right?


Modi123, thanks for the quick reply. There is two separate computers here; the first is my laptop, which is the computer being used to develop the program modifications. The second is a client's desktop, which will be the computer that the end product will be deployed to and used on.

By 'redeploy', I mean I select Build -> Publish Site, and then I instruct it to publish via IIS. It will then generate all the files for deployment into C:\Inetpub\wwwroot\ProductionReporting. However, when I try to run the URL "http://localhost/ProductionReporting/ProductionReporting.aspx", it gives me the error noted in the OP. What I need help on is figuring out how to get the program running on the developing computer (aka my laptop)outside of Visual Studio.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9059
  • View blog
  • Posts: 34,021
  • Joined: 12-June 08

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 08 May 2013 - 08:17 PM

Try this - right click on the solution -> publish -> select file system -> select a folder on your machine.

Move that folder your to IIS location.. make sure there's a default.aspx or what ever your IIS is looking for.. it should, in theory, work.. assuming IIS is setup to to a normal website.. and you should be able to navigate to it by the localhost path.
Was This Post Helpful? 0
  • +
  • -

#5 Tech4LLC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-May 13

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 08 May 2013 - 08:41 PM

Great idea, but in this case been-there-done-that a couple of days ago. However, just to make sure, I did this again . . . publishing to another folder, and then manually moving the .aspx file to the IIS folder. [Sigh] As a baseball fan might say, "there's no joy in mudville tonight."

What perplexes me is that even the ORIGINAL [currently working] program will not run when I bring it into Visual Studio and redeploy it back to either the production PC or my laptop.

Any ideas/suggestions are much-appreciated!
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9059
  • View blog
  • Posts: 34,021
  • Joined: 12-June 08

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 08 May 2013 - 08:44 PM

To be clear - your published folder has all your aspx docs, at 1kb a piece, and a bin folder with various dlls in it?
Was This Post Helpful? 0
  • +
  • -

#7 Tech4LLC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-May 13

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 09 May 2013 - 04:46 AM

Affirmative. My published folder has all of my .aspx files @ 1kb/each, and a bin folder with the associated dll's in it. Would it be helpful to you to see a file list or a screen-capture?
Was This Post Helpful? 0
  • +
  • -

#8 Tech4LLC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-May 13

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 13 May 2013 - 09:52 AM

Worked most of the weekend trying to get the .aspx files to run, but the same error messages noted in the OP persist. Anyone have any ideas? I will try anything . . .

THANK YOU!
Was This Post Helpful? 0
  • +
  • -

#9 rgfirefly24  Icon User is offline

  • D.I.C Lover
  • member icon


Reputation: 262
  • View blog
  • Posts: 1,467
  • Joined: 07-April 08

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 13 May 2013 - 12:35 PM

Maybe the issue isn't a publish issue at all, but an issue with what is being passed around at runtime. Can you show me the Login page code? It appears that you are doing some kind of substring and one of the parameters you are passing is throwing the exception.
Was This Post Helpful? 0
  • +
  • -

#10 Tech4LLC  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 15
  • Joined: 08-May 13

Re: Cannot display ASP.NET Web Forms outside of Visual Studio

Posted 13 May 2013 - 12:53 PM

Interestingly, I solved the problem by instead running the program using http://127.0.0.1/Pro...Resporting.aspx instead of http://localhost/Pro...esporting.aspx. Using "127.0.0.1" in place of "localhost" allows me to view the newly modified page on the client machine, though interestingly enough, not on my laptop.

It's enough where I can proceed on my project, though debugging will just be more tedious since I'll have to publish it and transfer it over to view the page outside of Visual Studio.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1