XML docs in service fabric web api

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s