"Analyzer error 00007: Layer's definition query is invalid" appears unexpectedly when publishing enterprise data with a definition expression that is based on the geometry fields Shape.STArea().
1. Uninstall all ArcGIS products - This includes anything that used to install into the bin (Desktop, Engine, ArcReader, Server, IMS, Image Server, Arc Logistic Route, Tracking Server, etc.)2. Rename or delete the following Registry Hives:- HKCU\Software\ESRI- HKLM\Software|ESRI3. Rename or delete the following directories. For example, assuming the ArcGIS folder is top level directory, \ArcGIS\bin would mean <a href="file:c:/ArcGIS/bin." target="_blank">c:\ArcGIS\bin.</a> a. \ArcGIS\bin b. \ArcGIS\com c. \ArcGIS\dotnet d. \ArcGIS\java e. \ArcGIS\LibeRelease f. \ArcGIS\LibeDebug g. \ArcGIS\RegFiles_bin h. \ArcGIS\RegFiles_com i. %APPDATA%\ESRI j. %PROGRAMDATA%\ESRI k. %COMMONPROGRAMFILES%\ESRI l. Globe cache (usually in %TEMP%) m. Map cache (usually in %TEMP%\esriMapcache)4. Run ComExplorer and remove incorrect registry keys. This may not be needed if everything is deleted. a. Change these options under Tools\Options. b. Highlight and delete the objects with issues. i. Controls tab 1. PID button 2. CID button 3. LIB button ii. DLL Servers tab 1. PID button 2. CID button 3. LIB button iii. EXE Servers tab 1. PID button 2. CID button 3. LIB button33695. Reinstall ArcGIS Desktop.