Skip to content

How to figure out why the symbol is not visible #224

Closed
@viraptor

Description

@viraptor

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: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions