Skip to content

Commit cb4705c

Browse files
committed
Add screenshots and fix links with slugs
1 parent 37fa50c commit cb4705c

5 files changed

+20
-15
lines changed
Loading
26.4 KB
Loading
10.7 KB
Loading
25.6 KB
Loading

knowledge-base/resolving-namespace-conflicts.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
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.
44
type: how-to
55
page_title: How to Fix Namespace Conflicts in RadSpreadProcessing for Document Processing
66
slug: radspreadprocessing-resolving-namespace-conflicts
@@ -11,18 +11,19 @@ ticketid: 1673450
1111

1212
## Environment
1313

14-
<table>
15-
<tbody>
16-
<tr>
17-
<td>Product</td>
18-
<td>RadSpreadProcessing for Document Processing</td>
19-
</tr>
20-
</tbody>
21-
</table>
14+
| Version | Product | Author |
15+
| --- | --- | ---- |
16+
| 2024.4.1106| Telerik Document Processing |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
2217

2318
## Description
2419

25-
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.
21+
22+
![Installed Packages](images/installed-packages.png)
23+
24+
>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.
25+
26+
![Conflicting Assemblies Error](images/conflicting-assemblies-error.png)
2627

2728
This knowledge base article also answers the following questions:
2829
- 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:
3132

3233
## Solution
3334

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:
3536

3637
1. **Assign Alias to NuGet Packages**
3738
- For the `Telerik.Documents.Spreadsheet` NuGet package, set its alias to `StandardHelper` (or any preferred alias).
3839
- For the `Telerik.Windows.Documents.Spreadsheet` NuGet package, set its alias to `FrameworkHelper` (or any preferred alias).
3940

41+
![StandardHelper Alias](images/standardhelper-alias.png)
42+
43+
![FrameworkHelper Alias](images/frameworkhelper-alias.png)
44+
4045
2. **Use Extern Alias in Your Code**
4146
- 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.
4247

@@ -59,10 +64,10 @@ namespace YourNamespace
5964
}
6065
```
6166

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.
6368

6469
## See Also
6570

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%})
6772
- [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

Comments
 (0)