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 Issues - Notifications and Interaction with user #9

Closed
eschatzy opened this issue Sep 9, 2016 · 4 comments
Closed

Build Issues - Notifications and Interaction with user #9

eschatzy opened this issue Sep 9, 2016 · 4 comments

Comments

@eschatzy
Copy link

eschatzy commented Sep 9, 2016

I was able to find a work around for these problems, but it is something that should probably be fixed.

I built my C# project with all the DllExport attributes over each method. There were no build errors or warnings. I tried to access the Dll from the calling project, but no functions were found. After a bit of digging, I found a post that suggested I set the build output to verbose/detailed. I was able to find two problems when building.

Problem 1:

  • Cannot find lib.exe in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE....\VC\bin'.
  • There was no build warning or build error that this was an issue, without using verbose.

Solution 1:

  • Figured out that I need to install the Common Tools for Visual C++ 20xx. (I'm a C# guy, not a C++ guy.)

Problem 2:

  • Skipped method exports, because the platform target is neither x86 nor x64. Set the MsBuild property 'NoDllExportsForAnyCpu' to false if you want to create separate versions for x86 and x64. (e.g. you can do that in the package manager console: Set-NoDllExportsForAnyCpu -value $false)
  • There was no build warning or build error that this was an issue, without using verbose.

Solution 2:

  • Added an x86 solution platform using the Configuration Manager in Visual Studio.

It would be nice if there were some warning or error either during installation or at the time of building a project.

@3F
Copy link
Owner

3F commented Sep 11, 2016

For problem 1:

This is needed to create library.exp & library.lib - that is commonly used by LINK Output in C++ projects

and as you guessed, the DllExport also reproduces this steps for your new library via Microsoft Library Manager (LIB.exe)

i.e. the library that already has been modified by ILAsm + .export directive - look here or here details, how it works.

However, it's optional step. The final library.dll already should have your specified records in export table, and it also will work even via Conari engine.

btw, just noticed that's a good additional solution to solve problem with .net domains. I mean you should know about the "inconvenience" when you need destroy full domain to simply unload a single dll/.net assembly... need to think

But I also see that Robert also checks existence of this tool:

libtool

so it already optional step...

What you need exactly for this ? :) the any message like for problem 0x80070005 that .exp & .lib cannot be created ?

@3F
Copy link
Owner

3F commented Sep 11, 2016

For problem 2:

I also think about some options to interact with user, for example, like I implemented with namespaces:

dynamic_ns

because even if you know about this restriction, you simply may forget about this and then to think... what's going on

@3F 3F changed the title Build Issues Build Issues - Notifications and Interaction with user Sep 24, 2016
3F added a commit that referenced this issue Sep 30, 2016
@3F
Copy link
Owner

3F commented Oct 1, 2016

908a7c2 - I added GUI settings for problem 2:

platform_gui

you can check it from nightly builds before public release

  • x86 + x64 - to get both versions at once

@3F 3F added this to the v1.4 milestone Oct 1, 2016
3F added a commit that referenced this issue Oct 5, 2016
    * FIXED: Fixed bug - `An item with the same key has already been added`. Issue #10
    * FIXED: Bug with Meta library: Incorrect default values. Issue #16
             please note, the __cdecl is the default calling convention for our library
             as and for C and C++ programs.

    * FIXED?: Probably fixed bug - `Script errors on package install` Issue #6
    * FIXED?: Probably fixed bug - `non-English system language - syntax error` Issue #7
    * NEW: GUI Configurator with updated ddNS features.
    * NEW: Implemented feature 'Export for platform': [ x86 / x64 / x86 + x64 ] Issue #9
    * NEW: Implemented feature 'Base for ordinals'. Issue #11
           There is also alternative to configure this number - MSBuild property: DllExportOrdinalsBase

    * NEW: The one (1) now is used by default as Base for all ordinals.
           `Mimic ordinal counter (start from 1 instead of 0)` Issue #8

    * CHANGED: The ddNS features now as binary cmdlet `NSBin`. Use `nsbin.bat` if needed.
    * CHANGED: `Set "Inherited = false" in AttributeUsage for DllExportAttribute`. Issue #15
    * OTHER: other possible changes and fixes.
@3F 3F added the ✔50% label Oct 5, 2016
3F added a commit that referenced this issue Oct 19, 2016
GUI Configurator
+
to configure this via MSBuild property: DllExportGenExpLib
@3F
Copy link
Owner

3F commented Oct 19, 2016

cfg_exp lib

@3F 3F modified the milestones: v1.5, v1.4 Oct 19, 2016
@3F 3F removed the ✔50% label Oct 19, 2016
@3F 3F closed this as completed Oct 19, 2016
3F added a commit that referenced this issue Nov 4, 2016
    * FIXED: Fixed problem with white-space chars in path: `Cannot find path '<any full path with spaces>' because it does not exist ...`
    * FIXED: Fixed typo with fullseq (ddNS) - incorrect `0x30 0x30` ~0x007A7-0x007A8  /details in #14
    * FIXED: Possible problem with NullReferenceException when removing package.
    * FIXED: Fixed problem with old NS data when we try to install package for project A, then for project B
    * NEW: Implemented 'Generate .exp + .lib via MS Library Manager' #9
           GUI Configurator + MSBuild property: `DllExportGenExpLib`

    * NEW: Added support of unmanaged-export for Executable Modules (.exe) #18
    * NEW: Cecil variant for ddNS features /#14, #2
    * NEW: Added our custom IL Assembler as option to fix incorrect 0x13 / 0x11 opcodes. #17
           GUI Configurator + MSBuild property: `DllExportOurILAsm`
           It should help for users of Fody projects, etc.
           Fody/Fody#271

           IlAsm 4.5.1 https://github.com/3F/coreclr
           based on 4.5.22220.0 / coreclr 1.0.4
           changelog of our coreclr for this release: https://github.com/3F/coreclr/blob/master/changelog.txt

    * CHANGED: Updated scripts of installing/removing package for more correct loading of our assemblies.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants