3
votes

We have a Microsoft Azure Service Fabric application that was created using Visual Studio 2015. The solution already contains a number of projects and services--some acting as backend code and others as Web API services that provide web methods. I am trying to add a new Web API service (called ReportingSvcWebApi, implemented in a project called ReportingService.WebApi). I added the proper references to the service in the fabric's ApplicationManifest.xml file. I've verified that if I build and debug locally, I can ping the ReportingSvcWebApi service, using Postman to create a web request that calls one of the methods in the controller I created and gets the proper response. Thus, the service seems to be properly integrated into our fabric.

However, when I check in my changes and launch a build in Team Explorer, I get an error:

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets (4875): Could not copy the file "E:\[PATH-TO-OUR-SOLUTION-ON-THE-BULID-SERVER]\Binaries\ReportingService.WebApi\ReportingSvc.WebApi.exe.manifest" because it was not found.

Note that ReportingSvc.WebApi.exe is the name of the output assembly for the ReportingService.WebApi project that I set in the project's properties. It's also the value set in the CodePackage/EntryPoint/ExeHost/Program tag of the Reporting service's ServiceManifest.xml file. Also, in the build logs, before the error occurs, I can see a number of targets run and succeed on all projects in the solution, including the Reporting service ("default targets", GetNativeManifest, andGetCopyToOutputDirectoryItems). The failure appears to occur during the execution of the Publish target for the Reporting service.

I've seen other people report the missing .exe.manifest file error, but never for a Service Fabric service. Also, I'd managed to add another service (an ASP.NET Core MVC service) to our Service Fabric solution previously without having this problem. Finally, I can't find any mention of manifests in any of our projects, aside from the ApplicationManifest.xml and ServiceManifest.xml files that I don't believe are related to the error. Is there an option I need to set somewhere to either generate a .exe.manifest file for my project, or prevent MSBuild from looking for it?

1

1 Answers

2
votes

I fixed the issue by opening up the service's .csproj file in a text editor and adding the following alongside the other <PropertyGroup> elements:

<PropertyGroup> 
    <GenerateManifests>true</GenerateManifests> 
</PropertyGroup>

The other, preexisting projects in the solution didn't have this element and still built fine. I'm not sure why this was necessary in this case.