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

ILMerge operation #182

Closed
JackKuo-tw opened this issue Jan 8, 2021 · 9 comments
Closed

ILMerge operation #182

JackKuo-tw opened this issue Jan 8, 2021 · 9 comments
Labels

Comments

@JackKuo-tw
Copy link

JackKuo-tw commented Jan 8, 2021

Hi,

I'm unable to merge my dll EZreceiptDll2.dll with Newtonsoft.Json.dll.
Is there any detail I missed?

Here is my options:

Screen Shot 2021-01-08 at 4 45 25 PM

Here is my ILMerge configuration:
(BTW, I'm not very sure what to write down in this textarea)

Screen Shot 2021-01-08 at 4 45 15 PM


Information from Data tab:

Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: Cs
Storage: ProjectFiles
Compiler.Platform: x86
Compiler.ordinalsBase: 1
Compiler.rSysObj: False
Compiler.ourILAsm: False
Compiler.customILAsm: 
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: None
PreProc.Type: ILMerge, DebugInfo, IgnoreErr
PreProc.Cmd: Newtonsoft.Json.dll EZreceiptDll2.dll
PostProc.Type: Predefined, DependentX86X64, SeqDependentForSys
PostProc.ProcEnv: $(SolutionPath);$(MSBuildThisFileFullPath);TargetDir
PostProc.Cmd: ...
SignAssembly: 
Identifier: 5F0765BA-6964-4A7D-AC90-D7DD394FC718
Instance: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\jackkuo\Desktop\EZreceiptDll2\EZreceiptDll2.csproj
Action: Configure
PlatformTarget: x86
TargetFramework: 
TargetFrameworks: 
TargetFrameworkVersion: v4.7.2
RootNamespace: EZreceiptDll2
AssemblyName: EZreceiptDll2
MgrArgs: -action Configure
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy: 
StoragePath: .net.dllexport.targets
ddNS: System.Runtime.InteropServices
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\jackkuo\Desktop\EZreceiptDll2\
PkgPath: C:\Users\jackkuo\Desktop\EZreceiptDll2\packages\\DllExport.1.7.4\
SlnFile: 
SlnDir: C:\Users\jackkuo\Desktop\EZreceiptDll2\
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError: 
@3F
Copy link
Owner

3F commented Jan 8, 2021

I'm not very sure what to write down in this textarea

The list of modules (.exe, .dll) separated by a whitespace char to be merged with the main module in the selected EZreceiptDll2 project.

For your case, only Newtonsoft.Json.dll is needed in this list. Remove EZreceiptDll2.dll then try again.

@JackKuo-tw
Copy link
Author

Thanks for your explanation!

If I only write down Newtonsoft.Json.dll, it shows the error message while compiling:

C:\Users\jackkuo\Desktop\EZreceiptDll2\Class1.cs(16707566) : error : syntax error at token '-' in:     IL_0027:  ldc.r8     -inf	EZreceiptDll2			

But I'm pretty sure my code in Class1.cs is right. 🤔

@3F
Copy link
Owner

3F commented Jan 8, 2021

error : syntax error at token '-' in: IL_0027: ldc.r8 -inf

#128
Your case requires Inf/-Inf token patching. Activating the related option should help.

@JackKuo-tw
Copy link
Author

@3F Thank you~ It works!
Sorry for not knowing how to find this problem via the keyword "inf".
This project is so nice and your reply is so fast 🥰

Although I've written a Chinese post about this 1 year ago, I think it's time to write a more detailed one to promote this project :)

@3F
Copy link
Owner

3F commented Jan 8, 2021

@3F Thank you~ It works!

Good! Nice to hear that everything works well

This project is so nice and your reply is so fast 🥰

I am trying :) https://twitter.com/github3F/status/1343482999766200320

Although I've written a Chinese post about this 1 year ago, I think it's time to write a more detailed one to promote this project :)

Thank you! This is a good article!
Because sometimes I'm watching some really crazy instructions like Install/Uninstall then again Install via NuGet (?). I don't even know where this came from and why it was so hard to just click the .bat file (in 1.7 added automated execution of this .bat for nuget, and seems like it helps better than popup warn in 1.6.x).

Thanks for your interest in my projects!
https://github.com/3F

@3F 3F closed this as completed Jan 8, 2021
@JackKuo-tw
Copy link
Author

@3F
Here is a new step-by-step tutorial blog post in Traditional Chinese. (maybe you could use Google Translate XD)
It's welcome to use my screenshot to write an English version ~

@3F
Copy link
Owner

3F commented Jan 8, 2021

@JackKuo-tw

Good! Just a few clarifications:

.\DllExport.bat -action Configure

the Configure is the default action for 1.6.3+ thus it can be simply omitted. Other commands here.

Also, some specific namespace is not required. I don't know Chinese but it was translated as

"2. Select the corresponding Namespace and use it here ... (need to be introduced separately)"

You can also point to the following important places:

And welcome if you want push some example for python, here https://github.com/3F/Examples/tree/master/DllExport/

Thanks!

@JackKuo-tw
Copy link
Author

the Configure is the default action for 1.6.3+ thus it can be simply omitted. Other commands here.

Thanks! It's helpful.

Also, some specific namespace is not required. I don't know Chinese but it was translated as

You're so patient that really use the translation tool to read my blog 😇

Ok, I understand the namespace & Interop concepts after reading Microsoft docs. (newbie in Window dev)

In my observation, the options contain only 1 namespace and other DllExport built-in namespace, even if there is more than 1 namespace in the project. Is it a bug?

You can also point to the following important places

No problem! The next version must attach it!

And welcome if you want to push some example for Python

Sure, I'm still figuring out how to use ctypes lib.


Actually, there are so many programmers not familiar with English in Taiwan & China, especially those who are 40+ y.o.

I hope my blog can help them to develop more powerful & secure software, even if I'm not in the desktop application development industry (cloud instead).

Thank you very much!

@3F
Copy link
Owner

3F commented Jan 9, 2021

Ok, I understand the namespace & Interop concepts after reading Microsoft docs. (newbie in Window dev)

Wait, I meant only DllExport project. This is specific to its injection and more. While the namespaces are the common practice in many other programming languages just to isolate your space.

It can be also empty to expose the feature using global namespace. And unicode support starting with 1.6.3

In my observation, the options contain only 1 namespace and other DllExport built-in namespace, even if there is more than 1 namespace in the project. Is it a bug?

No. I think you don't need to change anything if you're not sure what to do with it.

Sure, I'm still figuring out how to use ctypes lib.

Use my old example here 3F/regXwild#6 (comment)

I hope my blog can help them to develop more powerful & secure software, even if I'm not in the desktop application development industry (cloud instead).

Wish you success!

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

No branches or pull requests

2 participants