DEV Community

Cover image for [Solution] MSBUILD Could not locate assembly

[Solution] MSBUILD Could not locate assembly

MSBuild is a platform for building applications. This engine, which is also known as MSBuild, provides an XML schema for a project file that controls how the build platform processes and builds software.


I've a C# Windows Forms project .csproj that references some common dll´s.
These dll´s are coming from a folder outside project folder.
These dll´s are referenced at design time, from GAC (global assembly cache).


When I´m building the project, inside a remote server, these dll´s should be searchable from another path.
Otherwise, I´ll receive the error below:

[warning]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(2084,5): Warning MSB3245: Could not resolve this reference. Could not locate the assembly "DevExpress.Charts.v20.1.Core". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.


  1. Open .csprojfile
  2. Go to the final line, and before the tag, insert.
<Target Name="BeforeResolveReferences">
  <CreateProperty Value="$(MSBuildProjectDirectory)\two\levels\relativePath;$(AssemblySearchPaths)">
    <Output TaskParameter="Value" PropertyName="AssemblySearchPaths"/>
Enter fullscreen mode Exit fullscreen mode
  1. Replace $(MSBuildProjectDirectory)\two\levels\relativePath; to your relative or absolute path.


Other references for deeper info:

Top comments (0)