You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/csharp/language-reference/compiler-messages/assembly-references.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,35 @@ These compiler errors indicate one of these problems in your code:
89
89
- You used the [global scope operator, (`::`)](../operators/namespace-alias-qualifier.md) when the type isn't in the global namespace.
90
90
- You're accessing an extension member and either the namespace isn't specified in a `using` directive, or you're not referencing the assembly that contains the extension.
91
91
92
+
### When the assembly appears to be referenced
93
+
94
+
If the assembly appears to be referenced in your project but you still receive CS0012, try these troubleshooting steps:
95
+
96
+
- Restore packages: Run `dotnet restore` to ensure all package references are properly resolved, especially after installing or uninstalling NuGet packages.
97
+
98
+
- Clear the NuGet package cache and restore:
99
+
100
+
```console
101
+
dotnet nuget locals all --clear
102
+
dotnet restore
103
+
```
104
+
105
+
- Check for version conflicts: Verify that all referenced assemblies use compatible versions. Look for binding redirect warnings in the build output.
106
+
107
+
- Clean the solution and rebuild to ensure no stale references remain:
108
+
109
+
```console
110
+
dotnet clean
111
+
dotnet build
112
+
```
113
+
114
+
- Verify package integrity: If the error occurred after package operations, ensure the package was installed correctly by removing and reinstalling it:
115
+
116
+
```console
117
+
dotnet remove package [PackageName]
118
+
dotnet add package [PackageName]
119
+
```
120
+
92
121
## Type forwarding
93
122
94
123
-**CS1068**: *The type name could not be found in the global namespace. This type has been forwarded to another assembly. Consider adding a reference to that assembly.*
0 commit comments