Crash while building after update to SmartAssembly 7.4.2.3588
clinke
Posts: 18 Bronze 1
Dear sir or madam,
after updating to SmartAssembly 7.4.2.3588, we are not able to bild our project anymore. I've already sent an error report, this is the stack trace:
Loading...
Starting...
Analyzing...
Preparing...
Creating assembly...
Failed
SmartAssembly.InformationException: An error occurred while writing the assembly
to disk:
Unable to resolve type System.Collections.Generic.List`1 in assembly System.Coll
ections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
If you think this is a bug in SmartAssembly, please retry in the GUI and send th
e error to Red Gate. ---> SmartAssembly.Engine.TypeResolutionException: Unable t
o resolve type System.Collections.Generic.List`1 in assembly System.Collections,
Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
bei ♠.↨.☺(TypeReference ☻, TypeDefinition& ♥, Boolean )
bei ♠.↨.☺(TypeReference )
bei SmartAssembly.Engine.Metadata.TypeReference.☺(TypeReference )
bei ☼.‼.☺(ITypeDefOrRef , ITypeDefOrRef )
bei ?.☺(ElementType )
bei §.↕.☺(ElementType )
bei SmartAssembly.Engine.Metadata.TypeSpecification.☺(TypeSpecification )
bei SmartAssembly.Engine.Metadata.TypeSpecification.☺(Object )
bei SmartAssembly.Engine.Metadata.MemberReference`2.☺(ITypeDefOrRefOrSpec , I
TypeDefOrRefOrSpec )
bei SmartAssembly.Engine.Metadata.MemberReference`2.☺(MemberReference`2 )
bei SmartAssembly.Engine.Metadata.MemberReference`2.Equals(Object )
bei System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
bei System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& val
ue)
bei SmartAssembly.Engine.Writer.TableDataGenerator.☺(☼ )
bei ♠.↨.☺(Object , MethodBodyWriter )
bei ♠.↨.☺(MethodBodyWriter , ‼ , Object )
bei ♠.↨.☺(MethodBodyWriter , Instruction )
bei ♠.↨.☺(♣ , MethodBodyWriter )
bei ♠.↨.☺(♣& ☻, MethodBody ♥, IDictionary`2 ♦, MethodBodyWriter )
bei ♠.↨.☺(MethodBody ☻, MethodBodyWriter ♥, Dictionary`2& )
bei SmartAssembly.Engine.Writer.TableDataGenerator.☺()
bei ♠.↨.☺ )
bei ♠.↨.☺(FileInfo , IAssembly , ProcessingProjectHelper , IAssemblyWriterOpt
ions )
bei ♠.↨.☺(String ☻, ProcessingProjectHelper ♥, IAssembly ♦, Configuration )
bei SmartAssembly.ProcessingProjectHelper.☻()
--- Ende der internen Ausnahmestapelüberwachung ---
SmartAssembly has encountered an error while running your project.
Failed: SmartAssembly.InformationException: An error occurred while writing the
assembly to disk:
Unable to resolve type System.Collections.Generic.List`1 in assembly System.Coll
ections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
If you think this is a bug in SmartAssembly, please retry in the GUI and send th
e error to Red Gate. ---> SmartAssembly.Engine.TypeResolutionException: Unable t
o resolve type System.Collections.Generic.List`1 in assembly System.Collections,
Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
bei ♠.↨.☺(TypeReference ☻, TypeDefinition& ♥, Boolean )
bei ♠.↨.☺(TypeReference )
bei SmartAssembly.Engine.Metadata.TypeReference.☺(TypeReference )
Starting...
Analyzing...
Preparing...
Creating assembly...
Failed
SmartAssembly.InformationException: An error occurred while writing the assembly
to disk:
Unable to resolve type System.Collections.Generic.List`1 in assembly System.Coll
ections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
If you think this is a bug in SmartAssembly, please retry in the GUI and send th
e error to Red Gate. ---> SmartAssembly.Engine.TypeResolutionException: Unable t
o resolve type System.Collections.Generic.List`1 in assembly System.Collections,
Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
bei ♠.↨.☺(TypeReference ☻, TypeDefinition& ♥, Boolean )
bei ♠.↨.☺(TypeReference )
bei SmartAssembly.Engine.Metadata.TypeReference.☺(TypeReference )
bei ☼.‼.☺(ITypeDefOrRef , ITypeDefOrRef )
bei ?.☺(ElementType )
bei §.↕.☺(ElementType )
bei SmartAssembly.Engine.Metadata.TypeSpecification.☺(TypeSpecification )
bei SmartAssembly.Engine.Metadata.TypeSpecification.☺(Object )
bei SmartAssembly.Engine.Metadata.MemberReference`2.☺(ITypeDefOrRefOrSpec , I
TypeDefOrRefOrSpec )
bei SmartAssembly.Engine.Metadata.MemberReference`2.☺(MemberReference`2 )
bei SmartAssembly.Engine.Metadata.MemberReference`2.Equals(Object )
bei System.Collections.Generic.ObjectEqualityComparer`1.Equals(T x, T y)
bei System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
bei System.Collections.Generic.Dictionary`2.TryGetValue(TKey key, TValue& val
ue)
bei SmartAssembly.Engine.Writer.TableDataGenerator.☺(☼ )
bei ♠.↨.☺(Object , MethodBodyWriter )
bei ♠.↨.☺(MethodBodyWriter , ‼ , Object )
bei ♠.↨.☺(MethodBodyWriter , Instruction )
bei ♠.↨.☺(♣ , MethodBodyWriter )
bei ♠.↨.☺(♣& ☻, MethodBody ♥, IDictionary`2 ♦, MethodBodyWriter )
bei ♠.↨.☺(MethodBody ☻, MethodBodyWriter ♥, Dictionary`2& )
bei SmartAssembly.Engine.Writer.TableDataGenerator.☺()
bei ♠.↨.☺ )
bei ♠.↨.☺(FileInfo , IAssembly , ProcessingProjectHelper , IAssemblyWriterOpt
ions )
bei ♠.↨.☺(String ☻, ProcessingProjectHelper ♥, IAssembly ♦, Configuration )
bei SmartAssembly.ProcessingProjectHelper.☻()
--- Ende der internen Ausnahmestapelüberwachung ---
SmartAssembly has encountered an error while running your project.
Failed: SmartAssembly.InformationException: An error occurred while writing the
assembly to disk:
Unable to resolve type System.Collections.Generic.List`1 in assembly System.Coll
ections, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
If you think this is a bug in SmartAssembly, please retry in the GUI and send th
e error to Red Gate. ---> SmartAssembly.Engine.TypeResolutionException: Unable t
o resolve type System.Collections.Generic.List`1 in assembly System.Collections,
Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
bei ♠.↨.☺(TypeReference ☻, TypeDefinition& ♥, Boolean )
bei ♠.↨.☺(TypeReference )
bei SmartAssembly.Engine.Metadata.TypeReference.☺(TypeReference )
Please assist urgently, because our build processes are failing. Many thanks in advance.
Kind regards
Christian Linke
Tagged:
Answers
But this is often the case, because if you build e.g. a WPF exe referencing a .NET Standard project, Visual Studio will never copy the json file from the referenced assembly to output folder of the WPF project. If you now try to build the sa project for the .NET Standard dll located in wpf output folder, you will get the exception. By copying the json manually to this folder, SA is working again.
@Redgate: Can build in a fallback if the json is not there to work with old behavior?
I unfortunately haven't been able to reproduce this yet, but with regard to your question @mrmiagi0101
, I know there was some work done as of 7.4.2 so that if the .deps.json not found, SmartAssembly will do further searching to try to locate it. (There is also a feature request SA-2319 which hasn't been implemented yet, but requests that SmartAssembly point out if the file can't be found and prompt you for the correct location- I've +1'd this with your feedback.)
You can though add the following task to the .csproj file which will copy .deps.json file to the output folder as needed:
If you are still running into a different issue though @clinke, is it possible for you to share you assemblies with us to test with locally? You can send it to support@red-gate.com with subject "Files for SmartAssembly issue #162320"
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?
So sorry for the delay!
I've escalated the issue but we just want to make sure we are understanding the issue correctly. Would it be possible for either of you to share a reproduction to test with?
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?