How to figure out why the symbol is not visible
See original GitHub issueI’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:
- Created 4 months ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
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.
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:
On 12.05.2023 5:37, Stanisław Pitucha wrote: