Issue with NUnit and Silverlight integration

"Gulrajani, Raviraj" <[email protected]>
Newsgroups gmane.comp.windows.dotnet.nunit.user
Message-ID <04BED110EB41D247918E29051DFF7B28065B8EC8@NYC-EXCLS2.dc1.doubleclick.corp>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.