Sunday, February 19, 2012

Deploy application that uses TraceReplay and TraceFile TMO classes

Hi,

I have a .NET 2. 0 application that references SMO and uses TMO classes such as TraceReplay and TraceFile. I was under the impression that for this application to work, if SMO is installed (which means MSXML 6.0 and SQL Native Client is also installed), the application should work. But I have started to see errors like:

....Could not load file or assembly 'file:///C:\Program Files\Microsoft SQL Server\90\Tools\Binn\pfclnt90.dll' or one of its dependencies. The system cannot find the file specified.
File name: 'file:///C:\Program Files\Microsoft SQL Server\90\Tools\Binn\pfclnt90.dll'.....

and

....Could not load file or assembly 'Microsoft.SqlServer.Instapi, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies.....

SMO is installed on the machine - but it still raises the above error when TraceFile.InitializeAsReader is called.

Is anything else (in addition to SMO, MSXML 6.0, SQL Native Client) needs to be installed for TMO applications to work?

Darshan Singh

Probably too late for you, but may help others...

One thing that I recently noted that can cause the file not found for pfclnt90.dll is that the trace and replay objects are not supported on 64-bit. So if your application is running in anything other than x86 mode you get this error. A simple solution that will certainly clarify this type of issue is to compile your application for the x86 platform only, as set under project properties in Visual Studio.

(See ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/smo9mref/html/N_Microsoft_SqlServer_Management_Trace.htm)

|||

The Trace and Replay objects require SQL Profiler components to be installed on the machine. Those can only be installed by full client tools installation and are not presnet in any re-dist package. We are looking into ways of removing this limiation in the future.

Regards,

Maciek Sarnowicz

No comments:

Post a Comment