Reputation: 668
I have a .Net 8 function app (DRIContactServiceUpdate) and a web app (DRIContactManagement) in a single solution. The function app is dependent on the web app. Everything runs fine when I run the function app on my local machine. I'm trying to publish the function app to Azure, it builds but fails during Publish for C:\Users\Chris\source\repos\DRIContactManagement\DRIContactManagement\obj\Release\net8.0\win-x64\ref\DRIContactManagement.dll' could not be found
The problem is, win-x64\ref
doesn't exist. I found where the build was copying the dependent file to the function app as I expect:
Copying file from "C:\Users\Chris\source\repos\DRIContactManagement\DRIContactManagement\bin\x64\Release\net8.0\DRIContactManagement.dll" to "C:\Users\Chris\source\repos\DRIContactManagement\DRIServiceUpdate\bin\x64\Release\net8.0\DRIContactManagement.dll".
The only place I find win-x64
referenced is in the Publish settings but I can't find a path defined referencing that folder.
I've tried all the typical solutions:
bin
and obj
folders in both projects and rebuildI can't find anything online quite like this but I'm sure it's not unique. Any suggestions?
Upvotes: 1
Views: 458
Reputation: 1
Without the minimal reproducible example it is hard to investigate too deeply on my own, but two major things I would look at:
The build process is copying the DLL from bin\x64\Release\net8.0, but the publish process is looking for it in win-x64\ref. I would double check to see which one you are intending it to be in and try changing the path; it is usually somewhere like <solution-root>\bin\x64\Release\net8.0\
.
Have you tried manually copying the DLLs from the bin\Release\net8.0 directory of DRIContactManagement to the corresponding directory in DRIServiceUpdate? This only a temporary fix but will help to see if the problem is in the build or publish steps.
Upvotes: -1
Reputation: 303
Please share your .pubxml file details.
<!-- Ensure RuntimeIdentifier is not set or empty for portable deployment -->
<RuntimeIdentifier></RuntimeIdentifier>
The tag mentioned here should be empty if not it needs to be set to empty.
When I set the tag value to empty
It gives me this result in publish settings:
By ensuring the is empty or not set in the .pubxml file, you configure the application to be published without targeting a specific runtime, thus making it portable.
Upvotes: 1
Reputation: 668
After a lot of searching I found this discussion: https://developercommunity.visualstudio.com/t/clickonce-publish-metadata-file-could-not-be-found/1430499
I still don't know what is causing the issue but the work-around is to switch the publish profile's Target Runtime to "Portable".
Upvotes: 2