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

Still not getting a .lib #44

Closed
jpc2 opened this issue Jul 23, 2017 · 7 comments
Closed

Still not getting a .lib #44

jpc2 opened this issue Jul 23, 2017 · 7 comments
Labels

Comments

@jpc2
Copy link

jpc2 commented Jul 23, 2017

Edit: Never mind.... I found it. Now to see if I can get FORTRAN to talk to to.

Trying to get a C# project set up so I can call it from a FORTRAN program. Really!

Tried about everything I could here including installing the 8f75a86 build. Still no .lib file.
New to VS2017 so it takes a bit to figure out where things are. And last did any thing if VS years ago.

Microsoft Visual Studio Professional 2017
Version 15.2 (26430.16) Release
VisualStudio.15.Release/15.2.0+26430.16
Microsoft .NET Framework
Version 4.7.02046
Installed Version: Professional
Visual Basic 2017 00369-60000-00001-AA283
Microsoft Visual Basic 2017
Visual C# 2017 00369-60000-00001-AA283
Microsoft Visual C# 2017
Visual C++ 2017 00369-60000-00001-AA283
Microsoft Visual C++ 2017

@jpc2 jpc2 closed this as completed Jul 24, 2017
@jpc2
Copy link
Author

jpc2 commented Jul 26, 2017

Well it worked for a bit. Then I changed something and now it doesn't. The lib.exe problem is due to not having the correct path - I know that much. I may have manually patched it before.

Unloaded the 8f75a86 build and reloaded it. Here is the config.
dllexport_config

Builds are set for 'Any CPU', When I build I get this error.

error : Failed to define security permission set for 0x20000001 VistaTGDReader C:\TTCI_Work\Vista_TGD_dev\VistaTGDReader\packages\DllExport.1.5.2\tools\net.r_eg.DllExport.targets 47

I stopped VisualStudio and restarted after the install of DllExport.
Besides the error above, lib.exe is not being found.

Here is the diagnostic build output. Maybe it will help.
build_log.txt

@jpc2 jpc2 reopened this Jul 26, 2017
@3F
Copy link
Owner

3F commented Jul 26, 2017

The 0x20000001 is known problem #19 (comment)
Uncheck Use our IL Assembler option (msbuild property DllExportOurILAsm = false) if you're using SecurityPermission in your assembly.

About lib.exe it's strange because I see paths to VsDevCmd & vcvarsall from your log:

1>Set Property: DllExportVsDevCmd=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\Tools\VsDevCmd.bat
1>Set Property: DllExportVcVarsAll=C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\vcvarsall.bat;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat

it's required by new env VS2017 to get final path like <installationPath>\<Version>\<Edition>\VC\Tools\MSVC\<Version>\bin\<HostTarget>\<Arch> - #37

Please also note, the message Cannot find lib.exe in '...' irrelevant after 8f75a86 because now it just means that we can't find it through obsolete method :) I forget about this msg, so I'll change it later.

What we to do... I can prepare later special build with markers to isolate your problem because it's not reproduced for me.

Then I changed something and now it doesn't.

It would be great to remember something :)

But if you already have configured debug of our project, you can check this place:

private int RunLibTool(CpuPlatform cpu, string fileName, string directory)

@3F 3F added the bug label Jul 26, 2017
@jpc2
Copy link
Author

jpc2 commented Jul 26, 2017

@3F Thanks for the reply.
It was the ILAsm setting. I have not specifically set SecurityPermissions . And for this don't need them set. Just trying to build a simple data file reader dll for files with an XML header. Any clue on where it is being set?

I unloaded and reloaded the DllExport package and it works again. Both x64 and X86 have the .dll and .lib files now.

@3F
Copy link
Owner

3F commented Jul 26, 2017

@jpc2

Did you try with DllExportOurILAsm = false ?

Can you also give some trivial sample of demo project etc. to reproduce your case with 0x20000001 ? because it should be exactly here - https://github.com/3F/coreclr/blob/master/src/ilasm/assembler.cpp#L2263

I unloaded and reloaded the DllExport package and it works again. Both x64 and X86 have the .dll and .lib files now.

That is, you can't reproduce this anymore ? or it still after some time ?

3F added a commit that referenced this issue Aug 12, 2017
* NEW: The new lightweight manager & distribution via MvsSln & GetNuTool projects. Issue #38.
       Based on hMSBuild logic and includes GetNuTool core.

       Now you shouldn't use standard nuget clients anymore:
       https://www.youtube.com/watch?v=okPThdWDZMM

       Package from nuget.org already contains this, but you can also get it directly.
       Latest version: https://raw.githubusercontent.com/3F/DllExport/latest/manager/DllExport.bat
       ~18 Kb text-based embeddable batch-scripts that does not require powershell and dotnet-cli.

       To install/uninstall or to reconfigure your projects: `DllExport -action Configure`
       To manually restore package: `DllExport -action Restore`
       All available features: `DllExport -h`

       Server by default - nuget.org

* NEW: The new Wizard (configurator via MvsSln). To easy configure your projects in any place. Issue #38.
       MvsSln v1.0.1.43422: https://github.com/3F/MvsSln

* NEW: Added support of global namespaces - Issue #47.
       Use `Direct-Mod` if Cecil will not process this correctly.

* FIXED: Fixed target platform detection. Issue #34.
         Details: #34 (comment)

* FIXED: Fixed problem when the Post-Build event is triggered before our tool. Issue #35.
         Use this if still is needed:
         ```
         <Target Name="PostBuildEventBeforeDllExport" BeforeTargets="DllExportMod">
            ...
         </Target>
         ```

* FIXED: Fixed generation of exp + .lib via MS Library Manager for VS2017. Issue #37.
         Now it also includes processing through VsDevCmd & VcVarsAll initializer scripts.
         Use the folowing msbuild properties to override values by default:
         * $(DllExportVcVarsAll); $(DllExportVsDevCmd)

* FIXED: Fixes possible problem with multiple properties that contains *Undefined* word,
         e.g.: *Undefined*\path1;C:\path2 ...

* CHANGED: Added information about finding lib tool. Issue #44.
* CHANGED: UI. Selected platform now affects to all configurations of project instead of active as before.
* CHANGED: Now, nuget package does not contain library in `lib/.../` Details in #36.
* CHANGED: Now, we also distribute .zip package for work through our manager etc.
           https://github.com/3F/DllExport/releases

           The latest text-based manager you can find here:
           https://raw.githubusercontent.com/3F/DllExport/latest/manager/DllExport.bat
           Illustration here: https://www.youtube.com/watch?v=okPThdWDZMM
@3F 3F added this to the v1.6 milestone Aug 20, 2017
@3F
Copy link
Owner

3F commented Aug 20, 2017

@jpc2 I need details, Please also check it with latest v1.6 beta2 release:

@3F
Copy link
Owner

3F commented Oct 27, 2017

I closed this, because I can't reproduce this problem and still have no any new details about this.

Reopen if it's reproduced for v1.6-beta3+ releases (together with detailed log).

Please also note: For Visual Studio 15' you should use MSBuild v15+ because the old versions can't populate all required properties because of new API. For example, v14.0.25420.1 may cause this error for VS2017 projects:

lib tool via LibToolDllPath: -1
Export warning EXP0014: RunIlAsm: An error occurred while calling lib.exe: ...

etc.

For this case I recommend to use - hMSBuild

@3F 3F closed this as completed Oct 27, 2017
@3F 3F added unclear and removed bug labels Oct 27, 2017
@3F 3F removed this from the v1.6 milestone Oct 27, 2017
3F added a commit that referenced this issue Dec 29, 2017
* NEW: The new embeddable lightweight manager for distribution via MvsSln & GetNuTool projects. Issue #38.
       Based on hMSBuild logic and includes GetNuTool core v1.6.1.

       Now you shouldn't use standard nuget clients anymore:
       https://www.youtube.com/watch?v=9bYgywZ9pPE

       Quick start: https://www.youtube.com/watch?v=sBWt-KdQtoc
        ==============================
        DllExport -action Configure
        ==============================

       Package from nuget.org already contains manager, but you can also get it directly.
       Latest manager: https://3F.github.io/DllExport/releases/latest/manager/
       ~18 Kb text-based embeddable batch-script that does not require powershell and dotnet-cli.

       Automatic restoring still is available but you can also use: `DllExport -action Restore`
       All available features: `DllExport -h`

       Direct links to remote package (without nuget server) via `-pkg-link {uri}` key. Issue #53.
       NuGet Server by default: nuget.org.

* NEW: The new Wizard (configurator via MvsSln). To easy configure your projects in any place. Part of Issue #38.
       MvsSln v2.0: https://github.com/3F/MvsSln

* NEW: Added support of empty/global namespaces - Issue #47.
       Use `Direct-Mod` if Cecil will not process this correctly.

* NEW: Implemented another storage for configuration: '.net.dllexport.targets'. Issue #49.

* NEW: New settings for configurator (Wizard):
        * Path to custom ILAsm.
        * Flag to keep intermediate Files (IL Code, Resources, ...).
        * Timeout of execution in milliseconds.

* NEW: Implemented automatic checking existence of a correct exported proc via Conari. Issue #55.
       Wizard controls it via `$(DllExportPeCheck)`:
        * 0x01 bit - Will check count of all planned exports from final PE32/PE32+ module.
        * 0x02 bit - Will check existence of all planned exports (IL code) in actual PE32/PE32+ module.

* NEW: Implemented PE32/PE32+ Viewer to check manually available exports from final modules. Issue #55.
       New key for manager:
        ```
        -pe-exp-list {module} - To list all available exports from PE32/PE32+ module.
        ```

        Sample:
        ```
        DllExport -pe-exp-list bin\Debug\regXwild.dll
        ```

* FIXED: Fixed target platform detection. Issue #34.
         Details: #34 (comment)

* FIXED: Fixed problem when the Post-Build event is triggered before our tool. Issue #35.
         Use this if still is needed:
         ```
         <Target Name="PostBuildEventBeforeDllExport" BeforeTargets="DllExportMod">
            ...
         </Target>
         ```

* FIXED: Fixed generation of exp + .lib via MS Library Manager for VS2017. Issue #37.
         Now it also includes processing through VsDevCmd & VcVarsAll initializer scripts.
         Use the folowing msbuild properties to override values by default:
         * $(DllExportVcVarsAll); $(DllExportVsDevCmd)

* FIXED: Fixes possible problem with multiple properties that contains *Undefined* word,
         e.g.: *Undefined*\path1;C:\path2 ...

* CHANGED: Added information about finding lib tool. Issue #44.

* CHANGED: UI. Selected platform now affects to all configurations of project instead of active as before.

* CHANGED: Now nuget package does not contain library in `lib/.../` Details in #36.

* CHANGED: Now we also distribute .zip package for work through our manager etc.
           https://github.com/3F/DllExport/releases

* NOTE: How to avoid EXP0014: RunIlAsm. The library manager still cannot be found.
        https://www.youtube.com/watch?v=zUejJ4vUPGw
        Related Issue #44

* NOTE: Quick start (Configuring, Automatic restoring, Pe-Viewer):
        https://www.youtube.com/watch?v=sBWt-KdQtoc

* NOTE: The latest text-based manager:
        https://3F.github.io/DllExport/releases/latest/manager/

           Other versions you can find from GitHub Releases:
           * https://github.com/3F/DllExport/releases

           Or get it from nuget packages starting with v1.6+

* NOTE: PE-features via Conari v1.3.0 https://github.com/3F/Conari

* KNOWN: Bug when - "Build successful but methods are not exported." Issue #59
         For today, anyone else may also try to use https://github.com/3F/Conari to avoid similar @Genteure's problem.

* DIFF(v1.6-RC):

    * FIXED: Wizard. Fixed incorrect layout for zh_CN Simplified Chinese (Thanks @Genteure). Issue #61
    * FIXED: Fixes automatic restoring the package via msbuild. Issue #62
@3F
Copy link
Owner

3F commented Dec 29, 2017

How to avoid EXP0014: RunIlAsm. The library manager still cannot be found.:

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