-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Using DllExport from the command line compiler #28
Comments
No. DllExport.dll is only as a marker for your code and actually has no any logic at all. This feature works via executable ILAsm (my version here) that contains special logic to prepare final PE file. // logic of definition of records into EXPORT_DIRECTORY (see details from PE format)
HRESULT Assembler::CreateExportDirectory()
{
...
IMAGE_EXPORT_DIRECTORY exportDirIDD;
...
EATEntry *pEATE;
unsigned i, L, ordBase = 0xFFFFFFFF, Ldllname; where pEATE will contain list of your prepared methods like this: for(WORD j = 0; (pMD = pClass->m_MethodList.PEEK(j)); j++)
{
...
EATEntry* pEATE;
/*
struct EATEntry
{
DWORD dwStubRVA;
DWORD dwOrdinal;
char* szAlias;
};
*/
...
m_EATList.PUSH(pEATE); The DllExport only controls all these processes via MSBuild What problem you're trying to solve ? Use latest portable & embeddable gnt /p:ngpackages="DllExport" etc. side note.., from my msg:
|
Thanks for your answer. The problem I'm trying to solve is simple: I like the fact that most of my published C# application/code can be compiled by anyone on Win7+ (any Windows OS with a decent .Net framework) without the need for VisualStudio. So I always provide with the csc.exe command line such that anyone can get its own compiled version of my app. So it seems it's not feasible if I want to use DllExport functionalities ? Unless there's also a command line to trigger the whole work performed by DllExport on the PE file ? |
DllExport is ready for CI ! and works with most popular build-servers like Teamcity, AppVeyor, etc. So why you do not want to use msbuild for build your projects ? if you still need to call it manually, see msbuild task here: For direct modifications without DllExport: first you need to modify your IL code - how, you can look this repo. |
Hi,
I'm using DllExport Nuget package within Visual Studio and it works just great.
However, I was wondering how (if possible) to get the same result using only command line compiler such as csc.exe. Of course, I can add the /reference:path_to_dll_export.dll and the cs files will compile just fine, but the resulting DLL doesn't actually export any function. I guess that's because the DllExport magic happens after compilation by modifying the export section of the IL... (I barely understand this part).
So, does it sound feasible ?
Thanks,
Arno
The text was updated successfully, but these errors were encountered: