DllExport
DllExport copied to clipboard
Problem using dotnet4.8 and vs2019
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 <UsingTask> points to the correct assembly, and it is a settable public instance property. grmtAddInPdfXChange
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.
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
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.
Microsoft Visual Studio Professional 2019 Version 16.11.7
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <ProjectGuid>{E57DC429-0C20-4D3C-927E-5ED0B88C5FB2}</ProjectGuid> <OutputType>Library</OutputType> <AppDesignerFolder>Properties</AppDesignerFolder> <RootNamespace>grmtAddInPdfXChangeLoader</RootNamespace> <AssemblyName>grmtAddInPdfXChangeLoader</AssemblyName> <TargetExt>.pvp</TargetExt> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion> <FileAlignment>512</FileAlignment> <Deterministic>true</Deterministic> <TargetFrameworkProfile /> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)' == 'Debug'"> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <DefineConstants>DEBUG</DefineConstants> <OutputPath>C:\Temp\Tectocom\LocalClient\VersionIndependent\PdfXChange\</OutputPath> </PropertyGroup> <ItemGroup> <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> <Reference Include="Interop.PDFXEditCore.x64"> <HintPath>..\..\LocalInteropBinaries\PdfXChange\Interop.PDFXEditCore.x64.dll</HintPath> <EmbedInteropTypes>True</EmbedInteropTypes> </Reference> <Reference Include="System" /> <Reference Include="System.ComponentModel.Composition" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> <Reference Include="System.Data.DataSetExtensions" /> <Reference Include="Microsoft.CSharp" /> <Reference Include="System.Data" /> <Reference Include="System.Net.Http" /> <Reference Include="System.Xml" /> </ItemGroup> <ItemGroup> <Compile Include="EntryPoint.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DesignTime>True</DesignTime> <DependentUpon>Resources.resx</DependentUpon> </Compile> </ItemGroup> <ItemGroup> <EmbeddedResource Include="Properties\Resources.resx"> <Generator>ResXFileCodeGenerator</Generator> <LastGenOutput>Resources.Designer.cs</LastGenOutput> </EmbeddedResource> </ItemGroup> <ItemGroup> <None Include="packages.config" /> <None Include="Resources\grmtAddInPdfXChange.dll" /> </ItemGroup> <ItemGroup> <None Include="Resources\NLog.dll" /> </ItemGroup> <ItemGroup> <None Include="Resources\grmtAddInPdfXChange.resources.dll" /> </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <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> <Import Project="../../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets" Condition="Exists('../../packages/UnmanagedExports.1.2.7/tools/RGiesecke.DllExport.targets')" /> <PropertyGroup> <PreBuildEvent>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\" ) </PreBuildEvent> </PropertyGroup> <PropertyGroup> <DllExportIdent>A7A46357-D823-4E30-8CF4-018A24942AB0</DllExportIdent> <DllExportMetaLibName>DllExport.dll</DllExportMetaLibName> <DllExportNamespace>grmtAddInPdfXChangeLoader</DllExportNamespace> <DllExportDDNSCecil>false</DllExportDDNSCecil> <PlatformTarget>x86</PlatformTarget> <DllExportOrdinalsBase>1</DllExportOrdinalsBase> <DllExportGenExpLib>true</DllExportGenExpLib> <DllExportOurILAsm>true</DllExportOurILAsm> <DllExportSysObjRebase>true</DllExportSysObjRebase> <DllExportLeaveIntermediateFiles>false</DllExportLeaveIntermediateFiles> <DllExportTimeout>30000</DllExportTimeout> <DllExportPeCheck>2</DllExportPeCheck> <DllExportPatches>3</DllExportPatches> <DllExportPreProcType>0</DllExportPreProcType> <DllExportPostProcType>0</DllExportPostProcType> </PropertyGroup> <ImportGroup Label=".NET DllExport"> <Import Project="$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets" Condition="Exists($([MSBuild]::Escape('$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets')))" Label="8337224c9ad9e356" /> </ImportGroup> <Target Name="DllExportRestorePkg" BeforeTargets="PrepareForBuild"> <Error Condition="!Exists('$(SolutionDir)DllExport.bat')" Text="DllExport.bat is not found. Path: '$(SolutionDir)' - https://github.com/3F/DllExport" /> <Exec Condition="('$(DllExportModImported)' != 'true' Or !Exists('$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets')) And Exists('$(SolutionDir)DllExport.bat')" Command=".\DllExport.bat -action Restore" WorkingDirectory="$(SolutionDir)" /> <MSBuild Condition="'$(DllExportModImported)' != 'true'" Projects="$(SolutionDir)packages\DllExport.1.7.4\tools\net.r_eg.DllExport.targets" Targets="DllExportMetaXBaseTarget" Properties="TargetFramework=$(TargetFramework)"> <Output TaskParameter="TargetOutputs" PropertyName="DllExportMetaXBase" /> </MSBuild> <ItemGroup> <Reference Include="DllExport, PublicKeyToken=8337224c9ad9e356"> <HintPath>$(SolutionDir)packages\DllExport.1.7.4\gcache\$(DllExportMetaXBase)\$(DllExportNamespace)\$(DllExportMetaLibName)</HintPath> <Private>False</Private> <SpecificVersion>False</SpecificVersion> </Reference> </ItemGroup> </Target> <Target Name="DllExportRPkgDynamicImport" BeforeTargets="PostBuildEvent" DependsOnTargets="GetFrameworkPaths" Condition="'$(DllExportModImported)' != 'true' And '$(DllExportRPkgDyn)' != 'false'"> <MSBuild BuildInParallel="true" UseResultsCache="true" Projects="$(MSBuildProjectFullPath)" Properties="DllExportRPkgDyn=true" Targets="Build" /> </Target> </Project>
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.
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
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.
yea, this one reference i added because of this errors in tfs build says : Problem resolving dllimport.dll
doesnt nuget installation broken ??
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.
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..
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.
- I need log when configuring. Open console and type
DllExport > cfg.log
, click apply. - I need updated .csproj and/or log when build with diagnostic level.
- It may also be helpful to look at generated packages\DllExport.1.7.4\gcache
Please continue in #184