xml error in webaplication publishing and running - asp.net

i have developed a asp.net web application in visual studio 2008.
its running perfectly when i build it in visual studio.
but when i published it and configured in iis and try to browse that its geeting an xml error
i tried to browse this
http://localhost/myproject/Pop3Client.aspx
eror is like this
XML Parsing Error: not well-formed
Location: http://localhost/myproject/Pop3Client.aspx
Line Number 1, Column 2:<%# Page Language="C#" %>
-^
i dont what is the problem.
its working right when i build in visual studio...
but when i do this through iis its not..
can anyone help me...
Thanks

Delete the FrontPage-related (VTI) folder on the server and see if that fixes it? The VS publish operation uses this folder but you can still deploy without it by copying. Are you using CSS Adapters? If so, then they do not play nice with the VTI stuff.

Related

IIS Express giving a compilation error, denies access to files

I am running Visual Studio 2015 on Windows 7. I have a solution with 2 startup projects, both running on IIS Express, and the .NET version is 4.5.2.
Whenever I start the solution for the first time, everything works as expected. However, when I stop the application, make some changes to the source code, and restart, I get this Compilation Error -532462766 screen on startup :
The detailed compiler output is filled with lines like this:
/R:"C:\windows\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll" /R:"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\vs\268da2e1\665f7c6d\assembly\dl3\a9f1f009\c9360fff_0864d101\ServiceStack.Common.dll"
Going back to Visual Studio, and selecting "Clean Solution" gives me these unable to delete file messages (username and projectname removed).
The only way to get things working again, is to right-click IIS Express in the notification area, exit the process, then clean the solution in VS2015, and rebuild. Everything works again then, until the next time I need to change something in the source code (which happens quite a lot, being a software developer and all).
It seems IIS Express or Visual Studio, or my Windows user account is not allowed to delete files in IIS Express. I have tried running VS2015 and IIS Express in administrator mode, but no luck. What else can I try?

How do you allow parent paths in Visual Studio 2013?

I am converting a classic ASP site to a Visual Studio 2013 MVC project. When I run the classic ASP code inside of the Visual Studio 2013 debugger I get an error message:
Active Server Pages error 'ASP 0131'
Disallowed Parent Path
The question is: how can I enable parent paths in the VS2013 debugger?
FYI - This is not IISExpress and enabling parent paths is different.
I discovered the answer myself. Here is how I did it.
I opened Task Manager and saw that Visual Studio was running
processes of IISExpress for the web server functionality.
I clicked on Start and entered IISExpress to find out where it was installed. To my surprise, but an obvious choice, it was located in documents.
I opened the C:\Users\Mike\Documents\IISExpress\config folder then
opened Notepad as an administrator.
I then opened the applicationhost.config file and under the <system.webServer> element there is an <asp> element. I modified it to read. <asp scriptErrorSentToBrowser="true" enableParentPaths="true">
I then opened by MVC solution and ran the Classic ASP program without any
problems. Everything works!
I have Visual Studio 2015 and I had to do something else.
Right-click on the IIS Express icon in your tray while the application is running, and select Show All Applications.
Click on the application you want to manage. You'll see the location of the IIS Express server config file in the details section below.
Edit it as administrator and add enableParentPaths="true" to the asp XML element (under system.webServer), as in the Mike G's answer.
For me, the config file was located in SolutionDir\.vs\config\applicationhost.config.

Opening web.config file causes Visual Studio 2010 Ultimate to hang and crash

Situation:
I installed Visual Studio 2012 on top of my previous Visual Studio 2010 Ultimate. I uninstalled VS2012 shortly thereafter along with all SQL 2012 database junk and yadda yadda. Everything in VS 2010 seems to be good, but when I try to open my web.config file VS hangs indefinitely.
Tried:
(1) Downloading and replacing the dsref80.dll that gets overridden by VS2012
(2) Uninstalled all VS extensions, including NuGet
(3) Created new website and web.config file. Problem persists
Question: Does anyone have any other ideas about what could cause the web.config file to cause VS2010 to hang and crash after clicking on it?
I figured it out. For some reason the web.config file was set to open with source code editor by default and not the HTML editor.
For anyone else who runs into this issue, the answer is simple.
Right-click the web.config file ---> Open with ----> Highlight HTML Editor ---> Set as Default.
Update (Dec, 2013): Although I was able to access the web.config file using the method mentioned above, I later realized that it was more of a Band-Aid than a solution. Using the html editor causes a lot of validation warnings and renders intelliSense useless. The correct solution is to run the repair option from the Visual Studio 2010 install DVD, that fixes everything.

asp.net Attempting to create publish settings in vs 2012 gives strange error

I recently updated my asp.net 3.5 web project from Visual Studio 2010 to Visual Studio 2012. Every time I try to create publish settings it says the following:
{There are errors in web.config. Please correct these errors and try again.
The first error is: "Web.config appears to be in invalid state. Please correct it and try again."}
I have been unable to determine what this means. I have no errors in my web.config that it is telling me about. I have search for this error and have come up with nothing.
Can someone please help me out?
I should also mention this entire project resides on a mapped drive. I am still able to open the project and publish it in Visual Studio 2010 but can't even create the publish settings in Visual Studio 2012.
I think the below steps would help you out.
Before performing publish make sure the project is changed to Release mode.
Do not perform publish as a website. Try and publish your website to a file system.
create a virtual directory and point that virtual directory to the published folder.
The above mentioned steps worked for me.

Visual Studio "Convert to Web Application" and "Could not load type" errors

I'm currently getting a "Could not load type UI.Administration.Site.master" error message and I'm not really sure as to why.
I have an ASP.NET MVC Project with the UI namespace. Within the project's structure, I have an Admin folder. I right clicked on the Admin folder and chose "Convert to Web Application", but am getting a Could Not Load Type error for my master page.
Are there any special things that must occur in these situations for this to work?
ERROR INFO BELOW
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'UI.Administration.Site'.
Source Error:
Line 1: <%# Master Language="C#" CodeBehind="Site.master.cs" Inherits="UI.Administration.Site" %>
I had always wondered what this command did. I'm sure I've tried it and seen no result. I finally just looked it up:
"Convert to Web Application" has nothing to do with your scenario. It's for converting Visual Studio .NET and Visual Studio .NET 2003 to Visual Studio .NET 2008.
See "Walkthrough: Converting a Visual Studio 2002 or 2003 Web Project to a Visual Studio 2008 Web Application Project".
Make sure your namespaces match up with your folder structure as well as in your Inherits clause and your CodeBehind attributes. I had the same problem and it was because the namespace in the Inherits attribute didn't match up when I converted.

Resources