profiling a DLL
steve.burkett
Posts: 16
Hello,
I'm trying out the latest version of Ants profiler.
I want to profile the .Net code in a DLL that's loaded by mstest.
So, I profiled:
App: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\mstest.exe
Working Dir: \Daily\Vault\Main\FunctionalTests\VaultFunctionalTests\bin\Release
Argument: /testcontainer:VaultFunctionalTests.dll
However, the profile came up with NO .Net code profiled. Why not? The VaultFunctionaltest.dll is a .Net DLL that I was trying to profile.
How do I do this?
I'm trying out the latest version of Ants profiler.
I want to profile the .Net code in a DLL that's loaded by mstest.
So, I profiled:
App: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\mstest.exe
Working Dir: \Daily\Vault\Main\FunctionalTests\VaultFunctionalTests\bin\Release
Argument: /testcontainer:VaultFunctionalTests.dll
However, the profile came up with NO .Net code profiled. Why not? The VaultFunctionaltest.dll is a .Net DLL that I was trying to profile.
How do I do this?
Comments
It's not as easy as profiling mstest.exe because mstest actually starts a new process that hosts your dll. Since ANTS Profiler cannot cross process boundaries, you get no results. The proposed workaround is here. If this is not successful, please let me know. Well, let us know either way if you don't mind!
how do you do this to get a profile of the test running?
If you can actually get mstest.exe to work from the command-line, ANTS Profiler will show you results for the unit test if the /noisolation argument to mstest is used. Supposedly there is a drawback to using /noisolation in that the mstest process will become less stable. Here is the project setup that I had got to work in ANTS Profiler, after, of course fiddling around with MSTEST.exe for about an hour trying to figure out where to copy the assembly that I want to test! (Very important: run your mstest command in a console window first to ensure it actually works before throwing it at ANTS Profiler!)
- .Net Desktop Application: C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\MSTest.exe
- Working directory:C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
- Arguments:/testcontainer:"C:\Documents and Settings\me\My Documents\Visual Studio 2005\Projects\MyProject\TestProject1\obj\Debug\testproject1.dll" /runconfig:"C:\Documents and Settings\me\My Documents\Visual Studio 2005\Projects\MyProject\localtestrun.testrunconfig" /test:MyMethodTest /noisolation
Hopefully you can also get this to work successfully.I've tried to profile a Unit test using mstest and your proposed configuration, but have a serious problem with the /noisolation parameter:
This parameter prevents the unit test from getting the unit tests configuration file. So I'm still unable to profile my unit test:
- Without /noisolation option the Unit test succeeds, but cannot be profiled, because mstest starts the test in a new process (vstetsthost.exe) Ants cannot profile
- with /noisolation option I could profile, because mstest performs the test in the same process context, but the result is worthless: My test failes because it cannot read the test's configuration file
Any idea, how to get out of this predicament
Regards,
Burkhard
I haven't tested it, but maybe MSTEST's /runconfig argument is what you need in your argument line for ANTS Profiler.
I already have used the /runconfig option. It does not work.
Regards,
Burkhard
My question is more like: "Is there any other trick to profile a Unit test with ANTS? Is it possible to attach the Vstesthost.exe process with ANTS?Will this problem be solved in a future release of ants?"
Regards,
Burkhard