Event Log – System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

Event Log – System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security

This is a common error specially if you’re using Windows Server 2008 and higher, error means that the application/program that’s trying to write to event log with source not registered properly. Take the sample code below as an example:

EventLog.WriteEntry(“,”Message”);

During the deployment you can register the source by entering the ff command in the command prompt (Run as Administrator):

eventcreate /ID 1 /L APPLICATION /T INFORMATION /SO  /D “Registering”

If for some  reason you don’t know the source is and it’s throwing the error do the following:

Start -> Run -> regedit.exe Navigate to My Computer > HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\EventLog

in the Permissions, and grant the identity wherein the application/server is running with read/write permissions.

You will see the source that you need to register in the Event Log.

IIS 7 Access to the path ‘c:\windows\system32\inetsrv\’ is denied

If you encountered an error related to:

Access to the path ‘c:\windows\system32\inetsrv\’ is denied.

It means that the credential wherein your site or webservice is running doesn’t have permission to that folder.

Steps below describes how to fix it:

1. Browse to the directory -> %windir%\System32

2. Right Click on the inetsrv folder and select Properties

3. Click the Security Tab -> Click Advance Button

4. Select the Owner Tab and click Edit Button, Select Administrators group and Click Apply.

5. Run the command prompt as Administrator and type:

 cacls %windir%\system32\inetsrv /G :F

Ex: cacls %windir%\system32\inetsrv /G RPAULO\WCFServiceUser:F

 

IIS 7.5 Missing Import Application – Deployment

When deploying a website  or a web service using Visual Studio 2010 we can use  a new deployment functionality called Build Deployment Package; this builds a zip file that you can import in IIS. The default location of zip is at ProjectFolder\obj\Debug\Package\.

 

However in IIS Manager, the default installation doesn’t include option to import our package, additional components need to be installed called Web Deploy (download). After installing the add-on you should be able to see the import option in IIS.

 

EsbToolkit 2.1 – Installation and Configuration Errors (Compilation)

I recently installed BizTalk Server 2010 and EsbToolKit 2.1 and below are the summary of errors and instructions on how to overcome them.

Error:

HTTP Error 404.17 – Not Found
The requested content appears to be script and will not be served by the static file handler.

Resolution:

Be sure that .NET 4.0 is installed, then run the following:  aspnet_regiis -i  in C:\Windows\Microsoft.NET\Framework\v4.0.21006

Error:

HTTP Error 404.2 – Not Found
The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server.

Resolution:

1. Go to Internet Information Services (IIS) Manager, click the {YouComputerName} Home (located  after the Start Page icon).

2. in the IIS Section -> Double click ISAPI and CGI Restrictions -> make sure ASP.NET is allowed.

Error:

HTTPException, Could not load file or assembly ‘System.Web.DataVisualization…

Resolution:

1. Download and install Microsoft Chart Controls for .NET 3.5

 Error:

Could not enlist send port ‘ALL.Exceptions’ in Microsoft.Practices.ESB application (BizTalk Admin Console)

Resolution:

Add new filter expression to it, Property: ErrorReport.FailureCode Operator: Exists

 

Error:

HttpException, Could not load type ‘Microsoft.Practices.ESB.Portal.Global’.  

Resolution:

In the ESB Toolkit installation manual there’s no mention of Enterprise Library but in fact you need to install it. Also, ESB Toolkit uses Enterprise Library 4.1 and not 5.0. Get the installer here. Then rerun the Management_Install.cmd.

Error:

WebException,  The remote server returned an error: (401) Unauthorized. 

Resolution:

1. Click Start, click Run, type cmd, and then press ENTER.

2. Locate the directory that contains the Adsutil.vbs file. By default, this directory is C:\Inetpub\Adminscripts.

3. Type cscript adsutil.vbs set w3svc/1/root/NTAuthenticationProviders “Negotiate,NTLM”

 The number after w3svc is the website id, the script above assumes that the ESBPortal is your first website.

For the complete Microsoft Guide click here.

 

Error:

WebException,  The remote server returned an error: (404 ) not found.  

Resolution:

.svc should be register in IIS, run the following command in command prompt.

“%windir%\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe” -r -y

Error:

Runtime Error, Client found response content type of  ‘text/html; charset=utf-8’, but expected ‘text/xml’

Resolution:

Problem lies with ESB.BizTalkOperationsService, by going to the web.Config of this service then setting customErrors mode to “RemoteOnly”, you can see the actual error which is: Could not load type ‘System.ServiceModel.Activation.HttpModule’ from assembly ‘System.ServiceModel’. 

This error could occur if IIS is installed only after installing .NET 4.0. To solve this type the ff: in command prompt:

%WinDir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis -iru

 

Error:

Management_Install.ps1 cannot be loaded because the execution of scripts is disabled on this system.

Resolution:

Open Powershell Command Prompt (Run as Administrator). Type  Set-ExecutionPolicy Unrestricted

Asp.NET – ReportViewer Control not working on IIS7

We recently upgrade our webserver from II6.0 to IIS 7.5, everything works fine except the ReportingViewer control that renders the MSSQL Reporting in Asp.NET. It shows a blank page with missing icons in IE 6.0 and displays missing resource on FireFox.

To solve the problem, you need to add a new Manager Handler in IIS Manager.

Steps are as follows:

1. Open IIS -> Go to Sites – > {Your WebSite} -> In the IIS section double click Handler Mappings

Handler Mappings in IIS7

2.  On the Action (Right side) click Add Managed Handler and set the ff. properties to:

Request Path: Reserved.ReportViewerWebControl.axd

Type: Microsoft.Reporting.WebForms.HttpHandler

Name: ReportViewerWebControl

Click Ok.

Should be fixed now.