dotnet / project-system

The .NET Project System for Visual Studio
MIT License
969 stars 387 forks source link

Default C# Console (.NET Framework) project template and the DocumentationFile location #2996

Open KirillOsenkov opened 6 years ago

KirillOsenkov commented 6 years ago

By default if I enable the doc file for a new C# console app (.NET Framework), non SDK style, it generates bin\Debug\ConsoleApp9.xml.

Isn't this wrong? Then I see this during the build:

Did not copy from file "bin\Debug\ConsoleApp9.xml" to file "bin\Debug\ConsoleApp9.xml" because the "SkipUnchangedFiles" parameter was set to "true" in the project and the files' sizes and timestamps match.

I'd expect the right thing there would be to tell Csc to output it to obj\Debug\ConsoleApp9.xml, so that this step then copies it from obj to bin?

Pilchie commented 6 years ago

@nguerrera @andygerlicher - do you know about this (and where it should live)?

davkean commented 6 years ago

This default comes from the property pages/project system, right?

KirillOsenkov commented 6 years ago

yup, the old one

KirillOsenkov commented 6 years ago

It doesn't seem to be breaking incrementality as far as I could see or have any other consequences, but it worries me. Also that the path is hardcoded vs. using a $(OutputPath) or $(OutDir). Should be $(IntermediateOutputPath)\$(AssemblyName).xml or something.

nguerrera commented 6 years ago

$(IntermediateOutputPath) won't (necessarily) be set in the body of the project so project system can't write that into the project.

This really should always have just been a boolean. This shouldn't be different than pdbs. We did the work in the SDK for GenerateDocumentationFile=true to do the right thing for you, but property pages still haven't caught up: #368

We could consider moving GenerateDocumentationFile=true down to msbuild common targets so that non-SDK projects could get the nicer behavior too.