New developer to a solution. I have the source code. When I try to compile I get the below error.
Previously, I worked around this on another computer by having another devloper on the project zip his folder and send it to me. But I would like to understand how I would fix this if I was net new to the project. Assume I don't have to rely on someone to send me their .target folder zipped up.
Error:
C:\Users\boyd\Source\Repos\insightstobehavior\Classroom_Package.proj(3,11):
error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual S
tudio\2017\Community\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targ
ets" was not found. Also, tried to find "MSBuildCommunityTasks\MSBuild.Communit
y.Tasks.Targets" in the fallback search path(s) for $(MSBuildExtensionsPath) -
"C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Progra
m Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.e
xe.Config". Confirm that the path in the <Import> declaration is correct, and t
hat the file exists on disk in one of the search paths.
From .project -
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />
error MSB4226 MSBuild.Community.Tasks.Targets" was not found
To resolve this issue, you should install the msbuildtasks
msi installer:
https://github.com/loresoft/msbuildtasks/releases/download/1.5.0.235/MSBuild.Community.Tasks.v1.5.0.235.msi
You can check the readme.md of this MSBuild Community Tasks:
In order to use the tasks in this project, you need to import the MSBuild.Community.Tasks.Targets files.
If you installed the project with the msi installer, you can use the following.
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
After install that msi file, you will find the file MSBuild.Community.Tasks.Targets
in the path C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks
.
This will resolve this issue.
Hope this helps.
I have got similar issue due to starting using VS 2019. All it says is that go to this file:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe.Config
open it and find what is in this node:
<projectImportSearchPaths>
<searchPaths os="windows">
Change the value to navigate exactly where your MSBuild is right now. In my case, the change was:
<projectImportSearchPaths>
<searchPaths os="windows">
<property name="MSBuildExtensionsPath" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise"/>
<property name="MSBuildExtensionsPath32" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise"/>
<property name="MSBuildExtensionsPath64" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise"/>
<property name="VSToolsPath" value="$(MSBuildProgramFiles32)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio\v$(VisualStudioVersion)"/>
</searchPaths>
</projectImportSearchPaths>
value: Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VisualStudio
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With