The compiler failed with error code -1073741502 - iis-7

I have site that is hosted on the window server 2008 R2 with IIS7 since last 2 years now it suddenly start giving error: The compiler failed with error code -1073741502 at clicking for any page on menu bar. However before this login page is running normally.
Event log error for this shows error code 3007 i.e. External Component has thrown exception in the eventlog viewer - but this site was working fine from last few months so how it can give exception for external component now.
There may be application pool issue - with this site
Currently I am using 'local system' as application pool as database is placed on the same the server.
Please suggest how to overcome this problem. May be some tips regarding setting of application pool can help me.
Thanks

Related

HTTP Error 500.30 - ASP.NET Core app failed to start on working web site

web site works normally, but about once a day it throws error and stopped working with error HTTP Error 500.30 - ASP.NET Core app failed to start, event log says Access to the path 'C:\inetpub\wwwroot\mysite.com\Plugins\bin\Plugin.plugin.dll' is denied. But there is access to that path. I tried to remove plugin, but same error happens on different plugin folder.
I tried different solutions from stackoverflow, but still no success.
It starts to work when recycle a pool, I have set up it recycling for once a day, but it happens not as recycling pool schedule time.
Apprecite any help.
I found solution here: IIS shutsdown website even though timeout for app pool is set to 0
and here: https://www.taithienbo.com/how-to-auto-start-and-keep-an-asp-net-core-web-application-and-keep-it-running-on-iis/

IIS: Parser Error Message: Could not create type

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.

why I can run my asp.net site on local iis?

I have local iis7 on my machine. there are two application running on it: web service and asp.net site.
until yesterday it had worked perfectly, but today suddenly when I run it I get this error:
unable to start debugging on the web server.
the underlying connection was closed: an unexpected error occurred on a send.
click help for more information.
when I build it I don't see any problem.
what can be the problem?
See the "Tray Icons".....and
Right click on the webserver Icon->exit/close....
then run your application or
Or
restart your computer.....causes your IIS will restart...
More Information :
http://support.microsoft.com/kb/915599
Tray area in desktap

ASP.NET app which worked fine on IIS 6 is not working correctly in IIS 7

I have a web app which is working fine in IIS 6 ex:loading page, loading doc and excel file perfectly. recently I moved the same web app code ti windows server 2008 R2 IIS 7. Now it is not working correctly, it is browsing but it is not loading the Excel and doc files properly.
Additonal Trouble Shooting Info
Adding to the above when i checked the event viewer i am getting below information
The description for Event ID 0 from source Quotes cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.
If the event originated on another computer,
the display information had to be saved with the event.
The following information was included with the event:
Class : GetFile Method : Page_Load An unexpected error has occurred
while locally saving the requested file. Error details - Object
reference not set to an instance of an object. the message resource is
present but the message is not found in the string/message table
could you please help on this. how to find the root error and how to trouble shoot further.
This is a long shot but we had an issue where we used to parse data Excel worksheets using Microsoft.JET.OLEDB.4.0
This started to throw errors on an Application hosted within IIS7 but was fine in IIS6.
Our fix was to:
Right click the Application Pool being used by the Web App
Advanced Settings
Set Enable 32-Bit Applications to True
If that fails to help, why not try to use the Classic .NET AppPool with your application, as opposed to the DefaultAppPool (which I am assuming is the case).
Good luck!

ASP.Net: MySQL Error SecurityException: System.Security.Permissions.SecurityPermission

I am receiving the following error message:
Server Error in '/' Application.
Security Exception
Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.
Exception Details: System.Security.SecurityException: System.Security.Permissions.SecurityPermission
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SecurityException: System.Security.Permissions.SecurityPermission]
MySql.Data.MySqlClient.MySqlClientFactory..cctor() +23
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
MySQL: mysql-connector-net-6.7.4
The problem only occurs if run from the shared web hosting environment. The site works great locally. I know the version of the .Net connector that my shared hosting environment uses, as that was another issue that I resolved and I was in communication with the hosting provider.
The error is interesting. I can go to the default page, no issues, the very first time. I then go to bring up a popup dialog, which throws another error message box.
Exception has been thrown by the target of an invocation.
The above is everything, except for the okay button.
I can bring up the first popup, a sign in dialog, which comes up. That dialog does not invoke MySQL. I bring up the second dialog, a registration dialog, which then throws the "Exception has been thrown..." message box. After that, I cannot go back into the sign-in dialog, as I get the "Exception has..." message box. If I press F5 to refresh the browser (IE or Chrome), I get the error from above. The above error indicates MySQL and some permissions.
I am suspecting that the "Exception has been thrown..." error is the result of the same MySQL, just the page has memory. Closing the browser window and launching the browser window again does not help, although on Chrome that works, just the browser window there really has to close down all the way.
I am in a shared hosting environment, so I have access to basically nothing, so I do not have access to any logs, at least that I can think of.
One final thought that may or may not be relevant. Yesterday and previous days my development work was done on a system with Windows 7 Professional and Visual Studio 2012 Professional (all latest service packs and updates), whereas today I am working at a different computer of mine, which is a system with Windows 8 Professional and Visual Studio 2012 Ultimate (all latest service packs and updates on the OS and VS). I was reading some other posts on unrelated issues that people with VS2012 Ultimate had issues, so I am not sure that has anything to do with it, but that is something that changed from yesterday to today.
Yes, I deleted everything off of the server and uploaded everything anew. I did a clean solution first, built the release, and then published. I still received the same error.
Any thoughts?
By default most hosts use "Medium" trust level. You can change your web.config as below to get full trust:
<configuration>
<system.web>
<trust level="Full" />
</system.web>
</configuration>

Resources