I am using VS2019 and .NET CORE 2.2 I am getting the warning AL1073
ALINK warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor
I know this is close to the question as: ALINK : warning AL1073: Referenced assembly 'mscorlib.dll' targets a different processor
BUT:
I am on .NET CORE 2.2 not on 4.x
The solutions proposed there do not work on .NET core
in particular, attempting to add:
<PropertyGroup>
<TargetFrameworkSDKToolsDirectory Condition=" '$(PlatformTarget)' == 'x64'">$(TargetFrameworkSDKToolsDirectory)\$(PlatformTarget)\
</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>
gives another warning
Warning MSB3084 Task attempted to find "al.exe" in two locations. 1) Under the "\x64\" processor specific directory which is generated based on SdkToolsPath 2) The x86 specific directory under "\x64\" which is specified by the SDKToolsPath property. You may be able to solve the problem by doing one of the following: 1) Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK. C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets
Really strange, since the location is the same according to the warning!
Additionally: I would be happy to suppress the warning in the build settings, since all my unit tests pass, but adding 1073 to the list has no effect on the AL1073 warning which still appears.
Alternatively, the warning suggests: Set the "SDKToolsPath" property to the location of the Microsoft Windows SDK, how can I do that?
UPDATE to answer comment: This is hard to reproduce in a simple setup. the project references several Github projects (fo-dicom) in particular. The fo-dicom lib uses imaging libs built for 32 and 64 platforms. I did try setting to 64bits but it did not help. I saw other people raise the bug in VS community that the suppression of warning seems buggy: https://developercommunity.visualstudio.com/content/problem/224196/suppress-warnings-from-project-settings-build-does.html . That issue was closed without follow-up also MSFT stated that the AL 1073 will not be fixed, but I would like to disable! can't have warnings when using continuous integration...
I am now trying to recompile everything in .NET CORE 3.0, will provide an update if it works.
UPDATE: After recompiling in .NET CORE 3.0 I still have the issue.
I also found another cause of this issue (mentione in other SO articles, but for .NET 4.x. Indeed I saw that the issue came up also with resource files however with .NET Core we do not see the "Generating Satellite Assemblies" message so it is hard to link the compiler warning to the generation of the resource files.
In order to solve the issue I copied the al.exe file from C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64 into my solution into Tools64 and added the following to my .csproj
<PropertyGroup>
<TargetFrameworkSDKToolsDirectory>..\Tools64</TargetFrameworkSDKToolsDirectory>
</PropertyGroup>
Setting the SDKToolsDirectory directly to the original location did not work. Additional using the absolute path will not in my case where we use a devops build server for continuous integration (paths may be different). copying the al.exe tool locally seems to be an acceptable solution.