# How to Upgrade

## From version 10.x

To upgrade from version 10.x to 11.x, we recommend you to take the following steps.

### 1. Update the License Key

#### Request a 30-Day Free Trial License

Visit the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=docs){:target="_blank"} page to obtain a 30-day free license. This option is ideal for initial evaluation or testing of new SDK features.

#### Annual Online Full License

If you are using an Annual Online Full License, your license will continue to work with the current SDK version without the need for updates. Go to <a href="https://www.dynamsoft.com/customer/license/fullLicense" target="_blank">Customer Portal</a> to get your license key.

#### Perpetual License

For users with a Perpetual License, please contact our sales team to update your license. You can reach out through our [Contacting Us](https://www.dynamsoft.com/contact){:target="_blank"} page for assistance.

### 2. Update the Nuget Package

This guide uses the Visual Studio GUI as an example to show how to update the package.
- Open your project in Visual Studio.
- In the **Solution Explorer**, right-click your project and select "**Manage NuGet Packages...**".
- Go to the "**Updates**" tab.
- Find `Dynamsoft.DotNet.BarcodeReader.Bundle` in the list of upgradable packages.
- Click "**Update**" to install the latest version.

### 3. Migrate Your Templates

The template system is upgraded. The template you used for the previous version can't be directly recognized by the new version. Please use the <a href="https://www.dynamsoft.com/tools/template-upgrade/" target="_blank">template upgrade tool</a> to upgrade your template.

### 4. Rebuild the Project

After updating the SDK files, clean and rebuild your project to ensure all dependencies are properly linked and to avoid potential compatibility issues.

## From version 9.x or earlier

Dynamsoft Barcode Reader SDK has been refactored to integrate with [DynamsoftCaptureVision (DCV)](https://www.dynamsoft.com/capture-vision/docs/core/architecture/index.md) architecture since version 10. To upgrade from version 9.x or earlier to 11.x, we recommend you to follow the [User Guide](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/user-guide.md) and re-write your codes. This section highlights only the key changes and necessary actions for upgrading the SDK.

### Update the License Key

#### Request a 30-Day Free Trial License

Visit the [Request a Trial License](https://www.dynamsoft.com/customer/license/trialLicense?product=dbr&utm_source=docs){:target="_blank"} page to obtain a 30-day free license. This option is ideal for initial evaluation or testing of new SDK features.

#### Annual Online Full License

If you are using an Annual Online Full License, your license will continue to work with the current SDK version without the need for updates. Go to <a href="https://www.dynamsoft.com/customer/license/fullLicense" target="_blank">Customer Portal</a> to get your license key.

#### Perpetual License

For users with a Perpetual License, please contact our sales team to update your license. You can reach out through our [Contacting Us](https://www.dynamsoft.com/contact){:target="_blank"} page for assistance.


### Migrate to New Package

As of version 10.0, the nuget package `Dynamsoft.DotNet.Barcode` has been renamed to `Dynamsoft.DotNet.BarcodeReader.Bundle` to reflect changes in both architecture and API design. Start command prompt and run the following command to install the new package.

```
NuGet\Install-Package Dynamsoft.DotNet.BarcodeReader.Bundle
```

### Update the License Activation Code

Starting from 10.0, we have unified the API for setting licenses across different Dynamsoft products.

| Old APIs | New APIs |
| :----------- | :------- |
| `BarcodeReader.InitLicense` | [LicenseManager.InitLicense](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/license/license-manager.md#initlicense) |

### Update Single Image Decoding APIs

The APIs for decoding single image have been adjusted as follows:

| Old APIs | New APIs |
| :----------- | :------- |
| `BarcodeReader.DecodeFile` | [CaptureVisionRouter.Capture(string filePath, string templateName="")](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/single-file-processing.md#capture) |
| `BarcodeReader.DecodeFileInMemory` | [CaptureVisionRouter.Capture(byte[] fileBytes, string templateName="")](/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/single-file-processing.html#capture) |
| `BarcodeReader.DecodeBuffer` | [CaptureVisionRouter.Capture(ImageData imageData, string templateName="")](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/single-file-processing.md#capture) |
| `class TextResult` | [class BarcodeResultItem](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/barcode-result-item.md) |
| `BarcodeReader.DecodeBase64String` | **Currently not available**. |
| `BarcodeReader.DecodeBitmap` | **Currently not available**. |

### Update Video Streaming Decoding Code

`ImageSourceAdapter` is added to replace the `FrameDecodeingParameters` and the previous video methods. You should implement `ImageSourceAdapter` to transfer image data from camera or video file to buffer.


### Migrate Your Templates

The template system is upgraded. The template you used for the previous version can't be directly recognized by the new version. Please use the <a href="https://www.dynamsoft.com/tools/template-upgrade/" target="_blank">template upgrade tool</a> to upgrade your template.

The template-based APIs have been updated as follows:

| Old APIs | New APIs |
| :----------- | :------- |
| `BarcodeReader.InitRuntimeSettingsWithFile` | [CaptureVisionRouter.InitSettingsFromFile](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#initsettingsfromfile) |
| `BarcodeReader.InitRuntimeSettingsWithString` | [CaptureVisionRouter.InitSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#initsettings) |
| `BarcodeReader.OutputSettingsToFile` | [CaptureVisionRouter.OutputSettingsToFile](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#outputsettingstofile) |
| `BarcodeReader.OutputSettingsToString` | [CaptureVisionRouter.OutputSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#outputsettings) |
| `BarcodeReader.ResetRuntimeSettings` | [CaptureVisionRouter.ResetSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#resetsettings) |
| `BarcodeReader.AppendTplFileToRuntimeSettings` | **Not available**. |
| `BarcodeReader.AppendTplStringToRuntimeSettings` | **Not available**. |
| `BarcodeReader.GetAllParameterTemplateNames` | **Not available**. |

### Migrate Your PublicRuntimeSettings

The struct `PublicRuntimeSettings` has been refactored. It retains commonly used properties via `SimplifiedCaptureVisionSettings` while removing the previously complex property settings, which are now exclusively supported through templates.

The APIs for accessing and updating `PublicRuntimeSettings` have been adjusted as follows:

| Old APIs | New APIs |
| :----------- | :------- |
| `BarcodeReader.GetRuntimeSettings` | [CaptureVisionRouter.GetSimplifiedSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#getsimplifiedsettings) |
| `BarcodeReader.UpdateRuntimeSettings` | [CaptureVisionRouter.UpdateSettings](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/settings.md#updatesettings) |

#### Migrate to SimplifiedCaptureVisionSettings

The following properties are replaced by similar properties under `SimplifiedCaptureVisionSettings`. They can also be set via a template file(String).

| PublicRuntimeSettings Property | SimplifiedCaptureVisionSettings Parameter | Template File Parameter |
| ------------------------------- | ----------------------------------------- | ----------------------- |
| `Region` | [roi](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.md#roi) & [roiMeasuredInPercentage](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.md#roimeasuredinpercentage) | [TargetROIDef.Location.Offset](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/target-roi-def/location.md) |
| `Timeout` | [timeout](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/capture-vision-router/auxiliary-classes/simplified-capture-vision-settings.md#timeout) | [CaptureVisionTemplates.Timeout](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/capture-vision-template/timeout.md) |

#### Migrate to SimplifiedBarcodeReaderSettings

The following properties are replaced by similar properties under `SimplifiedBarcodeReaderSettings`. The majority of them can also be set via a template file(String).

| PublicRuntimeSettings Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
| ------------------------------- | ----------------------------------------- | ----------------------- |
| `MinBarcodeTextLength` | [minBarcodeTextLength](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#minbarcodetextlength) | [BarcodeFormatSpecification.BarcodeTextLengthRangeArray](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-format-specification/barcode-text-length-range-array.md) |
| `MinResultConfidence` | [minResultConfidence](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#minresultconfidence) | [BarcodeFormatSpecification.MinResultConfidence](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-format-specification/min-result-confidence.md) |
| `LocalizationModes` | [localizationModes](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#localizationmodes) | [BarcodeReaderTaskSetting.LocationModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/localization-modes.md) |
| `ExpectedBarcodesCount` | [expectedBarcodesCount](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#expectedbarcodescount) | [BarcodeReaderTaskSetting.ExpectedBarcodesCount](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/expected-barcodes-count.md) |
| `BarcodeFormatIds` | [barcodeFormatIds](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#barcodeformatids) | [BarcodeReaderTaskSetting.BarcodeFormatIds](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/barcode-format-ids.md) |
| `BarcodeFormatIds_2` | [barcodeFormatIds](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#barcodeformatids) | [BarcodeReaderTaskSetting.BarcodeFormatIds](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/barcode-format-ids.md) |
| `DeblurModes` | [deblurModes](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#deblurmodes) | [BarcodeReaderTaskSetting.DeblurModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/deblur-modes.md) |
| `DeblurLevel` | [deblurModes](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#deblurmodes) | [BarcodeReaderTaskSetting.DeblurModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/deblur-modes.md) |
| `MaxAlgorithmThreadCount` | [maxThreadsInOneTask](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#maxthreadsinonetask) | [BarcodeReaderTaskSetting.MaxThreadsInOneTask](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/max-threads-in-one-task.md) |

> Remarks:
>
> * The 2 groups of barcode formats are merged.
> * `DeblurLevel` is deprecated. You can use `DeblurModes` instead.

| FurtherModes Property | SimplifiedBarcodeReaderSettings Property | Template File Parameter |
| ---------------------- | ----------------------------------------- | ----------------------- |
| `GrayscaleTransformationModes` | [grayscaleTransformationModes](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#grayscaletransformationmodes) | [ImageParameter.GrayscaleTransformationModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/grayscale-enhancement-modes.md) |
| `ImagePreprocessingModes` | [grayscaleEnhancementModes](https://www.dynamsoft.com/barcode-reader/docs/server/programming/dotnet/api-reference/simplified-barcode-reader-settings.md#grayscaleenhancementmodes) | [ImageParameter.GrayscaleEnhancementModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/grayscale-transformation-modes.md) |

> Remarks: The mode `IPM_MORPHOLOGY` of `ImagePreprocessingModes` is migrated to `BinarizationModes`. The mode arguments `MorphOperation`, `MorphOperationKernelSizeX`, `MorphOperationKernelSizeY`, `MorphShape` are now available for all modes of `BinarizationModes`.

#### Migrate to Template File

The following properties can only be set via a template file. Please call `BarcodeReader.OutputSettingsToFile` first with the old version to export the settings and then use the <a href="https://www.dynamsoft.com/tools/template-upgrade/" target="_blank">template upgrade tool</a> to upgrade your template.

| PublicRuntimeSettings Property | Template File Parameter |
| ------------------------------- | ----------------------- |
| `ScaleDownThreshold` | [ImageParameter.ImageScaleSettings](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/image-scale-settings.md) |
| `BinarizationModes` | [ImageParameter.BinarizationModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/binarization-modes.md) |
| `TextResultOrderModes` | [BarcodeReaderTaskSetting.TextResultOrderModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/text-result-order-modes.md) |
| `ReturnBarcodeZoneClarity` | [BarcodeReaderTaskSetting.ReturnBarcodeZoneClarity](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/return-barcode-zone-clarity.md) |
| `ScaleUpModes` | [BarcodeReaderTaskSetting.BarcodeScaleModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/barcode-scale-modes.md) |
| `BarcodeZoneMinDistanceToImageBorders` | [BarcodeFormatSpecification.BarcodeZoneMinDistanceToImageBorders](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-format-specification/barcode-zone-min-distance-to-image-borders.md) |
| `TerminatePhase` | [BarcodeReaderTaskSetting.TerminateSettings](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/terminate-setting.md) |

| FurtherModes Property | Template File Parameter |
| ---------------------- | ----------------------- |
| `ColourConversionModes` | [ImageParameter.ColourConversionModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/colour-conversion-modes.md) |
| `RegionPredetectionModes` | [BarcodeReaderTaskSetting.RegionPredetectionModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/region-predetection-modes.md) |
| `TextureDetectionModes` | [ImageParameter.TextureDetectionModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/texture-detection-modes.md) |
| `TextFilterModes` | [ImageParameter.TextDetectionMode](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/text-detection-mode.md) & [ImageParameter.IfEraseTextZone](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/image-parameter/if-erase-text-zone.md) |
| `DPMCodeReadingModes` | [BarcodeReaderTaskSetting.DPMCodeReadingModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/dpm-code-reading-modes.md) |
| `DeformationResistingModes` | [BarcodeReaderTaskSetting.DeformationResistingModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/deformation-resisting-modes.md) |
| `BarcodeComplementModes` | [BarcodeReaderTaskSetting.BarcodeComplementModes](https://www.dynamsoft.com/capture-vision/docs/core/parameters/reference/barcode-reader-task-settings/barcode-complement-modes.md) |

#### Migrate to Other APIs

The PDF properties of PublicRuntimeSettings are moved to set via the `setPDFReadingParameter` method of `DirectoryFetcher` and `FileFetcher` with a [PDFReadingParameter](https://www.dynamsoft.com/capture-vision/docs/server/programming/dotnet/api-reference/core/basic-classes/pdf-reading-parameter.md) parameter.

| PublicRuntimeSettings Property |
| --------------------------------------- |
| `PDFReadingMode` |
| `PDFRasterDPI` |

The `Intermediate Result` system is redesigned and the following properties are deprecated.

| PublicRuntimeSettings Property |
| --------------------- |
| `IntermediateResultTypes` |
| `IntermediateResultSavingMode` |

#### Removed

The following properties are removed.

| PublicRuntimeSettings Property|
| --------------------- |
| `barcodeColourModes` |
| `resultCoordinateType` |
| `terminatePhase` |

| FurtherModes Property|
| --------------------- |
| `ColourClusteringModes` |
