Edit

Share via


MSB3268 diagnostic code

This article describes the MSB3268 error code.

Message text

MSB3268: The primary reference 'assembly' could not be resolved because it has an indirect dependency on the framework assembly 'framework-assembly' which could not be resolved in the currently targeted framework. 'framework'. To resolve this problem, either remove the reference 'assembly' or retarget your application to a framework version which contains 'framework'.

Description

This warning occurs when your project references an assembly that itself has a dependency on a framework assembly that requires a different version of the framework. This is a warning because there's a risk to using the assembly in that case due to the version incompatibility.

Resolution

As the error text indicates, there are multiple ways to resolve the issue. Which solution is appropriate in your situation depends on the project requirements and on how your project's code depends on the assembly that triggered the error.

  • If you can target the application to the version of the framework mentioned in the error message text, then that would solve the issue. You might need to update your code if there are any compatibility issues with the updated framework version.
  • If you have a project requirement to target a particular framework version, then you can't use the version of the assembly you tried to reference. Try to find an earlier version of that assembly that that works with the framework you're targeting.
  • If there is no version of the assembly that's compatible with the framework version you're targeting, and you can't change the targeted framework version, then your only option is to not use that assembly. You then need to find a way to rewrite your code to avoid the dependency on that assembly.

For more information, see Troubleshoot assembly references.

Applies to

All versions of MSBuild