3F / DllExport

.NET DllExport with .NET Core support (aka 3F/DllExport aka DllExport.bat)
MIT License
937 stars 131 forks source link

Problem using dotnet4.8 and vs2019 #196

Open Miedziaq opened 2 years ago

Miedziaq commented 2 years ago

Hi, after upgrading dotnet from 4.5.1 to 4.8 i have to switch old one dllexport library to this new one published by You.

i getting this error - library is installed by .bat file from documentation

Severity Code Description Project File Line Suppression State Error The "DllExportAppDomainIsolatedTask" task could not be initialized with its input parameters. grmtAddInPdfXChange
Severity Code Description Project File Line Suppression State Error The "ProcEnv" parameter is not supported by the "DllExportAppDomainIsolatedTask" task loaded from assembly: RGiesecke.DllExport.MSBuild, Version=1.2.7.38851, Culture=neutral, PublicKeyToken=8f52d83c1a22df51 from the path: C:\tectocom.projects\CentrioCLMStandard\LocalClient\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.MSBuild.dll. Verify that the parameter exists on the task, the points to the correct assembly, and it is a settable public instance property. grmtAddInPdfXChange

3F commented 2 years ago

Hello,

library is installed by .bat file from documentation

and

\packages\UnmanagedExports.1.2.7\tools\RGiesecke.DllExport.MSBuild.dll

Make sure you only use our DllExport and not UnmanagedExports.1.2.7 in your solution.

Miedziaq commented 2 years ago

Hello,

thanks for reply, Looks like implicitly not, I cannot found any reference to UnmanagedExports. But i will try something more and then i will post again here

3F commented 2 years ago

I cannot found any reference to UnmanagedExports

You can attach or link .csproj file here to inspect it manually. Please also clarify what version of Visual Studio and DllExport are you trying to use.

Miedziaq commented 2 years ago

Microsoft Visual Studio Professional 2019 Version 16.11.7

`<?xml version="1.0" encoding="utf-8"?>

Debug AnyCPU {E57DC429-0C20-4D3C-927E-5ED0B88C5FB2} Library Properties grmtAddInPdfXChangeLoader grmtAddInPdfXChangeLoader .pvp v4.8 512 true false DEBUG C:\Temp\Tectocom\LocalClient\VersionIndependent\PdfXChange\ False .\DllExport.dll True True ..\..\LocalInteropBinaries\PdfXChange\Interop.PDFXEditCore.x64.dll True True True Resources.resx ResXFileCodeGenerator Resources.Designer.cs if exist "$(SolutionDir)AppLocal\grmtAddInPdfXChange\bin\$(ConfigurationName)\" ( xcopy /i /d /s /y /c "$(SolutionDir)AppLocal\grmtAddInPdfXChange\bin\$(ConfigurationName)\grmtAddInPdfXChange.dll" "$(ProjectDir)Resources\" xcopy /i /d /s /y /c "$(SolutionDir)AppLocal\grmtAddInPdfXChange\bin\$(ConfigurationName)\NLog.dll" "$(ProjectDir)Resources\" xcopy /i /d /s /y /c "$(SolutionDir)AppLocal\grmtAddInPdfXChange\bin\$(ConfigurationName)\de\grmtAddInPdfXChange.resources.dll" "$(ProjectDir)Resources\" ) if exist "$(OutDir)grmtAddInPdfXChange.dll" ( xcopy /i /d /s /y /c "$(OutDir)grmtAddInPdfXChange.dll" "$(ProjectDir)Resources\" xcopy /i /d /s /y /c "$(OutDir)NLog.dll" "$(ProjectDir)Resources\" xcopy /i /d /s /y /c "$(OutDir)de\grmtAddInPdfXChange.resources.dll" "$(ProjectDir)Resources\" ) A7A46357-D823-4E30-8CF4-018A24942AB0 DllExport.dll grmtAddInPdfXChangeLoader false x86 1 true true true false 30000 2 3 0 0 $(SolutionDir)packages\DllExport.1.7.4\gcache\$(DllExportMetaXBase)\$(DllExportNamespace)\$(DllExportMetaLibName) False False `
3F commented 2 years ago

Remove this line:

<Import Project="../../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets" Condition="Exists('../../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets')" />

+Since your project file uses different types of packages, you can optionally update packages.config manually if the NuGet manager doesn't want to display it for some reason.

Miedziaq commented 2 years ago

thanks for fast reply.

after Your suggestion i got locally : Error : Invalid Option: /PVP grmtAddInPdfXChangeLoader

pvp extension is plugin extension for pdfXchangePro. it was working with old one gisecke dll export and older .net without a problems

on TFS build

2021-12-20T13:58:21.3455274Z "C:\build_agent_1_work\281\s\LocalClient.sln" (default target) (1) -> 2021-12-20T13:58:21.3455671Z "C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj" (default target) (82) -> 2021-12-20T13:58:21.3456046Z (ResolveAssemblyReferences target) -> 2021-12-20T13:58:21.3456647Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DllExport". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3457946Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3243: No way to resolve conflict between "DllExport, Version=1.7.4.0, Culture=neutral, PublicKeyToken=8337224c9ad9e356" and "DllExport". Choosing "DllExport, Version=1.7.4.0, Culture=neutral, PublicKeyToken=8337224c9ad9e356" arbitrarily. [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3459023Z 2021-12-20T13:58:21.3459271Z 2021-12-20T13:58:21.3459626Z "C:\build_agent_1_work\281\s\LocalClient.sln" (default target) (1) -> 2021-12-20T13:58:21.3460073Z "C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj" (default target) (82) -> 2021-12-20T13:58:21.3460500Z (CoreCompile target) -> 2021-12-20T13:58:21.3461072Z CSC : error CS1747: Cannot embed interop types from assembly 'DllExport, Version=1.7.4.0, Culture=neutral, PublicKeyToken=8337224c9ad9e356' because it is missing the 'System.Runtime.InteropServices.GuidAttribute' attribute. [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3462338Z CSC : error CS1759: Cannot embed interop types from assembly 'DllExport, Version=1.7.4.0, Culture=neutral, PublicKeyToken=8337224c9ad9e356' because it is missing either the 'System.Runtime.InteropServices.ImportedFromTypeLibAttribute' attribute or the 'System.Runtime.InteropServices.PrimaryInteropAssemblyAttribute' attribute. [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3463680Z C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\EntryPoint.cs(26,10): error CS0246: The type or namespace name 'DllExportAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3464418Z C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\EntryPoint.cs(26,10): error CS0246: The type or namespace name 'DllExport' could not be found (are you missing a using directive or an assembly reference?) [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3465802Z C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\EntryPoint.cs(26,38): error CS0246: The type or namespace name 'CallingConvention' could not be found (are you missing a using directive or an assembly reference?) [C:\build_agent_1_work\281\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj] 2021-12-20T13:58:21.3466289Z

3F commented 2 years ago

How it was added?

    <Reference Include="DllExport, Version=1.7.4.29858, Culture=neutral, PublicKeyToken=8337224c9ad9e356, processorArchitecture=MSIL">
      <SpecificVersion>False</SpecificVersion>
      <HintPath>.\DllExport.dll</HintPath>
      <Private>True</Private>
      <EmbedInteropTypes>True</EmbedInteropTypes>
    </Reference>

Delete it! and please completely reinstall everything using DllExport.bat (it can also be executed automatically using NuGet installation)

What's more important,

Could you please clarify the installation method because your project file has mixed incorrect elements and I'm not sure how it came to this.

Miedziaq commented 2 years ago

yea, this one reference i added because of this errors in tfs build says : Problem resolving dllimport.dll

doesnt nuget installation broken ??

3F commented 2 years ago

doesnt nuget installation broken ??

Technically it's not a broken. Officially, this project supports only own manager without a guarantee for nuget. But for nuget (in most default cases) it can also try run(1.7+)&restore this automatically without a problem.

*That is, in general, there is no difference since sooner or later our manager will take over control even if it was a nuget initially. *2 To be more clear, auto-restore may work without a nuget in any case because of GetNuTool core implementation.

Miedziaq commented 2 years ago

i cleaned up the csproject and so on from unmanaged exports, and all other dllexport, on clean project i installed it from nuget, using the same .bat settings like on screen in documentation. I Used namespace of project. Import works, attributes works but on tfs build still the same.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2203,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "DllExport". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\build_agent_2_work\176\s\AppLocal\grmtAddInPdfXChangeLoader\grmtAddInPdfXChangeLoader.csproj]

it was crazy..

3F commented 2 years ago

MSB3245: Could not resolve this reference. Could not locate the assembly "DllExport".

Looks like a duplicate of #184.

on clean project i installed it from nuget, using the same .bat settings like on screen in documentation.

  1. I need log when configuring. Open console and type DllExport > cfg.log, click apply.
  2. I need updated .csproj and/or log when build with diagnostic level.
  3. It may also be helpful to look at generated packages\DllExport.1.7.4\gcache

Please continue in #184