DllExport icon indicating copy to clipboard operation
DllExport copied to clipboard

Cannot use reference

Open stef-pellegrino opened this issue 4 years ago • 9 comments

Steps to reproduce:

Create C# DLL within a folder TestDll

[DllExport]
public int test() {
  return 0;
}
  • Open VS2019 and Test solution
  • Put"DllExport.bat" in same directory than Test.sln
  • Double click on DllExport.bat
  • Select [Apply]
  • Focus on VS + reload all rebuild gives me : error CS0246: The type or namespace name 'DllExport' could not be found (are you missing a using directive or an assembly reference?)

Click on reference gives me "The proejct cannot be viewed in the object browser because it is not available or not yet build" !??

  • DllExport -version: 1.7.4
  • Used Visual Studio / MSBuild / VS 2019 (Windows 10)

stef-pellegrino avatar Feb 11 '21 00:02 stef-pellegrino

@stef-pellegrino Please copy everything from the Data tab for the selected project in which it was installed.

3F avatar Feb 11 '21 11:02 3F

Same Problem here...has anyone any hint?

zuoyi1025 avatar Feb 26 '21 12:02 zuoyi1025

@zuoyi1025 Please follow the issue template to provide a minimal case info. Log / demo projects are better in a quick inspections. But I didn't even see the requested info from the Data tab.

Note the build must be with diagnostic level. For msbuild, /v:diag or better /bl. Also note the /bl by default collects the source text of project files. See Doc. When configuring use the -debug key.

3F avatar Feb 26 '21 13:02 3F

Same problem. The issue seems to be that RichCodeNav.EnvVarDump is missing? Here's what the package manager output looks like when attempting to add the "DllExport" nuget package:

  GET https://api.nuget.org/v3-flatcontainer/richcodenav.envvardump/index.json
  NotFound https://api.nuget.org/v3-flatcontainer/richcodenav.envvardump/index.json 129ms
NU1101: Unable to find package RichCodeNav.EnvVarDump. No packages exist with this id in source(s): Microsoft Visual Studio Offline Packages, nuget.org
Package restore failed. Rolling back package changes for 'TestPlugin'.
Time Elapsed: 00:00:00.4875334

leculver avatar Apr 19 '21 19:04 leculver

NU1101: Unable to find package RichCodeNav.EnvVarDump.

We do not use RichCodeNav.EnvVarDump. Some of the dependencies in your project requires this. You obviously need configuring package sources, for example via NuGet.config

Please also note we don't provide an official NuGet support for this tool (if something is working, it's working, but for other case please use our official way. Briefly, just click this inside folder where .sln)

3F avatar Apr 19 '21 20:04 3F

Installed: True; 1.7.4+c1cc52f; invoked: 1.7.4
Project type: Cs
Storage: ProjectFiles
Compiler.Platform: Auto
Compiler.ordinalsBase: 1
Compiler.rSysObj: False
Compiler.ourILAsm: False
Compiler.customILAsm: 
Compiler.genExpLib: False
Compiler.peCheck: PeIl
Compiler.patches: None
PreProc.Type: None
PreProc.Cmd: 
PostProc.Type: None
PostProc.ProcEnv: $(SolutionPath);$(MSBuildThisFileFullPath)
PostProc.Cmd: 
SignAssembly: 
Identifier: FEDE8CF5-44B7-41A2-88A4-2D50ED26DE2C
Instance: C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\amd64\MSBuild.exe
Project path: C:\Users\test\source\repos\testdll\testdll\testdll.csproj
Action: Configure
PlatformTarget: AnyCPU
TargetFramework: 
TargetFrameworks: 
TargetFrameworkVersion: v4.5
RootNamespace: testdll
AssemblyName: testdll
MgrArgs: 
MetaLib: tools\raw\lib\net20\DllExport.dll
MetaCor: tools\raw\lib\netstd\DllExport.dll
Proxy: 
StoragePath: .net.dllexport.targets
ddNS: testdll
ddNS max buffer: 500
UseCecil: True
intermediateFiles: False
timeout: 30000
Options: None
RootPath: C:\Users\test\source\repos\testdll\
PkgPath: C:\Users\test\source\repos\testdll\packages\\DllExport.1.7.4\
SlnFile: 
SlnDir: C:\Users\test\source\repos\testdll\
DxpTarget: tools\net.r_eg.DllExport.targets
MsgGuiLevel: -1
LockIfError: 

T35R6braPwgDJKq avatar Dec 17 '21 14:12 T35R6braPwgDJKq

@T35R6braPwgDJKq Please attach at least the log when configuring and/or build log with diagnostic level to inspect the current problem.

C:\Users\test\source\repos\testdll\testdll\testdll.csproj

Attach everything if this is a really empty test project for better help to reproduce the problem locally. Thanks.

3F avatar Dec 17 '21 15:12 3F

Hi in connecting to our other thread, I prepared some logs. You should get it from wetransfer.com to ****@outlook.com

Miedziaq avatar Dec 21 '21 09:12 Miedziaq

I prepared some logs.

@Miedziaq There is no MSB3245: Could not resolve this reference as you mentioned in https://github.com/3F/DllExport/issues/196#issuecomment-998064774

At least this is what I see in your build log.

There is single Error : Invalid Option: /PVP but this is absolutely another problem. Rather because of your mixed incorrect things in .csproj as I said earlier, for example, due to:

<TargetExt>.pvp</TargetExt>
<Target Name="PublishPVP" AfterTargets="RGieseckeDllExport" Condition="Exists($(PdfXEditorPluginDir))">
  <Message Text="=== Publish PVP ... ====================================================" />
  <CreateItem Include="$(OutputPath)$(AssemblyName)$(TargetExt)">
    <Output TaskParameter="Include" ItemName="PvpFilesToCopy" />
  </CreateItem>
  <!--<Copy SourceFiles="@(PvpFilesToCopy)" DestinationFolder="$(PdfXEditorPluginDir)" />-->
  <Message Text="=== Publish PVP ... done ===============================================" />
</Target>

In any case we support only .DLL and .EXE modules. Just consider using our Pre/Post-processing if you need some actions/packing/etc:

  • https://github.com/3F/DllExport/wiki/PreProc
  • https://github.com/3F/DllExport/wiki/PostProc

To all,

Guys! I cannot personally resolve the unknown issues until I receive the minimal info requested earlier. Please also don't fragment information because this could aggregate various unrelated issues between the different stages as you can see above. Also do not distort info as much as possible (please only remove any confidential data).

3F avatar Dec 21 '21 14:12 3F