Friday, August 1, 2008

Unable to read Code Analysis output report

So, this little Gem popped up today.

Error 1 Unable to read Code Analysis output report. Make sure that the directory is writable (default is the project output directory). Subsystem.Messaging.ServiceImplementation

Naturally I appear to be the only one who has ever gotten this, since the search engines turned up no results pretty much. The only the I could find from Microsoft was that my HD must be full, I don't have permission to read the file (that I just created), or some other stupid answer any developer actually using Code Analysis would have already thought of.

Of course I knew it had nothing to do with that and I could open the file manually. After some thinking, I remembered seeing Visual Studio complain in the past about file paths being too long. A quick change to the dll name made the path short enough for all to be well, if only that were a do-able option.

My only course of action right now is to turn off Code Analysis for the project. Damn NTFS and its 255 char limit...

On a side note, anyone know how to change the Code Analysis output directory or the template for naming it?

14 comments:

Herre

I guess this makes me the second person to encounter this problem :)

thank you very much for your solution.

Unknown

I too have this problem. The only solution I found was to turn off code analysis on the build target used by me team build. Not really a solution though :(

Unknown

I had this problem too. Haven't found a proper solution to it, but you can delete the *.lastcodeanalysissucceeded and *. CodeAnalysisLog.xml files from your directory to get around the error message.

G

hmmm so i'm not alone. I tried the suggestion that one user said to delete the *.lastcodeanalysissucceeded and CodeAnalysisLog.xml.

This worked like a charm. i started to get this error when i undid my pending changes and then tried to rebuild.... :|

Jaime

I´ve solved this issue changing the name of the project folder, because it was too long. The problem is that the absolute path of file "*.lastcodeanalysissucceeded" is too long. Visual Studio have problems with file paths greater than 255 characters. You can check the file paths generated by your application building, in the file "*.FileListAbsolute.txt" in your application object folder.

Sean Singletary

I ran into this problem recently as well. My problem was specifically occuring on TFS 2010. I found out the problem was the *.codeanalysislog.xml and *.lastcodeanalysissucceeded files were not being generated by TFS Build. It is generated locally, but not on the server...very weird.

I had to disable Code Analysis so the gated check in would proceed.

I don't have a better solution yet!

Uldis Karlovs-Karlovskis

It is not always a too long path problem. You can try to open failing csproj file in text mode and search for "CodeAnalysis" tags. Remove all except "CodeAnalysisRuleSet" and "RunCodeAnalysis". Now try again. Removed ones are from previous versions of VS I believe, however, they are not needed for VS2010.

Uldis Karlovs-Karlovskis

crackers

narcomancer had the right idea. I bumped into a similar issue and removed the CodeAnalysisLogFile and CodeAnalysisInputAssembly elements in the project file and that worked for me.

andrew
This comment has been removed by the author.
andrew

We had a similar issue, turns out that our csproj file was pointing to the wrong path for the Code Analysis Log File and we just hand edited the csproj to point to the correct place. Here's what our csproj looked like. Notice how the OutputPath does not match the CodeAnalysisLogFile path (Note: I changed all angled brackets to square brackets so that this page will display them):
[PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Obfuscated|x86'"]
...
[OutputPath]bin\Release-Obfuscated\[/OutputPath]
[CodeAnalysisLogFile]bin\Release\OurProject.exe.CodeAnalysisLog.xml[/CodeAnalysisLogFile]
...
[/PropertyGroup]

Unknown

@andrew - this solution worked for me too.

Unknown

I found the best way to deal with it (if it is not the path lenght is to change

from:

bin\Release\OurProject.exe.CodeAnalysisLog.xml

to:

$(OutDir)OurProject.exe.CodeAnalysisLog.xml

whatispunk

I just had this problem. The resolution had absolutely nothing to do with code analysis.

I had recently added a new project to the solution. There was a build configuration called "DEV" that I needed to associate with the project. So I just manually editted the SLN file. However instead of "DEV" I typed "Dev". That was it. That was what broke my whole build with a red herring about Code Analysis.

After changing the SLN file to reference the build configuration by it's properly cased name, everything was fine.

pg slot

สล็อต เว็บ ตรง จากค่ายเกมสล็อตออนไลน์ชื่อดังอันดับ 1 ที่นักพนันทั่วโลกให้การยอมรับว่าเป็นค่ายเกมสล็อตออนไลน์ที่ดีที่สุดตลอดกาลกับค่าย PG SLOT ที่มาแรงที่สุดในปี 2022