
Designite is developed to work on a development or build machine i.e., it assumes that you can build your project on the same machine. Designite works fine if you have appropriate version of Visual Studio installed corresponding to the program that you are trying to analyze using Designite. However, if you install Designite on a non-development machine, it may not analyze the code due to missing configuration settings. It happens especially when a researcher or a quality enthusiast wants to analyze a number of projects (often open-source) using Designite. This post summarizes potential errors one may get while analyzing source code using Designite and their corresponding remedies.
One potential error that you see in the log file generated by Designite corresponds to missing correct version of MSBuild.
The selected project <path of the project> could not be analyzed. The tools version "15.0" is unrecognized. Available tools versions are "2.0", "3.5", "4.0".
If you see the above error, you need to install the correct version of Visual Studio (which will also install
MSBuild) to fix this problem. If the problem persists, it is due to Roslyn (the underlying framework upon which Designite is built) could not locate appropriate version of MSBuild.exe.
You may create an environment variable MSBUILD_EXE_PATH and specify an appropriate path (for example C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe
).
You may also see some variant of the following error message:
An imported component of the selected project was not found and thus the project could not be analyzed. The imported project "C:\Program Files (x86)\Designite\Designite\Sdks\Microsoft.NET.Sdk\Sdk\Sdk.props" was not found.
The error occurs due to missing environment settings (and not due to a missing folder in the Designite installation). It has picked up the path from Designite because that is the default path. Based on the local settings, you may see the same error with some other path. The solution of this problem is to set environment variables correctly. Specifically, you need to do the following:
- Install latest Visual Studio and set the path of the installation (such as
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise) against environment variable
VSINSTALLDIR; if you don’t see this variable in your user environment variables you need to create a new.
- Check whether you have .NET core SDK installed. If not installed, download and install it. Create a new environment
variable MSBuildExtensionsPath and set its value to the installed .NET core SDK (such
as
C:\Program Files\dotnet\sdk\2.1.2
). - Create another user environment variable MSBuildSDKsPath and set its value to
something like
C:\Program Files\dotnet\sdk\2.1.2\Sdks
. - Also, create environment variable VisualStudioVersion and set it to the correct version (if you installed Visual Studio 2017, then set this variable to “15.0”).
After these settings, you should be able to analyze source code using Designite without any configuration related errors.