sunny moon sunny moon - 1 year ago 117
C++ Question

Visual Studio 2015: C++ code analysis error C1253, unable to load model file 'res://mspft140.dll/300'

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 in its correct location (there are two actually, at
c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\
c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64
), and opened them with resedit. Both contain an XML resource named
, 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
, 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
tries to open this registry key value:
. Clearly it looks for the handler of the
protocol mentioned in the error output - and it's not there to be found, while many siblings of
key refer to some valid handlers, for example,
key has
value of
. I guess that my quest for now is figuring out what that
is meant to be.

Answer Source

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 guess this bug is extremely rare.