I've had this issue over VS 2015, 2017 and 2019, so I believe this is not specific to my setup.
aspnet_merge(0,0): Error occurred: An error occurred when merging assemblies: Object reference not set to an instance of an object
This happens after the following runs:
C:Program Files (x86)Microsoft SDKsWindowsv10.0AinNETFX 4.8 Toolsaspnet_merge.exe (project location)TempPackageBuildDirobjDebugAspnetCompileMergeTempBuildDir -o (name of assembly) -copyattrs (repository location)....TempPackageBuildDirobjDebugAssemblyInfoAssemblyInfo.dll -a -debug
I can run this exact same command on a different machine and it runs without an issue. I've been able to solve this ONCE before by explicitly setting my output directory in website.publishproj to
<PropertyGroup>
<OutputPath>$(MSBuildProjectDirectory)....TempPackageBuildDir</OutputPath>
</PropertyGroup>
But a couple days later the issue came back. There is somethinng bad cached on my machine specifically and I don't have enough knowledge to know what it is.
Any insight would be appreciated,