MSBuild says XML doc file (created from C# comments) does not exist, but it exists prior to build -


when set property <documentationfile> on msbuild project, corecompile task executed, when files present , up-to-date.

msbuild says runs corecompile task because th file "c:\users\georges\documents\visual studio 2010\projects\test\test\bin\debug\test.xml" not exist, exists , up-to-date.

details below.

my msbuild file

i created brand new console application project in visual studio 2010, , added following lines .csproj (just before import of $(msbuildtoolspath)\microsoft.csharp.targets near end of file):

  <propertygroup>     <targetstriggeredbycompilation>       $(targetstriggeredbycompilation);mytarget     </targetstriggeredbycompilation>     <usehostcompilerifavailable>false</usehostcompilerifavailable>     <documentationfile>$(msbuildprojectdirectory)\$(outputpath)$(msbuildprojectname).xml</documentationfile>   </propertygroup>   <target name="mytarget">     <message text="mytarget executed." />   </target> 

the reason using usehostcompilerifavailable explained here.

the aim run mytarget when target corecompile runs.

msbuild output

when compiling f6, , msbuild verbosity set diagnostic in tools->options->projects , solutions->build , run, following output:

without <documentationfile>

if remove line

<documentationfile>$(msbuildprojectdirectory)\$(outputpath)$(msbuildprojectname).xml</documentationfile> 

then corecompile target ignored, correct:

cible "corecompile : (idcible:35)" dans le fichier "c:\windows\microsoft.net\framework\v4.0.30319\microsoft.csharp.targets" du projet "c:\users\georges\documents\visual studio 2010\projects\test\test\test.csproj" (la cible "compile" en dépend) : la cible est ignorée "corecompile", car tous les fichiers de sortie sont à jour par rapport aux fichiers d'entrée. fichiers d'entrée : program.cs;properties\assemblyinfo.cs;c:\users\georges\appdata\local\temp\.netframework,version=v4.0,profile=client.assemblyattributes.cs;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\microsoft.csharp.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\mscorlib.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.core.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.data.datasetextensions.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.data.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.xml.dll;c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.xml.linq.dll;c:\windows\microsoft.net\framework\v4.0.30319\microsoft.csharp.targets;c:\windows\microsoft.net\framework\v4.0.30319\microsoft.netframework.props;c:\users\georges\documents\visual studio 2010\projects\test\test\test.csproj;c:\windows\microsoft.net\framework\v4.0.30319\microsoft.common.targets;c:\windows\microsoft.net\framework\v4.0.30319\microsoft.netframework.targets;c:\windows\microsoft.net\framework\v4.0.30319\microsoft.xaml.targets fichiers de sortie : obj\x86\debug\test.exe;obj\x86\debug\test.pdb génération de la cible "corecompile" terminée dans le projet "test.csproj". : (idcible:35) 

with <documentationfile>

if keep line

<documentationfile>$(msbuildprojectdirectory)\$(outputpath)$(msbuildprojectname).xml</documentationfile> 

then corecompile target run, inccorrect.

msbuild says run because output file "c:\users\georges\documents\visual studio 2010\projects\test\test\bin\debug\test.xml" not exist, i'm 100% positive indeed exist (copying-pasting path verbatim notepad++'s open dialog indeed opens file).

i tried setting <documentationfile> property to:

  • $(msbuildprojectdirectory)\$(outputpath)$(msbuildprojectname).xml
  • $(msbuildprojectdirectory)\$(outputpath)\$(msbuildprojectname).xml
  • $(outputpath)\$(msbuildprojectname).xml
  • $(outputpath)$(msbuildprojectname).xml
  • bin\debug\test.xml
  • setting default value (bin\debug\test.xml) through project's properties in build tab.

but doesn't change anything, corecompile target still run.

cible "corecompile : (idcible:35)" dans le fichier "c:\windows\microsoft.net\framework\v4.0.30319\microsoft.csharp.targets" du projet "c:\users\georges\documents\visual studio 2010\projects\test\test\test.csproj" (la cible "compile" en dépend) : génération complète de la cible "corecompile". le fichier de sortie "c:\users\georges\documents\visual studio 2010\projects\test\test\bin\debug\test.xml" n'existe pas. tâche "csc" (idtâche:13)   c:\windows\microsoft.net\framework\v4.0.30319\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /platform:x86 /errorreport:prompt /warn:4 /doc:"c:\users\georges\documents\visual studio 2010\projects\test\test\bin\debug\test.xml" /define:debug;trace /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\microsoft.csharp.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\mscorlib.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.core.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.data.datasetextensions.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.data.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.xml.dll" /reference:"c:\program files\reference assemblies\microsoft\framework\.netframework\v4.0\profile\client\system.xml.linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\x86\debug\test.exe /target:exe /utf8output program.cs properties\assemblyinfo.cs "c:\users\georges\appdata\local\temp\.netframework,version=v4.0,profile=client.assemblyattributes.cs" (idtâche:13)   compilateur microsoft (r) visual c# 2010 version 4.0.30319.1 (idtâche:13)   copyright (c) microsoft corporation. tous droits réservés. (idtâche:13)    (idtâche:13) exécution de la tâche "csc" terminée. (idtâche:13) tâche "calltarget" (idtâche:14) cible "mytarget : (idcible:36)" du projet "c:\users\georges\documents\visual studio 2010\projects\test\test\test.csproj" (la cible "corecompile" en dépend) : tâche "message" (idtâche:15)   mytarget executed. (idtâche:15) exécution de la tâche "message" terminée. (idtâche:15) génération de la cible "mytarget" terminée dans le projet "test.csproj". : (idcible:36) exécution de la tâche "calltarget" terminée. (idtâche:14) génération de la cible "corecompile" terminée dans le projet "test.csproj". : (idcible:35) 


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -