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

NuGet: Strange Namespace and no *.lib generated #33

Closed
ArgusMagnus opened this issue May 4, 2017 · 10 comments
Closed

NuGet: Strange Namespace and no *.lib generated #33

ArgusMagnus opened this issue May 4, 2017 · 10 comments
Labels
Milestone

Comments

@ArgusMagnus
Copy link

Hi

I have installed the NuGet package (v1.5.2) to an .NET 4.6.1 library Project. There are two issues:

  1. The DllExportAttribute resides in a very strange Namespace: "D3F00FF1770DED978EC774BA389F2DC901F4.B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.C00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.E00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"

  2. When I build the Project (x64) no *.lib is generated which can be linked by my C++ lib

@OmegaExtern
Copy link

You have to unload the project, and open it again (or simply restart Visual Studio).
This is a known issue, and has been discussed previously. Also see #14.

@3F
Copy link
Owner

3F commented May 5, 2017

@ArgusMagnus

  1. ddNS feature that should update this sequence after installation.
  2. You should define property $(DllExportGenExpLib = true) to activate this feature because it disabled by default.

Probably you have some errors when install our package, because you should see this:

Or you should define this manually like:

<DllExportNamespace>System.Runtime.InteropServices</DllExportNamespace>
<DllExportDDNSCecil>true</DllExportDDNSCecil>
<DllExportOrdinalsBase>1</DllExportOrdinalsBase>
<DllExportGenExpLib>true</DllExportGenExpLib>
<DllExportOurILAsm>false</DllExportOurILAsm>
...

Thus, for clarify please provide detailed log when you install this - for VS IDE:

  • Tools - Options - Project and Solutions - Build and Run - MSBuild project build verbosity

For msbuild.exe:

  • /v:diag

@ArgusMagnus
Copy link
Author

ArgusMagnus commented May 11, 2017

That Dialog never showed up.

msbuild_log.txt

Where should I put:

<DllExportNamespace>System.Runtime.InteropServices</DllExportNamespace>
<DllExportDDNSCecil>true</DllExportDDNSCecil>
<DllExportOrdinalsBase>1</DllExportOrdinalsBase>
<DllExportGenExpLib>true</DllExportGenExpLib>
<DllExportOurILAsm>false</DllExportOurILAsm>

I tried the first propertygroup in the csproj file, which had no effect.

Edit: Ok, the namespace issue is fixed by adding the above elements and the following line to the csproj file:
<Import Project="$(NuGetPackageRoot)dllexport\1.5.2\tools\net.r_eg.DllExport.targets" Condition="Exists('$(NuGetPackageRoot)dllexport\1.5.2\tools\net.r_eg.DllExport.targets')" />

But the issue that no *.lib is generated remains..

This might be the source of the problem:

3>DllExportMod:
3>  Cannot find lib.exe in 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\\..\..\VC\bin'.

I can find lib.exe in 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.10.25017\bin\HostX64\x64'

@3F 3F added the bug label May 11, 2017
@3F
Copy link
Owner

3F commented May 11, 2017

That Dialog never showed up.

seems you have problem with installing, thus please also provide log when you install this package (see from Output).

Current package uses init.ps1 & install.ps1 powershell scripts by nuget

It can be related for #36, but I haven't seen any similar problem for both new VS versions:

  • VisualStudio.15.Release/15.2.0+26430.4
  • VisualStudio.15.Preview/15.3.0-Preview+26507.0

that is, the install.ps1 has been obsolete already for VS 14.0 (at least, as I remember) and recommended \build\... targets instead (as for my other packages e.g.: \build\native\ or \build\net\).

issue is fixed by adding the above elements ... <Import Project="...

yes, this line should be automatically added after install.ps1 or \build\xxx\xxx.targets. This is required for DllExport anyway.

Cannot find lib.exe

The new VS 2017 contains major changes with its environment (+hMSBuild), so I know what's going on <_< thanks for notice.

Temporarily try to redefine this:

<installationPath>\<Version>\<Edition>\VC\Tools\MSVC\<Version>\bin\<HostTarget>\<Arch>

for example:

<DllExportLibToolPath>$(DevEnvDir)..\..\VC\Tools\MSVC\14.11.25301\bin\HostX86\x86</DllExportLibToolPath>

For all: I've plan to consider this project to the end of this month or early (as soon as possible for my time)

@ArgusMagnus
Copy link
Author

Sorry for responding so late, I only work once a week on the project I use DllExport.

Package Manager Output:

Successfully installed 'DllExport 1.5.2' to MyProject
Executing script file 'C:\Users\automation\.nuget\packages\dllexport\1.5.2\tools\init.ps1'...
The names of some imported commands from the module 'DllExportCmdLets' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
Executing nuget actions took 2.51 sec
Time Elapsed: 00:00:02.7435282
========== Finished ==========

@3F
Copy link
Owner

3F commented May 18, 2017

@ArgusMagnus

yes, yes, only init.ps1 that's related for #36
thanks for information

by the way, it still works for me (VisualStudio.15.Release/15.2.0+26430.6):

....
Executing script file 'D:\tmp\2017\ConsoleApp1\packages\DllExport.1.5.2\tools\init.ps1'...
The names of some imported commands from the module 'DllExportCmdLets' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb.
Executing script file 'D:\tmp\2017\ConsoleApp1\packages\DllExport.1.5.2\tools\install.ps1'...
set new namespace(Cecil: True): (ConsoleApp1) - (D:\tmp\2017\ConsoleApp1\packages\DllExport.1.5.2\lib\net20\DllExport.dll)
....

so, what your build version of VS15 for clarify ? (Help - About - [Copy Info] - first 3 lines)

@ArgusMagnus
Copy link
Author

Microsoft Visual Studio Enterprise 2017
Version 15.2 (26430.6) Release
VisualStudio.15.Release/15.2.0+26430.6

@3F
Copy link
Owner

3F commented May 19, 2017

thanks,
anyway I've plan to change this obsolete variant soon :) +PackageReference

for today, please configure this manually (see above) if anyone else have this problem.

@ArgusMagnus
Copy link
Author

Ok, thanks

@3F 3F added this to the v1.5.3 milestone Jun 3, 2017
@3F
Copy link
Owner

3F commented Aug 20, 2017

I closed this issue because of new Wizard for v1.6+ versions. You already can test it via our beta releases:

If you still have a some related problems, please create new issue for new planned Wizard.

@3F 3F closed this as completed Aug 20, 2017
@3F 3F modified the milestones: v1.6, v1.5.3 Aug 20, 2017
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

3 participants