尝试安装Xcode 3.2.5时。在OS X El Capitan 10.11.5上,它失败并显示错误消息:
发生了未知的安装错误。安装程序遇到导致安装失败的错误。请与软件制造商联系以获取帮助。
我尝试使用GUI安装程序并使用命令行安装它:
cd / Applications sudo installer -pkg / Volumes / Xcode \ and \ iOS \ SDK / Xcode \ and \ iOS \ SDK.mpkg -target / -allowUntrusted -verbose -lang en
两者都失败了......
那么我该怎样才能安装这个旧的Xcode版本?
答案 0 :(得分:0)
您可以尝试以下选项
public class MyClass
{
public virtual IAdapter Adapter {get;set;}
public MyClass(IAdapter adapter)
{
Adapter = adapter;
}
}
var adapter = new Mock<IAdapter>();
adapter.Setup(a => a.WaitForDigit()).Returns(1);
var myClass = new MyClass(adapter.Object); //throws exception
System.ArgumentException: Constant does not match the defined type.
Result StackTrace:
at System.Reflection.Emit.TypeBuilder.SetConstantValue(ModuleBuilder module, Int32 tk, Type destType, Object value)
at System.Reflection.Emit.ParameterBuilder.SetConstant(Object defaultValue)
at Castle.DynamicProxy.Generators.Emitters.MethodEmitter.DefineParameters(ParameterInfo[] parameters)
at Castle.DynamicProxy.Generators.Emitters.MethodEmitter..ctor(AbstractTypeEmitter owner, String name, MethodAttributes attributes, MethodInfo methodToUseAsATemplate)
at Castle.DynamicProxy.Generators.Emitters.AbstractTypeEmitter.CreateMethod(String name, MethodAttributes attributes, MethodInfo methodToUseAsATemplate)
at Castle.DynamicProxy.Generators.MethodGenerator.Generate(ClassEmitter class, ProxyGenerationOptions options, INamingScope namingScope)
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementMethod(MetaMethod method, ClassEmitter class, ProxyGenerationOptions options, OverrideMethodDelegate overrideMethod)
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter class, ProxyGenerationOptions options)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1.<GenerateCode>b__0(String n, INamingScope s)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
at Moq.Proxy.CastleProxyFactory.CreateProxy(Type mockType, ICallInterceptor interceptor, Type[] interfaces, Object[] arguments)
at Moq.Mock`1.<InitializeInstance>b__24_0()
at Moq.PexProtector.Invoke(Action action)
at Moq.Mock`1.InitializeInstance()
at Moq.Mock`1.OnGetObject()
at Moq.Mock.GetObject()
at Moq.Mock.get_Object()
at Moq.Mock`1.get_Object()
如果安装在OSX上,则卸载新版本的Xcode