IIS: Parser Error Message: Could not create type - asp.net

I am trying to build a simple web service in C# using VS2015 to be hosted on Windows Server 2012R2.
I have the code written and it works properly when hosted in the Visual Studio debugger. The debugger will launch IE and give me the UI to test the simple methods in my code. I can enter a temperature in Celsius and get back the temperature in Farentheit. So my understanding is that my code itself is working.
However, when I publish my project and attempt to load it in IE, I get:
Server Error in '/' Application.
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 create type 'TestAutomation.AutomationInterface'.
Source Error:
Line 1: <%# WebService Language="C#" CodeBehind="~/App_Code/WebService.cs" Class="TestAutomation.AutomationInterface" %>
Source File: /TestToolsAutomation/AutomationInterface.asmx Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.81.0
I am publishing my project by going to Build -> Publish Web App. I am selecting "File System" as my publish method and am publishing to "C:\inetpub\wwwroot\MyAppName" in the Debug configuration with no check boxes in the File Publish Options. When I publish, I have the following files in the MyAppName folder:
-AutomationInterface.asmx
-Web.config
\App_Code
WebService.cs
The obvious issue I see here is that there is no .dll file created with my compiled code. I'm far from an IIS expert, but isn't this supposed to be created the first time a user requests the page?
I then re-published and checked "Precompile during publishing" in the file options. When I do this, a \bin folder is created with files "App_Code.compiled" and "App_Code.dll" files. However, I get the same error in the browser.
Because my code works in the VS debugger but not when hosted in IIS, I suspect the problem is on the IIS side of things, but I'm not 100% certain of that.
When I request the IIS page in IE, I get an event 1310 with source "ASP.NET 4.0.3.30319.0" in the application event log that says "Event code: 3006
Event message: A parser error has occurred" along with a stack trace that shows a bunch of System.Web.Compilation functions.
I have searched for this error on Stack Overflow and other sites, but none of the suggested solutions appear to solve my particular problem.
I would appreciate any help the community could offer.
UPDATE: I enabled failed request tracing on the server. It appears that the error happens here:
154. view trace
Warning
-MODULE_SET_RESPONSE_ERROR_STATUS
ModuleName
ManagedPipelineHandler
Notification
MAP_REQUEST_HANDLER
HttpStatus
500
HttpReason
Internal Server Error
HttpSubStatus
0
ErrorCode
The operation completed successfully.
(0x0)
ConfigExceptionInfo
ManagedPipelineHandler
I lack the background to fully understand what IIS is trying to tell me. Any tips would be appreciated.

After struggling with this for hours and making all kinds of settings changes, and uninstalling and reinstalling IIS several times, I finally solved this.
I had to right-click on the folder in which I published my files in IIS Manager and select "Convert to Application." It's now working!

Here are a few possible ideas to explore:
Have you looked at the permissions for the account that the Application Pool in IIS is using to run this? There can be ASP.Net Temporary files that aren't being generated that could be an issue here.
Is ASP.Net registered with IIS? I've remembered more than a few times to have to run "aspnet_regiis -i" on servers to install the ASP.Net part so that it'll be present within IIS.
Is IIS configured to allow ASP.Net requests? In the IIS Manager on the machine level there is an "ISAPI and CGI Restrictions" to note.
Update: Perhaps you could look at the configuration for the Application Pool and see which .Net version it is using and whether it is integrated or classic mode. Those would be the next level of things to examine.

Related

How do I get a traceback of a HTTP500 from IIS running on Azure's "App Service" PaaS?

I've inherited an ASP.NET project with instructions to run it on Azure's App Service. I set up a pipeline to compile it (with debug in the Configuration param & system.debug=true of the compilation step), created a release to deploy it, but it doesn't run (returns a HTTP500.0 with error code 0x00000000). But try as I might, I can't get a proper traceback out of IIS.
I have tried:
Turning off CustomErrorMessages in Web.config; this just shows IIS's "an error occurred and for security we're hiding the details" HTTP500 page.
Viewing the live log feed in the "App Service Editor", then copy-pasting the html to view it (just gives generic error messages).
Downloading the Application logs as per Microsoft's guide; they're just generic HTTP500 pages with no trace.
Enabling "Application Insights" APM and viewing failures, but 0 failures are reported.
I'm stumped. How do I get the App Service variant of IIS to show me a simple traceback?
The application stack trace is available in the logs, which can be viewed in "Advanced tools" menu of the App Service, or alternatively can be downloaded as a zip file as described in MSFT's instruction|. The relevant file that shows the stack trace inside this zipfile is eventlog.xml.

Execute IIS .NET webforms website without precompiling the source code

I want to publish to IIS the source code of my website (visual studio 2017 web forms website in vb.net or c#) without pre-compiling the project, so I can modify the source code directly on the server with IIS.
I know this is possible, I have done it in the past, and I have seen it done even now, but I cannot figure out what I need to do for this.
When I copy all the website source code to the server with the IIS, the website does not run... any ideas? or where to look for an answer? Is it a matter of setup? of the type of project?
When I call the website I get the following error:
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The CodeDom provider type
"Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider,
Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be
located.
Source Error:
An application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.
Thanks!
#Gabe Thanks for the directions:
File - New Project, I see it under Visual Basic/Visual C# - Web - Previous Versions (ASP.NET Web Forms Site)
I tried it, and it works just fine! Basically if you create a project like you describe, you can just copy the source code in a server, without even installing visual studio there, and you can develop the site directly there.
This is ideal when you want to test things directly with external users, test things directly on the live or test servers, and of course you can make sure you have the source code of the project running, without having to keep both the source code and the compiled version.
There are a few drawbacks though:
1) you disrupt the website when you change things, and the application pool is restarted whenever there are changes, users in sessions are kicked out, etc...
2) there is a small delay while the site gets recompiled
3) there are cases where if while the code gets recompiled there are users online, there is asp.net corruption
Thanks for the replies!!
Regards
Manos

Microsoft Release Management Server for TFS 2013 - install issue

I've been trying to install the new Microsoft Release Management app that has just been released to MSDN and am having issues
It consists of a server side component for TFS 2013, and a client side component for VS2013
The server side component runs through and says that it is installed fine, but then i can't seem to connect the client side part up to it
After a bit of investigation it seems that the web services site that is installed on the server side is not working properly
It is installed on a Windows 2012 box that is also running TFS 2013, SQL 2012, and SharePoint 2013
If i browse to the newly created ReleaseManagement website I get a 503 (Service Unavailable) message.
I checked out IIS and the app pool had stopped
in the application event log I could see a load of messages saying "current configuration only supports loading images for x86 processor architectures"
I thought this was possibly to do with the "Enable 32-bit Applications" option in the IIS app pool (was set to FALSE)
I changed that to true and tried the site again. This time the app pool doesn't crash, but I get ASP.NET errors stating "Could not load file or assembly 'Interop.ActiveDs' or one of its dependencies. An attempt was made to load a program with an incorrect format."
Has anyone managed to install this yet? Any ideas on what's going wrong here?
I know it's very new, but I'm struggling to find much information about the product at all
Thanks a lot
Here is a link towards some documentation regarding this problem. As pointed out in the comments, it is related to a bug caused by SharePoint: http://support.inreleasesoftware.com/entries/24794668
Interesting section:
The request failed with HTTP status 503: Service Unavailable.
This error message usually means that the InReleaseAppPool application
pool is stopped. Please ensure that it is started. If the application
pool stops after some time by itself, it might be due to a bug caused
by SharePoint 2013. Validate your problem by looking at the Event
Viewer. Confirm that your error is similar to the following:
Event Log Error Event ID 2282
The Module DLL 'C:\Program Files\Common Files\Microsoft Shared\Web
Server Extensions\15\isapi\spnativerequestmodule.dll' could not be
loaded due to a configuration problem. The current configuration only
supports loading images built for a x86 processor architecture. The
data field contains the error number. To learn more about this issue,
including how to troubleshooting this kind of processor architecture
mismatch error, see http://go.microsoft.com/fwlink/?LinkId=29349.
We can apply a quick fix using this command
appcmd.exe set config -section:system.webServer/globalModules
/[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64
Or you can manually enter the preCondition entry in the
ApplicationHost.config file
More information can be found here:
http://blogs.flexnetconsult.co.uk/colinbyrne/2012/11/11/RunningA32bitApplicationAlongsideSharePoint2013Problems.aspx
FIX:
the user which you specified to run the TFS service needs "log on as a service" and "Log on as batch job" permissions. I've set that up via GPO.
This solution worked for me. I execute this command
appcmd.exe set config -section:system.webServer/globalModule/[name='SPNativeRequestModule'].preCondition:integratedMode,bitness64
in C:\Windows\System32\inetsrv and C:\Windows\System64\inetsrv.

Upgrading to 2K8 Server, An error occurred loading a configuration file: Failed to start monitoring changes to '\\networkshare'

I moved my site off of a 2k3 server over to a 2k8 server. The site has a virtual directory pointed to a network share which has different credentials than the one used by the site. I set the virtual directory to use the correct credentials and it can browse the share fine through explorer, but when I try to load files (images, etc) through a browser I get the following asp.net error:
Server Error in '/' Application.
Configuration Error Description: An error occurred during the
processing of a configuration file required to service this request.
Please review the specific error details below and modify your
configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file:
Failed to start monitoring changes to '\\networkshare'.
Source Error:
[No relevant source lines]
Source File: \\networkshare\web.config Line: 0
Version Information: Microsoft .NET Framework Version:2.0.50727.5456;
ASP.NET Version:2.0.50727.5456
The network share does not have a web.config.
I tried the solution provided here, but that did not solve the issue and this site isn't using impersonation. Do I need to enable impersonation? This was working correctly on win2k3.
OK, so based on our comments it sounds like this is either a share permissions problem or an NTFS permissions problem (same resolution, different dialog).
In IIS6 you typically had the worker process running as NETWORK SERVICE and that's what you would give permissions to to access shares and files on the network.
In IIS7.5 the application pools now run under an AppPool identity, one specific to the application pool that the website is running under. This link should be helpful: http://learn.iis.net/page.aspx/624/application-pool-identities/
As a quick fix (although I recommend reading up on it) though, you can go into the application pool, go to advanced properties, and set the identity back to NETWORK SERVICE.

Visual Studio 2003 - opening ASP.NET project - getting “The operation timed out” error message

On a Windows 2003 server I installed several versions of Visual Studio, also Visual Studio 2003. On the server I want to develop two different webapplications. One web application is working, but I go problems on the other one.
When I try to open the application (after a rebuild), I get the error: "The Web server reported the following error when attempting to create or open the Web project located at the following URL: 'http://localhost/MyApp'. 'The operation timed out'." I have already seen that the problem disappears when I delete the dll file generated by building. Because the environment will be distributed to multple users, it is not an option to remove the dll everytime to start Visual Studio.
I already tried multiple times to reregister asp.net with aspnet_regiis -u, aspnet_regiis -i and aspnet_regiis -r.
When I execute aspnet_regiis -lv I get the following:
1.1.4322.0 Valid (Root) C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
2.0.50727.0 Valid C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll
Does anyone knows a solution to this problem?
This was still a problem for me after following the steps proposed above. Here's the solution that finally worked for us.
Turn on IIS logging on your local machine. Be sure to log the query string and the HTTP response code.
Attempt to open your solution and let it time out.
Perform an iisreset to flush the IIS logs.
Open the IIS logs. You will notice that when you opened your solution you generated quite a bit of activity.
VS2003, for whatever reason, attempts to navigate to some of your pages... in particular, it may navigate to your login page if you have forms authentication turned on.
Check the processing time and HTTP response code in the log entry for your login page. In our case it was returning a 302 HTTP redirect.
In our code, the login page starts up by checking for a cookie and redirecting to an external page if it isn't found. This redirect is to a location that is not accessible in the dev env. So VS would open the page, follow the redirect, and time out trying to get the page.
We fixed it by modifying the login page with the following code:
//If Request is coming from Visual Studio, just return an error
if (Request.UserAgent.StartsWith("Microsoft-Visual-Studio.NET"))
{
Response.StatusCode = 500;
Response.End();
}
Visual Studio can handle the 500. It can't handle a 302 to an unknown host.
Hope this helps.
Did you apply service pack 1 to visual studio 2003?
http://www.microsoft.com/downloads/details.aspx?familyid=69d2219f-ce82-46a5-8aec-072bd4bb955e&displaylang=en
This worked for me...
http://forums.asp.net/p/1192304/2066860.aspx
On my XP development machine I went to "C:\Documents and Settings\USERNAME\VSWebCache\USERNAME\" and deleted the folder matching my VS2003 solution name. (Actually I moved the folder to C:\Temp just in case). This worked, although one designer file would not load without a re-build and the start-up page needed to be re-marked. I don't understand why my solution depends on this VSWebCache (it re-appeared when I re-built my solution.) Can anyone explain this dependence? It's un-settling.

Resources