0 votes
by (160 points)

I get an error adding assemblies to Visual Studio 2022:

one or more errors occurred
a task was canceled
a task was canceled
a task was canceled
a task was canceled

Any help would be appreciated...

PS! I was able to add the assemblies by editing the project file.

C:\Program Files (x86)\Rebex Components R6.7\bin\net-6.0\Rebex.Imap.dll


C:\Program Files (x86)\Rebex Components R6.7\bin\net-6.0\Rebex.Common.dll


C:\Program Files (x86)\Rebex Components R6.7\bin\net-6.0\Rebex.Mail.dll


C:\Program Files (x86)\Rebex Components R6.7\bin\net-6.0\Rebex.Networking.dll

But this should not be the preferred way in my opinion.

KKS

Applies to: Rebex Secure Mail
by (148k points)
I just tried this with a newly-created VS 2022 project (a .NET 6.0 console app), and I am unable to reproduce this issue. Where exactly do these error appear, and which version of VS 2022 do you use?

1 Answer

0 votes
by (160 points)

This is the message I get when calling a method that uses the Rebex Secure Email components after adding them in project file as mentioned in OP:

Could not load file or assembly 'Rebex.Imap, Version=6.0.8314.0, Culture=neutral, PublicKeyToken=1c4638788972655d'. The system cannot find the file specified.

In Visual Studio 2022 I cannot add them. This is the info:

dotnet --version
6.0.402

Microsoft Visual Studio Community 2022
Version 17.3.6
VisualStudio.17.Release/17.3.6+32929.385
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA307
Microsoft Visual C++ 2022

ADL Tools Service Provider 1.0
This package contains services used by Data Lake tools

ASA Service Provider 1.0

ASP.NET and Web Tools 17.3.376.3011
ASP.NET and Web Tools

ASP.NET Web Frameworks and Tools 2012 17.3.376.3011
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0 17.3.376.3011
Azure App Service Tools v3.0.0

Azure Data Lake Tools for Visual Studio 2.6.5000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools 17.3.376.3011
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio 2.6.5000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C# Tools 4.3.0-3.22470.13+80a8ce8d5fdb9ceda4101e2acb8e8eb7be4ebcea
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 17.0.22179.3
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Extensibility Message Bus 1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

Linux Core Dump Debugging 1.0.9.32708
Enables debugging of Linux core dumps.

Microsoft Azure Hive Query Language Service 2.6.5000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service 2.6.5000.0
Language service for Azure Stream Analytics

Microsoft Azure Tools for Visual Studio 2.9
Support for Azure Cloud Services projects

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Mono Debugging for Visual Studio 17.3.20 (3f4cb00)
Support for debugging Mono processes with Visual Studio.

Node.js Tools 1.5.40629.1 Commit Hash:3f5cc0329815af3ffb948f08857446d206a9af36
Adds support for developing and debugging Node.js apps in Visual Studio

NuGet Package Manager 6.3.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Office Developer Tools for Visual Studio 17.0.32616.00
Microsoft Office Developer Tools for Visual Studio

Progress Telerik UI for WPF Extension 2022.3.902.1
Progress® Telerik® UI for WPF Extension

Python - Django support 17.0.22179.3
Provides templates and integration for the Django web framework.

Python - Profiling support 17.0.22179.3
Profiling support for Python projects.

Python with Pylance 17.0.22179.3
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Razor (ASP.NET Core) 17.0.0.2232702+e1d654e792aa2fe6646a6935bcca80ff0aff4387
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools 17.0.62207.04100
Microsoft SQL Server Data Tools

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

ToolWindowHostedEditor 1.0
Hosting json editor into a tool window

TypeScript Tools 17.0.10701.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.3.0-3.22470.13+80a8ce8d5fdb9ceda4101e2acb8e8eb7be4ebcea
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual C++ for Cross Platform Mobile Development (Android) 17.0.32708.82
Visual C++ for Cross Platform Mobile Development (Android)

Visual C++ for Cross Platform Mobile Development (iOS) 17.0.32819.101
Visual C++ for Cross Platform Mobile Development (iOS)

Visual C++ for Linux Development 1.0.9.32708
Visual C++ for Linux Development

Visual F# Tools 17.1.0-beta.22363.4+1b94f89d4d1f41f20f9be73c76f4b229d4e49078
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

VisualStudio.DeviceLog 1.0
Information about my package

VisualStudio.Mac 1.0
Mac Extension for Visual Studio

VSPackage Extension 1.0
VSPackage Visual Studio Extension Detailed Info

WiX Toolset Visual Studio Extension 1.0.0.18
WiX Toolset Visual Studio Extension version 1.0.0.18
Copyright (c) .NET Foundation and contributors. All rights reserved.

Workflow Manager Tools 1.0 1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin 17.3.0.308 (d17-3@56b9f7e)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 17.3.0.217 (remotes/origin/d17-3@b81db1dcc0)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin Templates 17.2.28 (9b3d244)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.

Xamarin.Android SDK 13.0.0.0 (d17-3/030cd63)
Xamarin.Android Reference Assemblies and MSBuild support.
Mono: dffa5ab
Java.Interop: xamarin/java.interop/d17-3@7716ae53
SQLite: xamarin/sqlite/3.38.5@df4deab
Xamarin.Android Tools: xamarin/xamarin-android-tools/main@14076a6

Xamarin.iOS and Xamarin.Mac SDK 16.0.0.75 (e4f48bed7)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

And I get an error dialog which says:
one or more errors occurred
a task was canceled
a task was canceled
a task was canceled
a task was canceled

This is very annoying I hope we can find out what is wrong.

by (160 points)
Ok. I discovered that if I unreferenced the other references, then added rebex, then added the others I was able to add the assemblies from rebex.

However I get this error as stated earlier when trying to call a method that references i.e: imap dll, i get this error:
Could not load file or assembly 'Rebex.Imap, Version=6.0.8314.0, Culture=neutral, PublicKeyToken=1c4638788972655d'. The system cannot find the file specified.
by (160 points)
Ok, this last problem. After I did a Clean and build again, the assembly was found at runtime, and everything now works.

A lot of different problems but at least I now can focus on what's important. Code.

KKS
by (148k points)
Thanks for the update!
I'm afraid this problem is not related to Rebex assemblies - it loooks like one of Visual Studio's quirks. See the results of the corresponding Google search:
https://www.google.com/search?q=visual+studio+"a+task+was+canceled"+errors

Usually, cleaning and rebuilding helps. Restoring packages might help as well. Restarting Visual Studio is another commonly-used workaround.

If there was any indication that this is a Rebex issue, we would look into it, but we need to be able to reproduce the issue first.
...