Module should be referenced messages in Silverlight unit test projects

I have a Silverlight class library which I want to create a unit test for.  I'm not interested in the "Silverlight Test Application" that actually requires you to sit there and use the app to facilitate unit testing, so I've created a standard .Net unit test project.  This does work with the Silverlight library (with some false warnings about the SL class library project not being able to be referenced), but ReSharper's Code Inspection tool marks all the classes from the SL projects with a note stating "Module 'System, [...]' should be referenced" (generally the SL System assembly).  Despite this R# error, I am able to build and run the unit test project just fine.

What I would like to know; Can I disable just this one R# error in code analysis, without disabling code analysis for the entire source file?  The code analysis context menu offers an option to add a reference to System (which can't be done, since the .Net system assembly is essentially a permanent fixture), but not one to suppress the message.  I'm aware I can just exclude the entire file from code analysis, but I'd rather get the benefits of it w/o this nuisance.

2 comments

Hello Erik,

What is the exact version of ReSharper? Thank you!

Andrey Serebryansky
Senior Support Engineer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

I have a Silverlight class library which I want to create a unit test
for.  I'm not interested in the "Silverlight Test Application" that
actually requires you to sit there and use the app to facilitate unit
testing, so I've created a standard .Net unit test project.  This does
work with the Silverlight library (with some false warnings about the
SL class library project not being able to be referenced), but
ReSharper's Code Inspection tool marks all the classes from the SL
projects with a note stating "Module '<SL assembly name here>' should
be referenced" (generally the SL System assembly).  Despite this R#
error, I am able to build and run the unit test project just fine.

What I would like to know; Can I disable just this one R# error in
code analysis, without disabling code analysis for the entire source
file?

---
Original message URL:
http://devnet.jetbrains.net/message/5281663#5281663



0

Sorry for not specifying earlier.  I'm using ReSharper 5.1.1753.4.

0

Please sign in to leave a comment.