CA0058

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Unable to load assemblies referenced.

This error occurs if the analysis tool is unable to load assemblies referenced by the assembly under analysis. As result, this error might cause CA0001 in other places because many unexpected states can arise if this occurs. If you are using the managed code analysis tool from within Visual Studio, the following are some of the reasons that might cause CA0058:

  • The input assembly was overridden and now points to an assembly that references other assemblies outside the list of references in the Visual Studio project file.

  • If a project is modified to invoke a custom build step before FxCopCmd.exe runs and the custom build process adds more references to the input assembly, error CA0058 is generated.

  • In C++, it is possible to reference assemblies using ForcedUsing in VCPROJ, overriding the command-line to pass / ForcedUsing or adding #using <Some.dll> in source only.

In all cases, the resolution for this issue is to add the missing reference to the Visual Studio project itself.

See also