Re: Issue with NUnit and Silverlight integration
"Charlie Poole" <[email protected]>
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <00b401c88084$2f98f190$6401a8c0@ferrari> |
This is new territory for me, so others may have better information. As a first cut, based on experience with Windows and Web Forms, I would try running the tests in the STA. You use the config file for the tests to do this - see NUnit's own NUnitTests.config for a example. Charlie _____ From: [email protected] [mailto:[email protected]] On Behalf Of Gulrajani, Raviraj Sent: Friday, March 07, 2008 7:25 AM To: [email protected] Subject: [Nunit-users] Issue with NUnit and Silverlight integration Hello gang, I am trying to use nunit for unit testing a project of mine. In the solution I have two projects: MyProject (this is a silverlight 2.0 project) and TestProject (this is a regular c# project. I reference the nunit.framework.dll and MyProject.dll in the TestProject. I create an instance of a class present in MyProject in the 'TestProject and then assert if the instance is null or not. When I run the test through nunit, I get the below exception: System.UnauthorizedAccessException : Invalid cross-thread access The stack trace is below: at MS.Internal.XcpImports.CheckThread() at MS.Internal.XcpImports.CreateObjectByTypeIndex(UInt32 typeIndex) at System.Windows.DependencyObject..ctor(UInt32 nativeTypeIndex) at System.Windows.UIElement..ctor(UInt32 nKnownTypeIndex) at System.Windows.FrameworkElement..ctor(UInt32 nKnownTypeIndex) at System.Windows.Controls.Control..ctor(UInt32 nKnownTypeIndex) at System.Windows.Controls.UserControl..ctor() Could you please shed some light on the issue? Thanks, Raviraj ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users