I get numerous compiler warnings CS1591 Missing XML comment for publicly visible type or member ...
in my Universal Windows Store App project in VS2015 for auto generated code files, e.g.
- App.g.cs
- App.g.i.cs
- SomePage.g.cs
- SomePage.g.i.cs
I know of the different approaches available to fix these warnings from showing up, but I can't get the specific approach mentioned in Quoc Lam's blog to work. The other possible solutions don't work for me, so what do I have to do make it work for my project?
There are a couple of things I still don't understand:
- Where do I have to place the code lines containing the new target? I tried to put them into my Windows Phone project file (
.csproj
), butXamlGeneratedCodeFiles
always seems to be empty (judging from diagnostic build output) - I also tried setting the
AftetTargets
attribute fromXamlMarkupCompilePass1
toXamlMarkupCompilePass2
, but still the same as above - Where is
XamlGeneratedCodeFiles
actually filled with data? Or do I misunderstand something? - Is
XamlGeneratedCodeFiles
the right variable to access?
I also looked at several of the msbuild .target
files but got completely lost. Please let me know if you need further information that is still missing form this post.
Update
In addition to the accepted answer I post the working solution for my project as it wouldn't fit into a comment:
<Target Name="CodeWarningRemover" AfterTargets="MarkupCompilePass2">
<ItemGroup>
<CSFiles Include="**\*.g.cs;**\*.g.i.cs" />
</ItemGroup>
<Message Text="CSFiles: '@(CSFiles)'" />
<Exec Command="for %%f in (@(CSFiles)) do echo #pragma warning disable > %%f.temp" />
<Exec Command="for %%f in (@(CSFiles)) do type %%f >> %%f.temp" />
<Exec Command="for %%f in (@(CSFiles)) do move /y %%f.temp %%f" />
</Target>