Visual Studio 2015 Community update 3, trying the C++ code analysis feature. The settings are as follows:
solution properties > code analysis settings > [all configurations] [all platforms] : microsoft native recommended settings
project properties > code analysis > [all configurations] [all platforms] : microsoft native recommended settings
Whenever I run analyze > run code analysis on solution
I would always get a c1xx : fatal error C1253: Unable to load model file 'res://mspft140.dll/300'
. This happens to every project, new or existing. MSDN is not particularly helpful about this one.
The string is a res protocol, so I checked if the dll mentioned is at its correct location (there are two actually, at c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\
and c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64
), and opened them with resedit. Both contain an XML resource named 300
, so I don't see any reason for VS being unable to load it. Resetting the settings didn't help, full uninstall and reinstall (half a day wasted) did neither.
I also ran procmon with [Path] [contains] [mspft]
filter while running the code analysis in VS, but the file system results are only SUCCESS
and FILE LOCKED WITH ONLY READERS
, which seems to be ok.
Did anyone experience this error? Does anyone have any surmises about its cause?
Update: After looking thoroughly through many more procmon captures with different filters I found out that cl.exe
tries to open this registry key value: HKCR\PROTOCOLS\Handler\res\CLSID
. Clearly it looks for the handler of the res
protocol mentioned in the error output - and it's not there to be found, while many siblings of res
key refer to some valid handlers, for example, http
key has CLSID
value of {79eac9e2-baf9-11ce-8c82-00aa004ba90b}
. I guess that my quest for now is figuring out what that res
CLSID
is meant to be.
I was right in my assumption about the res
protocol handler. The correct HKCR\PROTOCOLS\Handler\res\CLSID
value is {3050f3bc-98b5-11cf-bb82-00aa00bdce0b}
(which refers to C:\Windows\System32\mshtml.dll
). For some reason my registry was missing it; as soon as I added the value, the code analysis started working without errors.
I hope this helps someone, although I believe the bug is extremely rare.