Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Unresolved assembly reference not allowed: System.Drawing.Common #72

Open
Logerfo opened this issue Sep 30, 2019 · 6 comments
Open

Unresolved assembly reference not allowed: System.Drawing.Common #72

Logerfo opened this issue Sep 30, 2019 · 6 comments

Comments

@Logerfo
Copy link
Contributor

Logerfo commented Sep 30, 2019

I'm trying to merge a .NET Core 3.0 Windows Forms app.

An exception occurred during merging:
Unresolved assembly reference not allowed: System.Drawing.Common.
at System.Compiler.Ir2md.GetAssemblyRefIndex(AssemblyNode assembly)
at System.Compiler.Ir2md.GetTypeRefIndex(TypeNode type)
at System.Compiler.Ir2md.VisitReferencedType(TypeNode type)
at System.Compiler.Ir2md.VisitMethod(Method method)
at System.Compiler.Ir2md.Visit(Node node)
at System.Compiler.Ir2md.VisitClass(Class Class)
at System.Compiler.Ir2md.Visit(Node node)
at System.Compiler.Ir2md.VisitModule(Module module)
at System.Compiler.Ir2md.SetupMetadataWriter(String debugSymbolsLocation)
at System.Compiler.Ir2md.WritePE(Module module, String debugSymbolsLocation, BinaryWriter writer)
at System.Compiler.Writer.WritePE(String location, Boolean writeDebugSymbols, Module module, Boolean delaySign, String keyFileName, String keyName)
at System.Compiler.Writer.WritePE(CompilerParameters compilerParameters, Module module)
at System.Compiler.Module.WriteModule(String location, CompilerParameters options)
at ILMerging.ILMerge.Merge()
at ILMerging.ILMerge.Main(String[] args)

@mike-barnett
Copy link
Contributor

You need to provide the paths to all of the input (directly or indirectly referenced) assemblies. Please see Section 2.20 in the manual. If that doesn't fix it, then please repost your problem.

@Logerfo
Copy link
Contributor Author

Logerfo commented Sep 30, 2019

Alright, I did that, then I got the same error for another dependency. I supposed I must do all that for every single one of them, but it seems unpractical to me:

$(ILMergeConsolePath) /ndebug /lib:$(NuGetPackageRoot)/system.drawing.common/4.5.1/runtimes/win/lib/netcoreapp2.0 /out:...

Isn't there a recursive search path or something like that?

@mike-barnett
Copy link
Contributor

Hmm, a recursive search path would probably have been a good idea! But you probably can just use the output directory of the projects that you are merging. I would think the nuget packages would all have resulted in the assemblies being copied to the output directory. Or is that not the case?

@Logerfo
Copy link
Contributor Author

Logerfo commented Sep 30, 2019

You're right, that's the case. It's better, but recursive would be best.

@mike-barnett
Copy link
Contributor

Possibly: it is also likely that an overly broad search could find lots of competing versions of the same assembly and it would be difficult to know which one is the right one unless you load all of them.

@Logerfo
Copy link
Contributor Author

Logerfo commented Sep 30, 2019

I would think the nuget packages would all have resulted in the assemblies being copied to the output directory.

Not everything, tho. NETCore.App and NETCore.WindowsDesktop stuff doesn't.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants