question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to figure out why the symbol is not visible

See original GitHub issue

I’ve got projects in VS 2022 which try to export a single function through:

        [DllExport("VirtualChannelEntry", CallingConvention.StdCall)]
        public static bool VirtualChannelEntry(ref ChannelEntryPoints entry)

(type in the signature from https://www.codeproject.com/Articles/16374/How-to-Write-a-Terminal-Services-Add-in-in-Pure-C)

I can load up and successfully build the example “DotNetCoreLibrary3” project and the function is exported as expected (checked with dumpbin /exports)

I compared the options I’m using to the example project and set exactly the same options in mine. (checked in the xml configs too)

I’m failing to see the exported symbol in my DLL though. I’ve tried new/clean core 6, standard 2 and framework 4.7 projects and none of them create the export. Tried with both debug and release builds. Each one goes through the configuration correctly and compiles successfully with the [DllExport...] attribute resolving and compiling.

How can I figure out what I’m missing here?

The question is related to:

  • DllExport -version: 1.7.4
  • Copy-paste from Data tab: core 6 project:
Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: Cs
Storage: TargetsFile
Compiler.Platform: Auto
Compiler.ordinalsBase: 1
Compiler.rSysObj: True
Compiler.ourILAsm: True
Compiler.customILAsm: 
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: InfToken
PreProc.Type: None
PreProc.Cmd: 
PostProc.Type: None
PostProc.ProcEnv: $(SolutionPath);$(MSBuildThisFileFullPath)
PostProc.Cmd: 
SignAssembly: 
Identifier: 02C832E4-47BB-4F37-8D40-B4653B9AB783
Instance: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\vi\source\repos\StreamDeckTransport\StreamDeckTransportClientCs\StreamDeckTransportClientCs.csproj
Action: Configure
PlatformTarget: 
TargetFramework: net6.0
TargetFrameworks: 
TargetFrameworkVersion: 
RootNamespace: 
AssemblyName: 
MgrArgs: 
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy: 
StoragePath: .net.dllexport.targets
ddNS: StreamDeckTransportClientCs
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\vi\source\repos\StreamDeckTransport\
PkgPath: C:\Users\vi\source\repos\StreamDeckTransport\packages\\DllExport.1.7.4\
SlnFile: 
SlnDir: C:\Users\vi\source\repos\StreamDeckTransport\
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError: 

framework project:

Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: Cs
Storage: TargetsFile
Compiler.Platform: Auto
Compiler.ordinalsBase: 1
Compiler.rSysObj: True
Compiler.ourILAsm: True
Compiler.customILAsm: 
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: InfToken
PreProc.Type: None
PreProc.Cmd: 
PostProc.Type: None
PostProc.ProcEnv: $(SolutionPath);$(MSBuildThisFileFullPath)
PostProc.Cmd: 
SignAssembly: 
Identifier: A23570A4-FABA-4276-8A46-CD6C084CA478
Instance: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\vi\source\repos\StreamDeckTransport\StreamDeckTransportClientCsFram\StreamDeckTransportClientCsFram.csproj
Action: Configure
PlatformTarget: 
TargetFramework: 
TargetFrameworks: 
TargetFrameworkVersion: v4.7.2
RootNamespace: StreamDeckTransportClientCsFram
AssemblyName: StreamDeckTransportClientCsFram
MgrArgs: 
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy: 
StoragePath: .net.dllexport.targets
ddNS: StreamDeckTransportClientCsFram
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\vi\source\repos\StreamDeckTransport\
PkgPath: C:\Users\vi\source\repos\StreamDeckTransport\packages\\DllExport.1.7.4\
SlnFile: 
SlnDir: C:\Users\vi\source\repos\StreamDeckTransport\
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError: 

Issue Analytics

  • State:open
  • Created 4 months ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
3Fcommented, May 11, 2023

Hello,

Make sure you are looking at a modified dll, not original. For your settings it should be inside x64 and x86 folders $(TargetDir)/x64/*.dll

If not, please attach the build log. Thanks.

1reaction
3Fcommented, May 14, 2023

Better to reconfigure it for x64 if you only need x64. After that, the modified version will be automatically in $(TargetDir) replacing the original which Publish providers use by default.

But if you need both x86 and x64, for example, add the following before </Project> line in .csproj:

<ItemGroup>
   <DllExport86X64 
Include="$(TargetDir)x86\$(TargetFileName);$(TargetDir)x64\$(TargetFileName)" 
PlatformDir="$([System.IO.Directory]::GetParent(%(DllExport86X64.Directory)).Name)\"/>
   <ResolvedFileToPublish Include="@(DllExport86X64)" 
RelativePath="%(PlatformDir)%(Filename)%(Extension)"/>
</ItemGroup>

On 12.05.2023 5:37, Stanisław Pitucha wrote:

🤦 Yes, the x64 directory does contain a file with the correct export. Is there any way I can include that in the published directory as well? It seems that publishing to folder uses the library without the exports in place.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Keyboard is not displaying the correct symbol. e.g. shift2 ...
When I want to type the symbol - at-. Or - inverted commas. They are swopped around. So on my keyboard I press...
Read more >
Symbol not displaying properly [closed]
I would say the only reason your symbol looks weird is because the diacritics (the repeated chars) are not used correctly, otherwise, the...
Read more >
Help with symbol that does not appear - General Discussion
I am working with a file that contains many symbols, but for some reason the linework in ... Select OK and find the...
Read more >
Symbol not showing
I'd try a few things (one at a time) to see which one may have an effect: * Try removing the symbol from...
Read more >
Symbol not visible in Layers panel - qgis
As suggested I tried locking the marker but the after clicking okay the symbol flashes up for a short period then disappears. enter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found