|
Тип существует в двух библиотеках
|
|||
---|---|---|---|
#18+
Добрый день, Пытаюсь воспроизвести код из этой статьи: 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. Как это можно поправить? Спасибо. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.07.2021, 07:20 |
|
Тип существует в двух библиотеках
|
|||
---|---|---|---|
#18+
Если неймспейсы у классов разные - просто в секции using указать импорт нужного неймспейса, или класса целиком. Если у классов совпадают и неймспейсы - для сборок задать алиасы (см. здесь ), и импортироваться неймспейс с префиксом алиаса. ... |
|||
:
Нравится:
Не нравится:
|
|||
05.07.2021, 14:29 |
|
|
start [/forum/topic.php?fid=20&msg=40081804&tid=1398262]: |
0ms |
get settings: |
17ms |
get forum list: |
15ms |
check forum access: |
1ms |
check topic access: |
1ms |
track hit: |
36ms |
get topic data: |
9ms |
get forum data: |
1ms |
get page messages: |
149ms |
get tp. blocked users: |
1ms |
others: | 311ms |
total: | 541ms |
0 / 0 |