I\'ve finished simple asp.net web application project, compiled it, and try to test on local IIS. I\'ve create virtual directory, map it with physical directory, then put al
Faced the same error when I had a programming error in one of the ASHX files: it was created by copying another file, and inherited its class name in the code behind statement. There was no error when all ASPX and ASHX files ran in IIS Express locally, but once deployed to the server they stopped working (all of them).
Once I found that one ASHX page and fixed the class name to reflect its own class name, all ASPX and ASHX files started working fine in IIS.
After a lot of searching ,i found the problem was in my project dll file .i cleaned and rebuild my project when there were compilation errors ... simple solution is to remove all compilation errors in all pages either by removing contents or commenting lines ,then clean and rebuild your project ... this will sort out your problem ..
This happens when the files inside the Debug and Release folder are not created properly(Either they are having wrong reference or having overwritten many times). I have faced the same problem in which, i everything works fine when we build the solution, but when i publish the website it gives me same error. I have solved this in following manner:
I have solved it this way.
Go to your project file let's say project/name/bin and delete everything within the bin folder. (this will then give you another error which you can solve this way)
then in your visual studio right click project's References folder, to open NuGet Package Manager.
Go to browse and install "DotNetCompilerPlatform".
In my case I missed the compile tag in the .csproj file
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Compile>
I know i am too late to answer but it could help others and save time.
Following might be other solutions.
Solution 1:
See Creating a Virtual Directory for Your Application for detailed instructions on creating a virtual directory for your application.
Solution 2:
Your application’s Bin folder is missing or the application’s DLL file is missing. See Copying Your Application Files to a Production Server for detailed instructions.
Solution 3:
You may have deployed to the web root folder, but have not changed some of the settings in the Web.config file. See Deploying to web root for detailed instructions.
In my case Solution 2
works, while deploying to server some DLL's
from bin
directory has not been uploaded to server successfully. I have re-upload all DLL's again and it works!!
Here is the reference link to solve asp.net parser error.