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/resolving-namespace-conflicts.md
+20-15
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
-
title: Resolving Namespace Conflicts in RadSpreadProcessing for Document Processing
3
-
description: This article demonstrates how to resolve namespace conflicts when using RadSpreadProcessing in a .NET Core project with both .NET Standard and .NET Framework versions installed.
2
+
title: Resolving Namespace Conflicts in Telerik Document Processing Libraries
3
+
description: This article demonstrates how to resolve namespace conflicts when using Telerik Document Processing in a .NET Core project with both .NET Standard and .NET Framework versions installed.
4
4
type: how-to
5
5
page_title: How to Fix Namespace Conflicts in RadSpreadProcessing for Document Processing
When working on a .NET Core project that utilizes both `Telerik.Documents.Spreadsheet` and `Telerik.Windows.Documents.Spreadsheet` packages, a namespace conflict arises due to the `Workbook` class existing in both packages. This conflict results in a compiler error, preventing successful compilation.
20
+
When working on a .NET Core project that utilizes both, the .NET Standard and .NET Framework version of a specific Document Processing library, e.g. `Telerik.Documents.Spreadsheet` and `Telerik.Windows.Documents.Spreadsheet` packages, a namespace conflict arises due to the `Workbook` class existing in both packages. This conflict results in a compiler error, preventing successful compilation.
>note It is not recommended to install the .NET Standard and .NET Framework version of the Document Processing libraries simultaneously in the same project. Install the NuGet package which is compatible with the application's Target framework and Target OS.
This knowledge base article also answers the following questions:
28
29
- How can I resolve type conflicts in .NET Core projects using Telerik Document Processing libraries?
@@ -31,12 +32,16 @@ This knowledge base article also answers the following questions:
31
32
32
33
## Solution
33
34
34
-
To resolve the compile-time error caused by the conflicting `Workbook` type in both assemblies, utilize the C# `extern alias` feature. This approach allows you to differentiate between assemblies and use types from both without conflict. Follow the steps below:
35
+
Depending on the target framework of your project (NET Framework, .NET Standard .NET Core, .NET 6, etc.), you should install the library version accordinglyt. However, if you need to install both versions for any reason, to resolve the compile-time error caused by the conflicting `Workbook` type in both assemblies, utilize the C# [extern alias](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extern-alias) feature. This approach allows you to differentiate between assemblies and use types from both without conflict. Follow the steps below:
35
36
36
37
1.**Assign Alias to NuGet Packages**
37
38
- For the `Telerik.Documents.Spreadsheet` NuGet package, set its alias to `StandardHelper` (or any preferred alias).
38
39
- For the `Telerik.Windows.Documents.Spreadsheet` NuGet package, set its alias to `FrameworkHelper` (or any preferred alias).
- At the top of your source file where you intend to use the conflicting types, add the `extern alias` directive for each alias you assigned. This directive differentiates the assemblies, allowing you to reference each type explicitly.
42
47
@@ -59,10 +64,10 @@ namespace YourNamespace
59
64
}
60
65
```
61
66
62
-
By following these steps, you can successfully resolve the namespace conflict and use the `Workbook` class from both Telerik Document Processing libraries in your .NET Core project.
67
+
By following these steps, you can successfully resolve the namespace conflict and use the `Workbook` class from the desired NuGet package in your .NET Core project.
63
68
64
69
## See Also
65
70
66
-
-[Installation: NuGet Packages for Document Processing](https://docs.telerik.com/devtools/document-processing/getting-started/installation/nuget-packages)
71
+
-[Installation: NuGet Packages for Document Processing]({%slug installation-deploying-telerik-document-processing%})
67
72
-[C# Language Reference: extern alias](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/extern-alias)
68
-
-[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)
73
+
-[What Versions of Document Processing Libraries are Distributed with the Telerik Products]({%slug distribute-telerik-document-processing-libraries-net-versions%})
0 commit comments