I usually use the swashbuckle swagger library to auto-document my web apis, but ran into issues when trying to deploy said APIs to a service fabric cluster – the swashbuckle/swagger initialization code threw “file not found” exception when trying to load the XML file generated by the build.
In order to get it to work, I edited the csproj file to generated the XML files for x64 config as well – from
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <DocumentationFile>bin\Debug\net461\win7-x64\WebApi.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <DocumentationFile>bin\Release\net461\win7-x64\WebApi.xml</DocumentationFile> </PropertyGroup>
to
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <DocumentationFile>bin\Debug\net461\win7-x64\AssetsGraphWebApi.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <DocumentationFile>bin\Release\net461\win7-x64\AssetsGraphWebApi.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <DocumentationFile>bin\Debug\net461\win7-x64\AssetsGraphWebApi.xml</DocumentationFile> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <DocumentationFile>bin\Release\net461\win7-x64\AssetsGraphWebApi.xml</DocumentationFile> </PropertyGroup>
That’s twice this has had me stumped for a few minutes, hopefully this short post can help somebody else as well.