diff --git a/src/plugins/cpptools/projectinfo.cpp b/src/plugins/cpptools/projectinfo.cpp
index e0db5fd54f3d78f70321faaabd921f21798baf70..1ca95e3e9c0783f937c4d5bcd12c97dc4fc7a7cf 100644
--- a/src/plugins/cpptools/projectinfo.cpp
+++ b/src/plugins/cpptools/projectinfo.cpp
@@ -40,9 +40,7 @@ ToolChainInfo::ToolChainInfo(const ProjectExplorer::ToolChain *toolChain,
         isMsvc2015ToolChain
                 = toolChain->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMsvc2015Flavor;
         wordWidth = toolChain->targetAbi().wordWidth();
-        targetTriple = type == ProjectExplorer::Constants::MSVC_TOOLCHAIN_TYPEID
-            ? QLatin1String("i686-pc-windows-msvc")
-            : toolChain->originalTargetTriple(); // OK, compiler run is already cached.
+        targetTriple = toolChain->originalTargetTriple();
 
         // ...and save the potentially expensive operations for later so that
         // they can be run from a worker thread.
diff --git a/src/plugins/debugger/analyzer/analyzermanager.h b/src/plugins/debugger/analyzer/analyzermanager.h
index 85a5e1e410149882a02ea1494ca70fb9b3a195d7..3bddc13dd61c5edd5f499432d8ed81005043c8a5 100644
--- a/src/plugins/debugger/analyzer/analyzermanager.h
+++ b/src/plugins/debugger/analyzer/analyzermanager.h
@@ -30,6 +30,8 @@
 
 #include "../debuggermainwindow.h"
 
+#include <projectexplorer/runconfiguration.h>
+
 #include <QWidget>
 
 #include <QCoreApplication>
diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp
index 386fc33e19ef60ea05b4d09c269526f504e257cb..121e2b43b4f683d9cee5937bc2e791d7220bd2a5 100644
--- a/src/plugins/projectexplorer/abstractmsvctoolchain.cpp
+++ b/src/plugins/projectexplorer/abstractmsvctoolchain.cpp
@@ -97,6 +97,13 @@ bool AbstractMsvcToolChain::isValid() const
     return fi.isFile() && fi.isExecutable();
 }
 
+QString AbstractMsvcToolChain::originalTargetTriple() const
+{
+    return m_abi.wordWidth() == 64
+            ? QLatin1String("x86_64-pc-windows-msvc")
+            : QLatin1String("i686-pc-windows-msvc");
+}
+
 ToolChain::PredefinedMacrosRunner AbstractMsvcToolChain::createPredefinedMacrosRunner() const
 {
     Utils::Environment env(m_lastEnvironment);
diff --git a/src/plugins/projectexplorer/abstractmsvctoolchain.h b/src/plugins/projectexplorer/abstractmsvctoolchain.h
index 2b8c86f4d42021b4d006cf24fa687e1bb0321150..9a96faea0ebbf4a3575e6c58b7be131bae296230 100644
--- a/src/plugins/projectexplorer/abstractmsvctoolchain.h
+++ b/src/plugins/projectexplorer/abstractmsvctoolchain.h
@@ -50,6 +50,8 @@ public:
 
     bool isValid() const override;
 
+    QString originalTargetTriple() const override;
+
     PredefinedMacrosRunner createPredefinedMacrosRunner() const override;
     QByteArray predefinedMacros(const QStringList &cxxflags) const override;
     CompilerFlags compilerFlags(const QStringList &cxxflags) const override;
diff --git a/src/plugins/qmljstools/qmljsmodelmanager.cpp b/src/plugins/qmljstools/qmljsmodelmanager.cpp
index 60f7566713b4a8ecd3d7797d2726bbc64babc046..d28cc3ab87eeaf660516c36f52fc6dd9c1ea1d83 100644
--- a/src/plugins/qmljstools/qmljsmodelmanager.cpp
+++ b/src/plugins/qmljstools/qmljsmodelmanager.cpp
@@ -106,6 +106,10 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
         if (BuildConfiguration *bc = activeTarget->activeBuildConfiguration()) {
             preferDebugDump = bc->buildType() == BuildConfiguration::Debug;
             setPreferDump = true;
+            // Append QML2_IMPORT_PATH if it is defined in build configuration.
+            // It enables qmlplugindump to correctly dump custom plugins or other dependent
+            // plugins that are not installed in default Qt qml installation directory.
+            projectInfo.qmlDumpEnvironment.appendOrSet("QML2_IMPORT_PATH", bc->environment().value("QML2_IMPORT_PATH"), ":");
         }
     }
     if (!setPreferDump && qtVersion)