MudassarRasool / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Could not resolve Assembly 'System.Windows.Forms, Version=2.0.0.0, .Net CF on VS 2008 and R# #445

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I get several exceptions per minute with Visual Studio 2008 and Resharper
4.5 developing a Compact Framework 2.0 application (no Tests involved as CF
is not supported by testing frameworks). I am using the newest Gallio 3.0.7
build 106.

I guess this is probably difficult to reproduce, I'll try to put a minimal
example together which still can reproduce that problem.

LoggerException: Could not resolve Assembly 'System.Windows.Forms,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac'.
->
Gallio.Common.Reflection.ReflectionResolveException: Could not resolve
Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969db8053d3322ac'.
   at
Gallio.Common.Reflection.Impl.ReflectorResolveUtils.ResolveAssembly(IAssemblyInf
o
assembly, Boolean fallbackOnPartialName, Boolean throwOnError) in
c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\Reflection\Impl\ReflectorResolveUtils.cs:li
ne
68
   at
Gallio.Common.Reflection.Impl.StaticAssemblyWrapper.<>c__DisplayClass9.<Resolve>
b__8()
in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\Reflection\Impl\StaticAssemblyWrapper.cs:li
ne
126
   at Gallio.Common.KeyedMemoizer`2.Memoize(TKey key, Func`1 populator) in
c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\KeyedMemoizer.cs:line 89
   at Gallio.Common.Reflection.Impl.StaticAssemblyWrapper.Resolve(Boolean
throwOnError) in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\Reflection\Impl\StaticAssemblyWrapper.cs:li
ne
125
   at
Gallio.ReSharperRunner.Reflection.PsiReflectionPolicy.GetAssemblyReferences(Stat
icAssemblyWrapper
assembly)
   at
Gallio.Common.Reflection.Impl.StaticAssemblyWrapper.<GetReferencedAssemblies>b__
2()
in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\Reflection\Impl\StaticAssemblyWrapper.cs:li
ne
95
   at Gallio.Common.Memoizer`1.Memoize(Func`1 populator) in
c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\Memoizer.cs:line 67
   at
Gallio.Common.Reflection.Impl.StaticAssemblyWrapper.GetReferencedAssemblies()
in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Common\Reflection\Impl\StaticAssemblyWrapper.cs:li
ne
94
   at
Gallio.Model.DefaultTestFrameworkManager.FilteredTestExplorer.ContainsAssemblyRe
ference(IAssemblyInfo
assembly, String[] assemblyNames) in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 186
   at
Gallio.Model.DefaultTestFrameworkManager.FilteredTestExplorer.PopulateAggregateS
ervicesByFrameworkAssembly(AggregateTestExplorer
aggregateTestExplorer, IAssemblyInfo assembly) in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 155
   at
Gallio.Model.DefaultTestFrameworkManager.FilteredTestExplorer.CreateAggregateTes
tExplorerForCodeElement(ICodeElementInfo
codeElement) in c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 145
   at
Gallio.Model.DefaultTestFrameworkManager.FilteredTestExplorer.IsTestPart(IReflec
tionPolicy
reflectionPolicy, ICodeElementInfo codeElement) in
c:\RelEng\Projects\MbUnit
v3.0.7\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 107
   at
Gallio.ReSharperRunner.Provider.GallioTestProvider.Shim.IsUnitTestStuff(IDeclare
dElement
element)
   at
Gallio.ReSharperRunner.Provider.GallioTestProvider.IsUnitTestStuff(IDeclaredElem
ent
element)
   at
JetBrains.ReSharper.UnitTestExplorer.UnitTestManager.IsUnitTestStuff(IDeclaredEl
ement
declaredElement) in
c:\Agent\work\6f6005be76df46e2\src\UnitTestExplorer\src\Manager\UnitTestManager.
cs:line
759
   at
JetBrains.ReSharper.UnitTestExplorer.UsageInspectionsSupressor.SupressUsageInspe
ctionsOnElement(IDeclaredElement
element) in
c:\Agent\work\6f6005be76df46e2\src\UnitTestExplorer\src\Manager\UsageInspections
Supressor.cs:line
12
   at
JetBrains.ReSharper.Daemon.UsageCheckingUtil.ShouldSupressUsageInspections(IDecl
aredElement
element) in
c:\Agent\work\6f6005be76df46e2\src\Daemon\src\UsageCheckingUtil.cs:line 22
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.UnusedGlobalDeclarationStageProcess.Sho
uldReportForElement(IDeclaredElement
element) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\UnusedGlobalDeclarat
ionStage.cs:line
44
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.UnusedGlobalDeclarationStageProcess.IsT
ypeConversionSuspicious(IExpressionType
type1, IExpressionType type2) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\UnusedGlobalDeclarat
ionStage.cs:line
201
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.UnusedGlobalDeclarationStageProcess.Vis
itCastExpression(ICastExpression
castExpr) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\UnusedGlobalDeclarat
ionStage.cs:line
140
   at
JetBrains.ReSharper.Psi.CSharp.Impl.Tree.CastExpression.Accept(ElementVisitor
visitor) in
c:\Agent\work\6f6005be76df46e2\src\Gen\Psi\CSharp\Impl\CastExpression.cs:line
18
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.CSharpDaemonStageProcessBase.ProcessAft
erInterior(IElement
element) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\CSharpDaemonStageBas
e.cs:line
121
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
75
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Psi.ExtensionsAPI.Tree.TreeElement.ProcessDescendants(IRecur
siveElementProcessor
processor) in
c:\Agent\work\6f6005be76df46e2\src\Psi\src\ExtensionsAPI\Tree\TreeElement.cs:lin
e
74
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.UnusedDeclarationStageProcessBase.<Exec
ute>b__0(ICSharpFile
file) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\UnusedDeclarationSta
geProcessBase.cs:line
207
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.CSharpDaemonStageProcessBase.HighlightI
nFile(Action`1
fileHighlighter, Action`1 commiter) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\CSharpDaemonStageBas
e.cs:line
67
   at
JetBrains.ReSharper.Daemon.CSharp.Stages.UnusedDeclarationStageProcessBase.Execu
te(Action`1
commiter) in
c:\Agent\work\6f6005be76df46e2\src\Daemon.CSharp\src\Stages\UnusedDeclarationSta
geProcessBase.cs:line
207
   at
JetBrains.ReSharper.Daemon.Impl.DaemonProcessBase.DoHighlighting(DaemonProcessKi
nd
kind, Action`1 commiter) in
c:\Agent\work\6f6005be76df46e2\src\Daemon\src\Impl\DaemonProcessBase.cs:line 176
--- End of Inner Exception Stack Trace ---
   bei
JetBrains.ReSharper.Daemon.Impl.DaemonProcessBase.DoHighlighting(DaemonProcessKi
nd
kind, Action`1 commiter) in
c:\Agent\work\6f6005be76df46e2\src\Daemon\src\Impl\DaemonProcessBase.cs:Zeile
196.
   bei
JetBrains.ReSharper.Daemon.Impl.VisibleDocumentDaemonProcess.DoHighlighting(Bool
ean
globalAnalysisStages) in
c:\Agent\work\6f6005be76df46e2\src\Daemon\src\Impl\VisibleDocumentDaemonProcess.
cs:Zeile
238.
   bei
JetBrains.ReSharper.Daemon.Impl.VisibleDocumentDaemonProcess.<>c__DisplayClass3.
<EnqueueHighlightingJob>b__1()
in
c:\Agent\work\6f6005be76df46e2\src\Daemon\src\Impl\VisibleDocumentDaemonProcess.
cs:Zeile
209.
   bei JetBrains.ReSharper.Daemon.Impl.DaemonThreadImpl.DaemonThreadProc()
in
c:\Agent\work\6f6005be76df46e2\src\Daemon\src\Impl\DaemonThreadImpl.cs:Zeile 
119.
   bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   bei System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
   bei System.Threading.ThreadHelper.ThreadStart()

Original issue reported on code.google.com by gunter...@gmail.com on 16 May 2009 at 5:47

GoogleCodeExporter commented 8 years ago
This is a little difficult to pinpoint.

Last time i loaded my CE solution i immediately had this exception (i have
solution-wide analysis on). Then i noticed a reference to 
Microsoft.WindowsCE.Form
which the solution didn't need. I removed it and after that i didn't have the
exception after the next load. Strange. Probably i should clear R#'s cache too.

Original comment by gunter...@gmail.com on 17 May 2009 at 3:23

GoogleCodeExporter commented 8 years ago
It is very bizarre.

Looks like you stumbled on an old FIXME in
PsiReflectionPolicy.GetAssemblyReferences() though.  I guess it's time to fix 
it.  :-)

            // FIXME! Don't know how to handle referenced assemblies for modules.
            return assembly.Resolve(true).GetReferencedAssemblies();

Original comment by jeff.br...@gmail.com on 17 May 2009 at 8:09

GoogleCodeExporter commented 8 years ago
I have added a better workaround for this case that does not require the 
assembly to
be resolved.  Shouldn't happen anymore in v3.1.

Original comment by jeff.br...@gmail.com on 11 Aug 2009 at 11:46