Skip to content

Commit 647b9a1

Browse files
committed
Added KB for the timeout api changes
1 parent 8c35d06 commit 647b9a1

File tree

6 files changed

+57
-2
lines changed

6 files changed

+57
-2
lines changed

Diff for: introduction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ position: 0
3131

3232
* **Support for Variety of File Formats**: The Telerik Document Processing includes 5 libraries for manipulating [Office Open XML](https://en.wikipedia.org/wiki/Office_Open_XML) file formats and PDF documents in your application.
3333

34-
* **Timeout Mechanism** when importing and exporting documents. The **Import** and **Export** methods for all FormatProviders have a mandatory *TimeSpan?* timeout parameter after which the operation will be cancelled.
34+
* **Timeout Mechanism** when importing and exporting documents. The **Import** and **Export** methods for all FormatProviders have a mandatory *TimeSpan?* timeout parameter after which the operation will be cancelled. [Read More]({%slug timeout-mechanism-in-dpl%})
3535

3636
For more details about the benefits of using Telerik Document Processing, see the [Telerik Document Processing product overview page](https://www.telerik.com/document-processing-libraries).
3737

Diff for: knowledge-base/images/cs0618-warning.png

95.3 KB
Loading

Diff for: knowledge-base/images/timeout-warning.png

61.4 KB
Loading

Diff for: knowledge-base/images/treat-warning-as-errors.png

95.5 KB
Loading

Diff for: knowledge-base/timeout-mechanism-in-dpl.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
title: Timeout Mechanism in Document Processing Libraries
3+
description: Compiler Warning (level 2) CS0618 in Document Processing Libraries after upgrading.
4+
type: how-to
5+
page_title: Timeout Mechanism in Document Processing Libraries
6+
slug: timeout-mechanism-in-dpl
7+
tags: timeout, obsolete, import, export, CS0618, warning
8+
res_type: kb
9+
---
10+
11+
## Environment
12+
13+
| Version | Product | Author |
14+
| --- | --- | ---- |
15+
| Q4 2024 | Document Processing Libraries |[Desislava Yordanova](https://www.telerik.com/blogs/author/desislava-yordanova)|
16+
17+
## Description
18+
19+
After upgrading to **Q2 2024** (or a newer version) of Telerik Document Processing Libraries and you have any logic for importing or exporting documents in your application, one of the following warning messages may occur if you try building the project:
20+
21+
![CS0618 Warning](images/cs0618-warning.png)
22+
23+
The [Compiler Warning (level 2) CS0618](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs0618?f1url=%3FappId%3Droslyn%26k%3Dk(CS0618)) indicates that an obsolete **Import** or **Export** method is used:
24+
25+
![Timeout Warning](images/timeout-warning.png)
26+
27+
## Solution
28+
29+
In Q4 2024 Telerik Document Processing Libraries introduced a new **timeout mechanism** for importing and exporting documents. The Import and Export methods of all FormatProviders have a mandatory **TimeSpan?** timeout parameter after which the operation will be cancelled:
30+
31+
>note This is valid for all Document Processing Libraries.
32+
33+
#### Import XLSX (Excel Workbook) file
34+
35+
```csharp
36+
using (Stream input = new FileStream("input-file.xlsx", FileMode.Open))
37+
{
38+
XlsxFormatProvider formatProvider = new XlsxFormatProvider();
39+
TimeSpan timeoutInterval = TimeSpan.FromSeconds(10);
40+
Workbook workbook = formatProvider.Import(input, timeoutInterval);
41+
}
42+
```
43+
44+
>note The [TimeSpan](https://learn.microsoft.com/en-us/dotnet/fundamentals/runtime-libraries/system-timespan) interval is up to the developer and should be considered with the environment specific configurations.
45+
46+
Note that there is a Visual Studio setting that controls whether the [warnings will be treated as errors](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/errors-warnings):
47+
48+
![Treat Warning as Errors](images/treat-warning-as-errors.png)
49+
50+
Make sure that it is not toggled. Otherwise, the application wouldn't be compiled due to the obsolete API.
51+
52+
## See Also
53+
54+
- [Using PdfFormatProvider in RadPdfProcessing]({%slug radpdfprocessing-formats-and-conversion-pdf-pdfformatprovider%})
55+
- [Using DocxFormatProvider in RadWordsProcessing]({%slug radwordsprocessing-formats-and-conversion-docx-docxformatprovider%})

Diff for: libraries/radspreadprocessing/formats-and-conversion/general-information.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ __RadSpreadProcessing__'s document model allows you to easily open and save file
2121
* __Txt__(tab delimited): Plain text format, which preserves only the content of the cells in the active worksheet. The format does not save any formatting and keeps only the result values of the cells. These values are delimited via tabs.
2222
* **DataTable**: This allows you to convert the DataTable that is coming form your database to a spreadsheet and vice versa.
2323

24-
>note In **Q4 2024** Telerik Document Processing Libraries introduced a new timeout mechanism when importing and exporting documents. The **Import** and **Export** methods of all FormatProviders have a mandatory *TimeSpan?* timeout parameter after which the operation will be cancelled.
24+
>note In **Q4 2024** Telerik Document Processing Libraries introduced a new timeout mechanism for importing and exporting documents. The **Import** and **Export** methods of all FormatProviders have a mandatory *TimeSpan?* timeout parameter after which the operation will be cancelled.
2525
2626

2727
## Format providers​

0 commit comments

Comments
 (0)