-
Jun 15th, 2017, 09:37 PM
#1
Thread Starter
Frenzied Member
[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.
-
Jun 16th, 2017, 03:36 AM
#2
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
-
Jun 16th, 2017, 04:28 AM
#3
Thread Starter
Frenzied Member
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.
-
Jun 16th, 2017, 07:49 AM
#4
Re: Can't restore web application
Did you setup the web app in IIS manager?
-tg
-
Jun 16th, 2017, 07:55 AM
#5
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by techgnome
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.
-
Jun 16th, 2017, 08:28 AM
#6
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
-
Jun 16th, 2017, 09:07 AM
#7
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by NeedSomeAnswers
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
-
Jun 16th, 2017, 09:13 AM
#8
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?
-
Jun 16th, 2017, 09:18 AM
#9
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by PlausiblyDamp
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.
-
Jun 16th, 2017, 11:02 AM
#10
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.
-
Jun 16th, 2017, 11:28 AM
#11
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
-
Jun 16th, 2017, 09:23 PM
#12
Thread Starter
Frenzied Member
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.
-
Jun 16th, 2017, 09:40 PM
#13
Thread Starter
Frenzied Member
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"%>
-^
-
Jun 16th, 2017, 09:41 PM
#14
Thread Starter
Frenzied Member
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.
-
Jun 17th, 2017, 11:02 AM
#15
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.
-
Jun 17th, 2017, 06:30 PM
#16
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
-
Jun 17th, 2017, 08:01 PM
#17
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by techgnome
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.
-
Jun 17th, 2017, 08:15 PM
#18
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...
-
Jun 18th, 2017, 07:38 AM
#19
Re: Can't restore web application
Originally Posted by robertx
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?
-
Jun 18th, 2017, 07:44 AM
#20
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by PlausiblyDamp
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?
-
Jun 18th, 2017, 05:20 PM
#21
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.
-
Jun 18th, 2017, 09:47 PM
#22
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by PlausiblyDamp
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.
-
Jun 19th, 2017, 02:35 AM
#23
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
-
Jun 19th, 2017, 08:21 AM
#24
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by NeedSomeAnswers
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
-
Jun 19th, 2017, 08:25 AM
#25
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?
-
Jun 20th, 2017, 03:07 AM
#26
Thread Starter
Frenzied Member
Re: Can't restore web application
Originally Posted by PlausiblyDamp
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!
-
Jun 20th, 2017, 03:17 AM
#27
Thread Starter
Frenzied Member
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.
-
Jun 20th, 2017, 05:39 AM
#28
Re: [RESOLVED] Can't restore web application
They must not be path'd correctly.
Show some code...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|