IMPORTANT!
This forum is now archived. Click here for the New Support Forum
COMref with dotnet Core 5 fixed
Quote from d052057 on December 7, 2021, 11:18 pmI used 'shell32' a lot to pull metadata from media files. the Shell32.dll file is small and fast comparing to the other packages (I am not talking one or 2 files at a time. I am talking hundred files a time). After researching and trying many ways and many times, I find a work around (that's work for me).
- I need to edit .cproj file and add this script to it.
<Target Name="resolveInteropOutputPath" BeforeTargets="ResolveComReferences"
Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''">
<PropertyGroup Condition=" '$(InteropOutputPath)' == '' ">
<InteropOutputPath>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)</InteropOutputPath>
</PropertyGroup>
</Target>for example on my project file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes><!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer>
<Description></Description>
<Copyright></Copyright>
<PackageProjectUrl></PackageProjectUrl>
<Company></Company>
<Version></Version>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<!--fix com reference issue ytp-->
<Target Name="resolveInteropOutputPath" BeforeTargets="ResolveComReferences"
Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''">
<PropertyGroup Condition=" '$(InteropOutputPath)' == '' ">
<InteropOutputPath>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)</InteropOutputPath>
</PropertyGroup>
</Target>...
...
I hope this will help someone in the future.
Thanks.
I used 'shell32' a lot to pull metadata from media files. the Shell32.dll file is small and fast comparing to the other packages (I am not talking one or 2 files at a time. I am talking hundred files a time). After researching and trying many ways and many times, I find a work around (that's work for me).
- I need to edit .cproj file and add this script to it.
<Target Name="resolveInteropOutputPath" BeforeTargets="ResolveComReferences"
Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''">
<PropertyGroup Condition=" '$(InteropOutputPath)' == '' ">
<InteropOutputPath>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)</InteropOutputPath>
</PropertyGroup>
</Target>
for example on my project file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
<IsPackable>false</IsPackable>
<SpaRoot>ClientApp\</SpaRoot>
<DefaultItemExcludes>$(DefaultItemExcludes);$(SpaRoot)node_modules\**</DefaultItemExcludes>
<!-- Set this to true if you enable server-side prerendering -->
<BuildServerSideRenderer>false</BuildServerSideRenderer>
<Description></Description>
<Copyright></Copyright>
<PackageProjectUrl></PackageProjectUrl>
<Company></Company>
<Version></Version>
<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>
<!--fix com reference issue ytp-->
<Target Name="resolveInteropOutputPath" BeforeTargets="ResolveComReferences"
Condition="'@(COMReference)'!='' or '@(COMFileReference)'!=''">
<PropertyGroup Condition=" '$(InteropOutputPath)' == '' ">
<InteropOutputPath>$(MSBuildProjectDirectory)\$(IntermediateOutputPath)</InteropOutputPath>
</PropertyGroup>
</Target>
...
...
I hope this will help someone in the future.
Thanks.
IMPORTANT!
This forum is now archived. Click here for the New Support Forum