Prerequisites for SemanticLogging-svc [Closed]

Topics: Semantic Logging Application Block
May 13, 2013 at 2:44 PM
Edited May 13, 2013 at 2:45 PM
I've had the SemanticLogging-svc running on a test machine. I've copied the files over to another machine but can't get it to run because of a configuration error:

Enterprise Library Semantic Logging Service v1.0.1304.0
Microsoft Enterprise Library
Microsoft Corporation
One or more errors occurred when loading the TraceEventService configuration file.
Operation could destabilize the runtime.
Configuration element:
<sqlDatabaseSink name="sqlSink" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Logging;Integrated Security=True" instanceName="Dave" xmlns="">
        <eventSource name="Test-App-Proj1" level="Informational" />
        <eventSource name="Test-MyEventSource" level="Verbose" />
Line: '18', Position: '6'.

Press enter to end ...
Does anyone have a clue as to what I've done wrong? (I've created the DB in SQLEXPRESS using the supplied scripts (having modified CreateSemanticLoggingDb.cmd to point to SQLExpress).

I was originally trying to get it working with LocalDB but that was giving me the same error so I reverted to SQLExpress which I'd successfully used on the other machine. I've edited the configuration file in Visual Studio and it hasn't flagged any problems with the XML. And the connection string has worked elsewhere. I'm stumped and would appreciate some help.
May 13, 2013 at 2:48 PM
Here's the contents of SemanticLogging-svc.xml:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns=""
               xsi:schemaLocation=" SemanticLogging-svc.xsd">

  <!-- Optional settings for fine tuning performance and Trace Event Session identification-->

    <consoleSink name="consoleSink">
        <eventSource name="Test-App-Proj1"
        <eventSource name="Test-MyEventSource"
    <sqlDatabaseSink name="sqlSink"
                     connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=Logging;Integrated Security=True"
        <eventSource name="Test-App-Proj1"
        <eventSource name="Test-MyEventSource"

May 13, 2013 at 9:19 PM

I did try this configuration with LocalDB both with console and service modes. For console mode, I run elevated and worked flawlessly. For service mode, I got an expected access error because of lacking permissions to LocalService. Fir this case, I agree that will be better to use SqlExpress granting login to LocalService.
Unfortunately I could not repro this same error. I did search for "Operation could destabalize the Runtime" with no conclusive results. However you can find some potential suggestions according to your scenario. I will post here if I found something else.
Feel free to post back any findings if you think that may help to find a fix or just document a known issue.

May 13, 2013 at 10:25 PM
I just tried it on my a standard test client (no dev tools, just .net 4.5 and localdb 2012) and it worked, too. I was surprised since I couldn't run CreateSemanticLoggingDb.cmd because the machine doesn't have SqlCmd.exe but I guess it doesn't try to access the database until an event is written. In console mode it displayed the list of sinks so it started as expected. I ran a client that emitted one event and saw it on the console. Ten seconds later, I got a whole sea of red, including "Message : A database sink failed to publish events." but that makes sense, given no database to which to write.

Normally, things work on dev machines and fail on standard clients, not the other way around. :-) Some investigating on the dev box is required but that will have to wait until tomorrow.

Thanks for your help.
May 14, 2013 at 4:27 PM
I didn't have much time to spend on this, today, but I did confirm that it will start as both a service and as console without the sqlSink but with a fileSink, so the problem does seem to be the sqlSink.
May 15, 2013 at 12:29 PM
You can find SqlCmd.exe in %ProgramFiles%\Microsoft SQL Server\110\Tools\Binn.
On the other hand you can download it from: or get the SSDT which should be already included in Professional, Ultimate, or Premium Edition of Visual Studio 2012 and assuming that you didn't opt out of installing SQL Server Data Tools during setup.
Once you run successfully the DB installation script the sink should work as expected.
May 15, 2013 at 5:46 PM
Are you saying SQLCMD is a prerequisite for the SemanticLogging-svc if you want to use LocalDb?
May 15, 2013 at 9:07 PM
As part of the documented system requirements you should be fine with VS2012 Professional or better and some of the SQL DB flavors detailed in the Semantic Application Block section for SQL sinks.
May 23, 2013 at 4:36 PM
hi, i had the same message as you.. "Operation could destabilize the runtime". after debugging the service, i had a VerificationException on the 1st line of the class sqlDatabaseSink (RetryPolicy retryPolicy = new RetryPolicy....)

then i came across the known issues for entlib 6.
If you are using the Transient Fault Handling Application Block, you should ensure that you are using version 4.0.30319.18003 or later of mscorlib.dll, otherwise you may see a VerificationException exception at run time. For more information, see
i then update mscorlib.dll (with the support link) to the latest version, and the error was gone.
Marked as answer by randylevy on 10/7/2013 at 11:19 PM
Jun 4, 2013 at 11:10 AM
Edited Jun 4, 2013 at 11:20 AM
@DocteurEthylique Thanks for that. It appears to have been at the heart of my problem, too.

I built a machine using our Win7 SP1 standard build, which installs .NET 4.0. I upgraded to .NET 4.5 and installed SqlLocalDB. Apart from Windows patches there was nothing else installed on the machine. I got the same error. I intalled the patch for Win7, did the required restart, and it worked.

The Win 7 version can be found here: An update is available for the .NET Framework 4.5 in Windows 7, Windows 7 SP1, Windows Server 2008 R2, Windows Server 2008 R2 SP1, Windows Server 2008 SP2, and Windows Vista SP2.

I've raised an issue for this.