Results 1 to 28 of 28

Thread: [RESOLVED] Can't restore web application

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Resolved [RESOLVED] Can't restore web application

    I have restored an ASP.NET application from a Windows 7 machine to a Windows 10 machine. I have enabled IIS. When I launch the application in Firefox, I am getting this error:

    XML Parsing Error: no root element found

    I am not sure whether this has got something to do with IIS configuration and permissions. Any help would be appreciated.

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Can't restore web application

    XML Parsing Error: no root element found
    You normally get that error when your XML is not in the correct format.

    Does your site rely on reading in an XML file? is that XML file in place and correct?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    I don't believe it relies on reading any kind of XML file other that the web.config file. Nothing has changed since it was working on a Windows 7 machine. It has simply been copied across. I am wondering whether there are some configuration changes required. ASP.NET is not my forte.
    Last edited by robertx; Jun 16th, 2017 at 04:49 AM.

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Can't restore web application

    Did you setup the web app in IIS manager?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by techgnome View Post
    Did you setup the web app in IIS manager?

    -tg
    I have added it as an application in IIS but I'm not sure what else needs to be configured there.

  6. #6
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Can't restore web application

    I don't believe it relies on reading any kind of XML file other that the web.config file.
    Ok

    So just to be clear here your hosting a website with Windows 10 as your server? and you have put your site under wwwroot inside its own folder, and then you converted it to an application inside IIS, and then hit browse in IIS, which launch's your site in Firefox?

    And the only error information you get on the page is - XML Parsing Error: no root element found ?

    could you post an Image of that error? please crop it rather than post something full page size so we can read it !

    If you had a permission error for instance i would expect you to be getting a very different error message.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by NeedSomeAnswers View Post
    Ok

    So just to be clear here your hosting a website with Windows 10 as your server? and you have put your site under wwwroot inside its own folder, and then you converted it to an application inside IIS, and then hit browse in IIS, which launch's your site in Firefox?

    And the only error information you get on the page is - XML Parsing Error: no root element found ?

    could you post an Image of that error? please crop it rather than post something full page size so we can read it !

    If you had a permission error for instance i would expect you to be getting a very different error message.
    The application is not in the wwwroot folder but I have setup a virtual path and converted to application and launched it from IIS. Here is a screenshot of the error message:

    https://snag.gy/g8bdrc.jpg

  8. #8
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Can't restore web application

    That looks like it might be a problem with the login.aspx or it's code behind. Is there any code in the Page_Load of the login.aspx?

  9. #9

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by PlausiblyDamp View Post
    That looks like it might be a problem with the login.aspx or it's code behind. Is there any code in the Page_Load of the login.aspx?

    There is no code in the page load event handler. Every page is throwing the same exception. The application was working fine on the old machine.

  10. #10
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Can't restore web application

    Is the WEB.CONFIG correct? IIS makes changes to things up stream like MACHINE.CONFIG and APPLICATION.CONFIG that can make your "manual edits" to WEB.CONFIG no longer valid.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  11. #11
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Can't restore web application

    Did you copy the web.config file? If you did, look to see if it is still intact, and that it doesn't reference the old machine by name or anything.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  12. #12

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    I can't see anything obvious that's wrong. The site is running remotely with no problems. I have even downloaded the web.config from the remote site and used that and it's still throwing this error on my local machine.

  13. #13

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    When I open up the login.aspx page via its file path in Firefox, I get this error:

    XML Parsing Error: not well-formed
    Location: "file:///D:/Test/login.aspx"

    Line Number 1, Column 2:<%@ Page Language="vb" AutoEventWireup="false" Codebehind="login.aspx.vb" Inherits="Test.login"%>
    -^

  14. #14

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Chrome throws this:

    This page contains the following errors:

    error on line 1 at column 2: StartTag: invalid element name

    Below is a rendering of the page up to the first error.

  15. #15
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Can't restore web application

    It sounds like you don't have the dot net framework installed on the windows 10 box. If it is installed it isn't properly integrated with IIS.

    It might be work going into control panel, programs and features and then checking if iis and dotnet are both installed.

  16. #16
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: Can't restore web application

    Wait...
    "Location: "file:///D:/Test/login.aspx""
    ...When you "run" this web app... how are you doing that? are you opening tyhe web browser and entering http://localhost/yourwebapp/index.aspx? Or are you opening in some other way?

    The reason I ask is because of the "file://" reference... that tells me it is NOT runing under http protocol but rather through file protocol which usually happens when someone double clicks on the aspx file directly and opens it in the web browser. That causes it to bypass the server invocation and the browser will attempt to render it directly itself, which it cannot do properly.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  17. #17

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by techgnome View Post
    Wait...
    "Location: "file:///D:/Test/login.aspx""
    ...When you "run" this web app... how are you doing that? are you opening tyhe web browser and entering http://localhost/yourwebapp/index.aspx? Or are you opening in some other way?

    The reason I ask is because of the "file://" reference... that tells me it is NOT runing under http protocol but rather through file protocol which usually happens when someone double clicks on the aspx file directly and opens it in the web browser. That causes it to bypass the server invocation and the browser will attempt to render it directly itself, which it cannot do properly.

    -tg
    That's correct in that instance I invoked the file directly but that was just as an alternative to see what happened. I saw the same error as when I launched it from IIS or from Visual Studio.

  18. #18
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Can't restore web application

    You should eliminate all these unknowns and simply create a new project and see that in fact it will launch and run in the browser.

    Once you know you have something that works it will be much easier to see why you restore attempt does not work...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  19. #19
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Can't restore web application

    Quote Originally Posted by robertx View Post
    That's correct in that instance I invoked the file directly but that was just as an alternative to see what happened. I saw the same error as when I launched it from IIS or from Visual Studio.
    Did you check if IIS and dot net are correctly installed?

  20. #20

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by PlausiblyDamp View Post
    Did you check if IIS and dot net are correctly installed?
    I haven't yet. I'm pretty sure the targeted .NET framework is installed but are you saying there is another step involved to integrate it with IIS?

  21. #21
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Can't restore web application

    If both are installed as part of windows then they should be integrated, if you installed a newer version of .Net before installing IIS then the framework might not be correctly registered with IIS.

    There is a command line tool, aspnet_regiis tht can register the framework correctly (easiest way is from a developer command prompt type aspnet_regiis /i and let it do it's thing) https://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx gives more of what the tool can do.

  22. #22

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by PlausiblyDamp View Post
    If both are installed as part of windows then they should be integrated, if you installed a newer version of .Net before installing IIS then the framework might not be correctly registered with IIS.

    There is a command line tool, aspnet_regiis tht can register the framework correctly (easiest way is from a developer command prompt type aspnet_regiis /i and let it do it's thing) https://msdn.microsoft.com/en-us/library/k6h9cz8h.aspx gives more of what the tool can do.
    When I run that command from the developer command prompt, I get the following message:

    This option is not supported on this version of the operating system. Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool.

    Exactly which node(s) do I need to activate in the "Turn Windows Features On/Off" dialogue?

    The application is targeting .NET Framework 4.0.

  23. #23
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Can't restore web application

    so if you go to add/remove windows features is ASP.Net 4.5 installed ?
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



  24. #24

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by NeedSomeAnswers View Post
    so if you go to add/remove windows features is ASP.Net 4.5 installed ?
    ASP.NET 4.6 appears to be installed...

    https://snag.gy/NtbCJT.jpg

  25. #25
    PowerPoster PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Pontypool, Wales
    Posts
    2,458

    Re: Can't restore web application

    If you look further down the list there is the section for Internet Information Services, look under there there should be World Wide Web Services and under there Application Development Features.

    Is ASP.NET 4.X selected there as well?

  26. #26

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: Can't restore web application

    Quote Originally Posted by PlausiblyDamp View Post
    If you look further down the list there is the section for Internet Information Services, look under there there should be World Wide Web Services and under there Application Development Features.

    Is ASP.NET 4.X selected there as well?
    No it wasn't checked and after checking ASP.NET 4.6, the issue is resolved!

  27. #27

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    Re: [RESOLVED] Can't restore web application

    The only issue now is that images aren't rendering in the browser. They are pathed correctly and are visible in the VS IDE but not when the application is launched.

  28. #28
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: [RESOLVED] Can't restore web application

    They must not be path'd correctly.

    Show some code...

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width