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: knowledge-base/dpl-resolve-ambiguous-references.md
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ description: This article describes how to resolve ambiguous references due to c
4
4
type: how-to
5
5
page_title: How to Resolve Ambiguous References
6
6
slug: dpl-resolve
7
-
tags: radspreadprocessing, document processing, wpf, ambiguous reference, extern alias
7
+
tags: spreadprocessing, document, processing, wpf, ambiguous, reference, extern, alias
8
8
res_type: kb
9
9
ticketid: 1684241
10
10
---
@@ -17,16 +17,23 @@ ticketid: 1684241
17
17
18
18
## Description
19
19
20
-
When developing a WPF application that utilizes RadSpreadProcessing for Document Processing to set a font in a spreadsheet, and the solution includes a cross-platform project referencing `Telerik.Documents.Core`, an ambiguous reference error may occur. The issue arises due to identical namespaces in both assemblies when both platform-specific projects and cross-platform projects are part of the solution. This knowledge base article also answers the following questions:
21
-
- How to resolve ambiguous reference errors in a WPF project using RadSpreadProcessing?
22
-
- How to use RadSpreadProcessing in a WPF application with cross-platform project references?
23
-
- How to set a spreadsheet font in WPF using RadSpreadProcessing without ambiguous references?
20
+
When developing a WPF application that utilizes [RadSpreadProcessing]({%slug radspreadprocessing-overview%}) to set a font in a spreadsheet, and the solution includes a cross-platform project referencing `Telerik.Documents.Core`, an ambiguous reference error may occur.
21
+
22
+

23
+
24
+
The issue arises due to identical namespaces in both assemblies when both platform-specific projects and cross-platform projects are part of the solution.
24
25
25
26
## Solution
26
27
27
-
To resolve the ambiguous reference error in a WPF application using RadSpreadProcessing alongside a cross-platform project, use the `extern alias` directive. This approach allows differentiating between assemblies that have the same namespace but are intended for different platforms. Follow the steps below to apply this solution:
28
+
The Telerik Document Processing libraries are available in .NET Framework, .NET 8/.NET 9 (or newer) for Windows and .NET Standard compatible versions. All versions are available as NuGet packages. The assemblies/packages for .NET Standard do not contain the word *Windows* in their name. Learn [What Versions of Document Processing Libraries are Distributed with the Telerik Products]({%slug distribute-telerik-document-processing-libraries-net-versions%}).
29
+
30
+
In a WPF project, you need to use the assemblies containing the word *Windows* and avoid mixing .NET Framework and .NET Standard compatible versions.
31
+
32
+
However, to resolve the ambiguous reference error in a WPF application using RadSpreadProcessing alongside a cross-platform project, use the [extern alias](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extern-alias) directive. This approach allows differentiating between assemblies that have the same namespace but are intended for different platforms. Follow the steps below to apply this solution:
33
+
34
+
1.**Assign an alias to the conflicting assembly in the WPF project**. Right-click on the referenced assembly in the Solution Explorer and select `Properties`. In the `Aliases` field, enter a unique alias (e.g., `NetFramework`).
28
35
29
-
1.**Assign an alias to the conflicting assembly in the WPF project**. Right-click on the referenced assembly (`Telerik.Documents.Core` in the cross-platform project) in the Solution Explorer and select `Properties`. In the `Aliases` field, enter a unique alias (e.g., `NetFramework`).
2.**Use the `extern alias` directive in your WPF project code**. At the top of your C# file where you are facing the ambiguous reference, declare the alias defined in step 1. This explicitly specifies which assembly to use for the conflicting types.
32
39
@@ -55,7 +62,6 @@ By following these steps, you can successfully resolve the ambiguous reference e
-[What Versions of Document Processing Libraries are Distributed with the Telerik Products](https://docs.telerik.com/devtools/document-processing/knowledge-base/distribute-telerik-document-processing-libraries-net-versions)
60
-
-[Resolve Compile-Time Error Between RadPdfProcessing and Telerik Reporting](https://docs.telerik.com/devtools/document-processing/knowledge-base/resolve-compile-time-error-radpdfprocessing-telerik-reporting)
65
+
-[What Versions of Document Processing Libraries are Distributed with the Telerik Products]({%slug distribute-telerik-document-processing-libraries-net-versions%})
66
+
-[Resolve Compile-Time Error Between RadPdfProcessing and Telerik Reporting]({%slug resolve-compile-time-error-radpdfprocessing-telerik-reporting%})
61
67
-[C# Extern Alias - Microsoft Documentation](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extern-alias)
0 commit comments