File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -197,18 +197,28 @@ public static bool InUnitTestRunner()
197
197
198
198
string [ ] designEnvironments = new [ ] {
199
199
"BLEND.EXE" ,
200
- "DEVENV.EXE" ,
201
200
"MONODEVELOP" ,
202
201
"SHARPDEVELOP.EXE" ,
203
202
} ;
204
203
205
204
#if SILVERLIGHT
206
- if ( Application . Current . RootVisual != null && System . ComponentModel . DesignerProperties . GetIsInDesignMode ( Application . Current . RootVisual ) ) {
205
+ var ret = Deployment . Current . Parts . Any ( x =>
206
+ testAssemblies . Any ( name => x . Source . ToUpperInvariant ( ) . Contains ( name ) ) ) ;
207
+
208
+ if ( ret ) {
209
+ return ret ;
210
+ } ;
211
+
212
+ try {
213
+ if ( Application . Current . RootVisual != null && System . ComponentModel . DesignerProperties . GetIsInDesignMode ( Application . Current . RootVisual ) ) {
214
+ return false ;
215
+ }
216
+ } catch {
217
+ // If we're in some weird state, assume we're not
207
218
return false ;
208
219
}
209
220
210
- return Deployment . Current . Parts . Any ( x =>
211
- testAssemblies . Any ( name => x . Source . ToUpperInvariant ( ) . Contains ( name ) ) ) ;
221
+ return ret ;
212
222
#else
213
223
// Try to detect whether we're in design mode - bonus points,
214
224
// without access to any WPF references :-/
You can’t perform that action at this time.
0 commit comments