powered by simpleCommunicator - 2.0.27     © 2024 Programmizd 02
Map
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Тип существует в двух библиотеках
2 сообщений из 2, страница 1 из 1
Тип существует в двух библиотеках
    #40081695
Фотография Roust_m
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Добрый день,

Пытаюсь воспроизвести код из этой статьи:
https://medium.com/dataseries/using-windows-10-built-in-ocr-with-c-b5ca8665a14e


Получаю ошибку:
Severity Code Description Project File Line Suppression State
Error NETSDK1135 SupportedOSPlatformVersion 10.0.19041.0 cannot be higher than TargetPlatformVersion 7.0. OCR C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets 185

Делаю шаги из этого поста:
https://github.com/dotnet/sdk/issues/14591

Вылазят еще ошибки:
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'Language' exists in both 'Microsoft.Windows.SDK.NET, Version=10.0.19041.10, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Windows.Foundation.UniversalApiContract, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' OCR C:\Users\MyUserName\source\repos\OCR\OCR\UserControl1.cs 24 Active
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'OcrEngine' exists in both 'Microsoft.Windows.SDK.NET, Version=10.0.19041.10, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Windows.Foundation.UniversalApiContract, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' OCR C:\Users\MyUserName\source\repos\OCR\OCR\UserControl1.cs 26 Active
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'BitmapDecoder' exists in both 'Microsoft.Windows.SDK.NET, Version=10.0.19041.10, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Windows.Foundation.UniversalApiContract, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' OCR C:\Users\MyUserName\source\repos\OCR\OCR\UserControl1.cs 31 Active
Severity Code Description Project File Line Suppression State
Error CS0121 The call is ambiguous between the following methods or properties: 'System.IO.WindowsRuntimeStreamExtensions.AsRandomAccessStream(System.IO.Stream)' and 'System.IO.WindowsRuntimeStreamExtensions.AsRandomAccessStream(System.IO.Stream)' OCR C:\Users\MyUserName\source\repos\OCR\OCR\UserControl1.cs 31 Active
Severity Code Description Project File Line Suppression State
Error CS0433 The type 'OcrEngine' exists in both 'Microsoft.Windows.SDK.NET, Version=10.0.19041.10, Culture=neutral, PublicKeyToken=31bf3856ad364e35' and 'Windows.Foundation.UniversalApiContract, Version=10.0.0.0, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime' OCR C:\Users\MyUserName\source\repos\OCR\OCR\UserControl1.cs 33 Active
Severity Code Description Project File Line Suppression State
Error NETSDK1005 Assets file 'C:\Users\MyUserName\source\repos\OCR\OCR\obj\project.assets.json' doesn't have a target for 'net5.0-windows10.0.19041.0'. Ensure that restore has run and that you have included 'net5.0-windows10.0.19041.0' in the TargetFrameworks for your project. OCR C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets 241
Severity Code Description Project File Line Suppression State
Warning MSB3245 Could not resolve this reference. Could not locate the assembly "Windows.Management.Orchestration.OrchestrationContract". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. OCR C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2182


Я использую C# и Visual Studio 2019.

Как это можно поправить?

Спасибо.
...
Рейтинг: 0 / 0
Тип существует в двух библиотеках
    #40081804
Сон Веры Павловны
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Если неймспейсы у классов разные - просто в секции using указать импорт нужного неймспейса, или класса целиком.
Если у классов совпадают и неймспейсы - для сборок задать алиасы (см. здесь ), и импортироваться неймспейс с префиксом алиаса.
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / WinForms, .Net Framework [игнор отключен] [закрыт для гостей] / Тип существует в двух библиотеках
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Найденые пользователи ...
Разблокировать пользователей ...
Читали тему (0):
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]