Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error concerning Mono.Cecil on new blank project #118

Closed
goldshtn opened this issue Sep 1, 2015 · 8 comments
Closed

Build error concerning Mono.Cecil on new blank project #118

goldshtn opened this issue Sep 1, 2015 · 8 comments

Comments

@goldshtn
Copy link

goldshtn commented Sep 1, 2015

To reproduce: create a new console application project in Visual Studio 2013, install the Costura NuGet package (1.3.4.0), build. This is the result I'm seeing right now:

1>------ Build started: Project: CosturaRepro3, Configuration: Debug Any CPU ------
1>    Fody (version 1.28.3.0) Executing
1>MSBUILD : error : Fody: An unhandled exception occurred:
1>MSBUILD : error : Exception:
1>MSBUILD : error : Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
1>MSBUILD : error : StackTrace:
1>MSBUILD : error :    at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
1>MSBUILD : error :    at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters()
1>MSBUILD : error :    at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
1>MSBUILD : error :    at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
1>MSBUILD : error :    at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
1>MSBUILD : error :    at System.RuntimeType.GetPropertyCandidates(String name, BindingFlags bindingAttr, Type[] types, Boolean allowPrefixLookup)
1>MSBUILD : error :    at System.RuntimeType.GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
1>MSBUILD : error :    at System.Type.GetProperty(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers)
1>MSBUILD : error :    at PropertyDelegateBuilder.BuildPropertySetDelegate[T](Type type, String propertyName) in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\DelegateBuilders\PropertyDelegateBuilder.cs:line 9
1>MSBUILD : error :    at DelegateBuilder.BuildDelegateHolder(Type weaverType) in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\DelegateBuilders\DelegateBuilder.cs:line 25
1>MSBUILD : error :    at DelegateBuilder.GetDelegateHolderFromCache(Type weaverType) in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\DelegateBuilders\DelegateBuilder.cs:line 16
1>MSBUILD : error :    at InnerWeaver.InitialiseWeavers() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 111
1>MSBUILD : error :    at InnerWeaver.Execute() in c:\ConsoleBuildAgent\work\ed448661dbb30d2e\FodyIsolated\InnerWeaver.cs:line 61
1>MSBUILD : error : Source:
1>MSBUILD : error : mscorlib
1>MSBUILD : error : TargetSite:
1>MSBUILD : error : Void GetSignature(Void*, Int32, System.RuntimeFieldHandleInternal, System.IRuntimeMethodInfo, System.RuntimeType)
1>MSBUILD : error : 
1>      Finished Fody 101ms.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
@SimonCropp
Copy link
Member

Does it happen with the newest version of fody?

@goldshtn
Copy link
Author

goldshtn commented Sep 1, 2015

@SimonCropp I'm using whatever's coming from NuGet: it's 1.28.3 currently.

@goldshtn
Copy link
Author

goldshtn commented Sep 1, 2015

@SimonCropp After upgrading manually to Fody 1.29.3 I'm getting the following:

1>------ Rebuild All started: Project: CosturaRepro3, Configuration: Debug Any CPU ------
1>    Fody: Fody (version 1.29.3.0) Executing
1>MSBUILD : error : Fody/Costura: Trying to redirect mscorlib type 'System.Collections.Generic.Dictionary`2<System.String,System.Boolean>', but can't find it, please contact the Costura team
1>MSBUILD : error : Fody/Costura: Trying to redirect mscorlib type 'System.Collections.Generic.Dictionary`2<System.String,System.String>', but can't find it, please contact the Costura team
1>MSBUILD : error : Fody/Costura: Trying to redirect mscorlib type 'System.Collections.Generic.Dictionary`2<System.String,System.Boolean>', but can't find it, please contact the Costura team
1>MSBUILD : error : Fody/Costura: Trying to redirect mscorlib type 'System.Collections.Generic.Dictionary`2<System.String,System.Boolean>', but can't find it, please contact the Costura team
1>MSBUILD : error : Fody/Costura: Trying to redirect mscorlib type 'System.Collections.Generic.Dictionary`2<System.String,System.String>', but can't find it, please contact the Costura team
1>MSBUILD : error : Fody: An unhandled exception occurred:
1>MSBUILD : error : Exception:
1>MSBUILD : error : Value does not fall within the expected range.
1>MSBUILD : error : StackTrace:
1>MSBUILD : error :    at Mono.Cecil.Rocks.TypeReferenceRocks.MakeGenericInstanceType(TypeReference self, TypeReference[] arguments)
1>MSBUILD : error :    at Extensions.MakeHostInstanceGeneric(MethodReference self, TypeReference[] args) in C:\Code\Costura\Fody\Extensions.cs:line 22
1>MSBUILD : error :    at ModuleWeaver.Import(Object operand, TypeDefinition source, TypeDefinition target) in C:\Code\Costura\Fody\AssemblyLoaderImporter.cs:line 366
1>MSBUILD : error :    at ModuleWeaver.CloneInstruction(Instruction instruction, TypeDefinition source, TypeDefinition target) in C:\Code\Costura\Fody\AssemblyLoaderImporter.cs:line 298
1>MSBUILD : error :    at ModuleWeaver.CopyInstructions(MethodDefinition templateMethod, MethodDefinition newMethod, TypeDefinition source, TypeDefinition target) in C:\Code\Costura\Fody\AssemblyLoaderImporter.cs:line 283
1>MSBUILD : error :    at ModuleWeaver.CopyMethod(MethodDefinition sourceMethod, TypeDefinition source, TypeDefinition target, Boolean signatureOnly, Boolean makePrivate) in C:\Code\Costura\Fody\AssemblyLoaderImporter.cs:line 223
1>MSBUILD : error :    at ModuleWeaver.ImportAssemblyLoader(Boolean createTemporaryAssemblies) in C:\Code\Costura\Fody\AssemblyLoaderImporter.cs:line 62
1>MSBUILD : error :    at ModuleWeaver.Execute() in C:\Code\Costura\Fody\ModuleWeaver.cs:line 33
1>MSBUILD : error :    at lambda_method(Closure , Object )
1>MSBUILD : error :    at InnerWeaver.ExecuteWeavers() in c:\Code\Fody\FodyIsolated\InnerWeaver.cs:line 164
1>MSBUILD : error :    at InnerWeaver.Execute() in c:\Code\Fody\FodyIsolated\InnerWeaver.cs:line 82
1>MSBUILD : error : Source:
1>MSBUILD : error : Mono.Cecil.Rocks
1>MSBUILD : error : TargetSite:
1>MSBUILD : error : Mono.Cecil.GenericInstanceType MakeGenericInstanceType(Mono.Cecil.TypeReference, Mono.Cecil.TypeReference[])
1>MSBUILD : error : 
1>    Fody:   Finished Fody 39ms.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

@jasonmcboyd
Copy link

I get the same exception regarding mono.cecil when I install costura.fody 1.3.4. I removed version 1.3.4 and dropped down to version 1.3.3 and everything works fine.

@FocusedObjective
Copy link

I also just tried to upgrade to 1.3.4 and got the same error. A few not accessible path error messages flashed by when installing via NuGet. Will try and capture them.

@kavengagne
Copy link

In my case, I get another error when using 1.3.3 or 1.3.2.

@SimonCropp
Copy link
Member

try 1.3.5

@goldshtn
Copy link
Author

goldshtn commented Sep 2, 2015

@SimonCropp Confirmed as working in 1.3.5. Thanks for the quick fix.

@goldshtn goldshtn closed this as completed Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants