安装Visual Studio 2010 SP1后出现问题 [英] Problems after installing Visual Studio 2010 SP1

查看:107
本文介绍了安装Visual Studio 2010 SP1后出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


上周五我在我的机器上安装了Visual Studio SP1,Moles停止了编译。下面你可以找到一些我在Visual Studio错误列表中得到的错误的例子:


  1. 'System.Net.Moles.SFileWebResponse.Dispose(bool) ':找不到合适的方法来覆盖[D:\ ... \ MyProject \obj \Debug \ Moles \\\\\\\\\\\\\\\\\\\\\\\ Net.Moles.SFileWebResponse.SupportsHeaders':找不到合适的方法来覆盖[D:\ ... \ MyProject \obj \Debug \Moles \\\\\\\\\\\\\\\\\\\ >
  2. 命令"""C:\Program Files \ Microsrosoft Moles \ bin \ emles.exe" @" d:\ ... \MyProject\obj\Debug\Moles\moles.args""退出代码-1007
  3. 无法调用抽象基础成员:'System.Xml.XmlReader.Close()'[D:\ ... \ MyyOtherProject \ obj \ Debug\Moles\sx\mgcsproj]
  4. 命令"""C:\Program Files \ Mysrosoft Moles \ bin \ emles.exe" @" d:\ ... \MyOtherProject\obj\Debug\Moles\moles.args""退出代码-1002

我已经尝试了我想象的一切:卸载SP1,修复Visual Studio的安装,重新安装Visual Studio + Pex& ;鼹鼠......但我仍然遇到同样的问题。


我的Pex& Moles是0.94.51006.1(x86)。


任何想法为什么会发生,我该如何解决?


非常感谢。

解决方案

Moles正在生成一些临时文件,当应用于某些程序集时会产生以下模式,例如System.Xml:


http://msdn.microsoft.com/ en-us / library / b307b7dc(v = vs.90).aspx


此类模式无法编译。确切地说,这是在为XmlReader,XmlWriter和XmlResolver生成的moles中发生的。  XmlReader和XmlWriter都是抽象的,XmlReader和XmlWriter moles正在调用它们的基类Close()
方法执行中他们的Close()方法。 XmlResolver对Credentials属性执行相同的操作。


为了重现这一点,我刚刚创建了一个新的类库项目,并为System.Xml程序集添加了一个mole。而已。没有其他修改,生成的代码如下:


命名空间System.Xml.Moles 
{
///< summary> Stub类型< see cref =" T:System.Xml.XmlReader" />
///。< / summary>
[mmf :: Microsoft.Moles.Framework.Stubs.StubClass(typeof(global :: System.Xml.XmlReader))]
[global :: System.Diagnostics.DebuggerDisplay(" Stub = XmlReader) ;)]
[global :: System.Diagnostics.DebuggerNonUserCode]
public partial class SXmlReader
:global :: System.Xml.XmlReader
,mmf :: Microsoft.Moles。 Framework.Stubs.IPartialStub
,mmf :: Microsoft.Moles.Framework.Stubs.IStub
{

//此处更多代码

// /< summary>设置< see cref =" M:System.Xml.XmlReader.Close" />的存根。
///< / summary>
public override void Close()
{
mmf :: Microsoft.Moles.Framework.MolesDelegates.Action sh = this.Close01;
if(sh!=(mmf :: Microsoft.Moles.Framework.MolesDelegates.Action)null)
sh.Invoke();
else
{
if(this .__ callBase)
base.Close();
else
{
mmf :: Microsoft.Moles.Framework.Behaviors.IBehavior _behavior
=((mmf :: Microsoft.Moles.Framework.Behaviors.IBehaved)this)。 InstanceBehavior;
_behavior.VoidResult< global :: System.Xml.Moles.SXmlReader>(this," Close");
}
}
}

//此处更多代码
}
}


Hi,

Last Friday I installed Visual Studio SP1 on my machine and Moles stopped compiling. Following you can find some examples of the kind of errors I get on Visual Studio Error List:

  1. 'System.Net.Moles.SFileWebResponse.Dispose(bool)': no suitable method found to override [D:\...\MyProject\obj\Debug\Moles\s\m.g.csproj]
  2. 'System.Net.Moles.SFileWebResponse.SupportsHeaders': no suitable method found to override [D:\...\MyProject\obj\Debug\Moles\s\m.g.csproj]
  3. The command ""C:\Program Files\Microsoft Moles\bin\moles.exe" @"D:\...\MyProject\obj\Debug\Moles\moles.args"" exited with code -1007
  4. Cannot call an abstract base member: 'System.Xml.XmlReader.Close()' [D:\...\MyOtherProject\obj\Debug\Moles\sx\m.g.csproj]
  5. The command ""C:\Program Files\Microsoft Moles\bin\moles.exe" @"D:\...\MyOtherProject\obj\Debug\Moles\moles.args"" exited with code -1002

I've tried everything I imagined: uninstalling SP1, repairing the installation of Visual Studio, re-installing Visual Studio + Pex & Moles... but I still get th same problems.

My version of Pex & Moles is 0.94.51006.1 (x86).

Any ideas why is is happening and how can I solve it?

Thanks very much.

解决方案

It seems Moles is generating some temporary files that produce the following pattern when applied to certain assemblies, like System.Xml:

http://msdn.microsoft.com/en-us/library/b307b7dc(v=vs.90).aspx

Such pattern doesn't compile. To be precise, this is happening in the moles generated for XmlReader, XmlWriter and XmlResolver. Being both XmlReader and XmlWriter abstract, the XmlReader and XmlWriter moles are calling their base classes Close() method within the implementation of their Close() method. The XmlResolver is doing the same with the Credentials property.

In order to reproduce this, I have just created a new Class Library project and I've added a mole for System.Xml assembly. That's it. No other modification, and the generated code is as follows:

namespace System.Xml.Moles
{
  /// <summary>Stub type of <see cref="T:System.Xml.XmlReader"/>
  /// .</summary>
  [mmf::Microsoft.Moles.Framework.Stubs.StubClass(typeof(global::System.Xml.XmlReader))]
  [global::System.Diagnostics.DebuggerDisplay("Stub = XmlReader")]
  [global::System.Diagnostics.DebuggerNonUserCode]
  public partial class SXmlReader
   : global::System.Xml.XmlReader
   , mmf::Microsoft.Moles.Framework.Stubs.IPartialStub
   , mmf::Microsoft.Moles.Framework.Stubs.IStub
  {
    
    // more code here

    /// <summary>Sets the stub of <see cref="M:System.Xml.XmlReader.Close"/>
    /// </summary>
    public override void Close()
    {
      mmf::Microsoft.Moles.Framework.MolesDelegates.Action sh = this.Close01;
      if (sh != (mmf::Microsoft.Moles.Framework.MolesDelegates.Action)null)
       sh.Invoke();
      else 
      {
       if (this.__callBase)
        base.Close();
       else 
       {
        mmf::Microsoft.Moles.Framework.Behaviors.IBehavior _behavior
          = ((mmf::Microsoft.Moles.Framework.Behaviors.IBehaved)this).InstanceBehavior;
        _behavior.VoidResult<global::System.Xml.Moles.SXmlReader>(this, "Close");
       }
      }
    }
    
    // more code here
  }
}


这篇关于安装Visual Studio 2010 SP1后出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆