I am trying to use "TraceReplay" to replay a trace captured by the SQL Server Profiler. I can replay the tracefile using a normal windows application, but I need to get it working with a unit test so that I can simulate user load on the DB server.
This is the first erro i get :-
The assembly named 'pfclnt90' was loaded from 'file:///C:/Program Files/Microsoft SQL Server/90/Tools/Binn/pfclnt90.dll' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.
Followed by
The assembly with display name 'pfclnt90' failed to load in the 'Anonymous' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileNotFoundException: Could not load file or assembly 'pfclnt90, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
File name: 'pfclnt90, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'
=== Pre-bind state information ===
LOG: User = BTWEB\sxs24
LOG: DisplayName = pfclnt90, Version=9.0.242.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91
(Fully-specified)
LOG: Appbase = file:///C:/Program Files/Microsoft Visual Studio 8/Common7/IDE/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\vstesthost.exe.config
LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
I deploy the 'pfclnt90.dll' into the "out" directory but this does not seem to have fixed the problem. Also, If I add 'pfclnt90 to the GAC, the test fails source.InitializeAsReader("C:\\input.trc");
I have included my source below.
Code Snippet
publicvoid go()
{
TraceReplay replay = newTraceReplay();
TraceFile source = newTraceFile();
source.InitializeAsReader("C:\\input.trc");
replay.Source = source;
SqlConnectionInfo connection = newSqlConnectionInfo();
connection.ServerName = "server";
connection.UseIntegratedSecurity = true;
replay.Connection = connection;
replay.Start();
}
Moved this post to the SQL Server SMO / DMO forum (I hope this is the right forum for this question).
No comments:
Post a Comment