I’m trying to call LoadPickerData method to load the result in a Picker using async/await from the a ViewModel. I get the following error:
Error
System.AggregateException
Message=One or more errors occurred. (A task was canceled.)
Source=mscorlib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs:2027
at System.Threading.Tasks.Task`1[TResult].GetResultCore (System.Boolean waitCompletionNotification) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:496
at System.Threading.Tasks.Task`1[TResult].get_Result () [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/external/corert/src/System.Private.CoreLib/src/System/Threading/Tasks/Future.cs:466
at EmployeeApp.Helpers.ConnectivityHelper.CheckConnectivity () [0x00049] in F:\Workspace\BajaDev\MPA\_Project\EmployeeApp\Helpers\ConnectivityHelper.cs:34
at EmployeeApp.Helpers.ConnectivityHelper.get_IsConnected () [0x00000] in F:\Workspace\BajaDev\MPA\_Project\EmployeeApp\Helpers\ConnectivityHelper.cs:21
at EmployeeApp.ViewModels.BaseViewModel.get_ServiceAreaStore () [0x00000] in F:\Workspace\BajaDev\MPA\_Project\EmployeeApp\ViewModels\BaseViewModel.cs:27
at EmployeeApp.ViewModels.MailboxViewModel.GetPickerServiceArea () [0x0000f] in F:\Workspace\BajaDev\MPA\_Project\EmployeeApp\ViewModels\MailboxViewModel.cs:60
at EmployeeApp.MailboxPage.LoadPickerData () [0x0002b] in F:\Workspace\BajaDev\MPA\_Project\EmployeeApp\Views\MailBoxPage.xaml.cs:70
at EmployeeApp.MailboxPage.OnAppearing () [0x0002c] in F:\Workspace\BajaDev\MPA\_Project\EmployeeApp\Views\MailBoxPage.xaml.cs:31
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <06692e0cad5848598a0f46942a89e99f>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <06692e0cad5848598a0f46942a89e99f>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00009] in <06692e0cad5848598a0f46942a89e99f>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.44(intptr,intptr)
I’m trying to load the result of a GET request in a picker, but when I start the app the first time, it does not and I get the previous exception and the second time I run it I no longer get that error.
I looked for why and I was making the call of an asynchronous method in a constructor and that is bad code, I changed it to an OnAppearing () method but still that exception keeps coming out and I don’t have idea the why yet
MailboxPage.xaml.cs
public MailboxPage()
{
InitializeComponent();
BindingContext = viewModel = new MailboxViewModel();
}
protected override async void OnAppearing()
{
base.OnAppearing();
await LoadPickerData();
}
private async Task<IEnumerable<ServiceArea>> LoadPickerData()
{
var vm = new MailboxViewModel();
var servicesareas = await vm.GetPickerServiceArea();
try
{
ServiceAreaPicker.ItemsSource = servicesareas.ToList();
ServiceAreaPicker.ItemDisplayBinding = new Binding("Name");
}
catch(AggregateException ae)
{
foreach (var e in ae.Flatten().InnerExceptions)
{
Debug.WriteLine($"{e.GetType().FullName} { e.Message}");
}
}
return servicesareas;
}
MailboxViewModel.cs
public async Task<IEnumerable<ServiceArea>> GetPickerServiceArea()
{
try
{
PickerItems = await ServiceAreaStore.GetPickerItemsAsync(true);
foreach (var item in PickerItems)
Items.Add(item);
}
catch (AggregateException ae)
{
foreach (var e in ae.Flatten().InnerExceptions)
{
Debug.WriteLine($"{e.GetType().FullName} { e.Message}");
}
}
return PickerItems;
}
ServiceAreaStoreAPI.cs
public async Task<IEnumerable<ServiceArea>> GetPickerItemsAsync(bool forceRefresh = false)
{
if (forceRefresh)
{
var json = await Client.GetStringAsync($"api/servicearea");
Servicesareas = await Task.Run(() => JsonConvert.DeserializeObject<IEnumerable<ServiceArea>>(json));
try
{
var success = LocalDatabase.AddItemsAsync(Servicesareas);
if (!success.Result)
{
//Log de fallo en la insercion de datos.
}
}
catch(AggregateException ae)
{
foreach (var e in ae.Flatten().InnerExceptions)
{
Debug.WriteLine($"{e.GetType().FullName} { e.Message}");
}
}
}
return Servicesareas;
}
Пытаюсь опубликовать консольное приложение .Net Core 3.0 и ловлю ошибку:
27.11.2019 14:36:40 System.AggregateException: One or more errors occurred. —> System.Exception: Publishing failed. — End of
inner exception stack trace — at
System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
includeTaskCanceledExceptions) at
System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout,
CancellationToken cancellationToken) at
Microsoft.Publish.Framework.Model.DefaultPublishSteps.<>c__DisplayClass26_0.b__2()
at System.Threading.Tasks.Task`1.InnerInvoke() at
System.Threading.Tasks.Task.Execute()
— End of stack trace from previous location where exception was thrown — at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Publish.Framework.Model.DefaultPublishSteps.d__23.MoveNext()
— End of stack trace from previous location where exception was thrown — at
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task
task) at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task) at
Microsoft.Publish.Framework.ViewModel.ProfileSelectorViewModel.d__202.MoveNext()
—> (Inner Exception #0) System.Exception: Publishing failed.<—System.Exception: Publishing failed.
===================
Если через консоль собирать dotnet publish -r win-x64
, то ошибки про обнаружение понижения версии пакета…:
С чем она может быть связана?
задан 27 ноя 2019 в 11:45
iluxa1810iluxa1810
24.8k12 золотых знаков63 серебряных знака156 бронзовых знаков
Она может быть связана с тем, что разные библиотеки, используемые приложением, в свою очередь используют разные версии одного и того же пакета. Выполните консолидацию пакетов для вашего решения с помощью: (RKM) контекстное меню решения -> Управление пакетами Nuget для решения -> Консолидировать
ответ дан 2 дек 2019 в 10:09
- Remove From My Forums
-
Question
-
From @riverokellerman via Twitter:
We are getting strange errors with our systems in productions, related to documentDB.
The errors we are getting are:
System.AggregateException: One or more errors occurred. —> System.InvalidOperationException: The request message was already sent. Cannot send the same request message multiple times.
at
System.Net.Http.HttpClient.CheckRequestMessage(HttpRequestMessage request)
at
System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
at
Microsoft.Azure.Documents.Client.GatewayProxy.<>c__DisplayClass1f.<<InvokeAsync>b__1e>d__21.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass2.<<ExecuteAsync>b__1>d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetry>d__16.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.GatewayProxy.<InvokeAsync>d__2c.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.GatewayProxy.<ReadFeedAsync>d__1a.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.DocumentClient.<ExecuteQueryAsync>d__2cb.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at
Microsoft.Azure.Documents.Linq.DocumentQueryExecutionContext.<ExecuteOnceAsync>d__c.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass2.<<ExecuteAsync>b__1>d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetry>d__16.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Linq.DocumentQuery`1.<ExecuteNextPrivateAsync>d__3`1.MoveNext()
— End of inner exception stack trace —
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout)
at System.Threading.Tasks.Task.WaitAll(Task[] tasks)Here is another one: System.AggregateException: One or more errors occurred. —>
System.Net.Http.HttpRequestException: An error occurred while sending the request. —>
System.Net.WebException: Unable to connect to the remote server —>
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed
to respond 191.237.32.44:443
at
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
at
System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
— End of inner exception stack trace —
at
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at
System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar)
— End of inner exception stack trace —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.GatewayServiceConfigurationReader.<InitializeAsync>d__0.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.DocumentClient.<DeduceConsistencyLevelAsync>d__2e2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.DocumentClient.<GetInitializationTask>d__1b.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.DocumentClient.<EnsureValidClientAsync>d__20.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Client.DocumentClient.<ExecuteQueryAsync>d__2cb.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at
Microsoft.Azure.Documents.Linq.DocumentQueryExecutionContext.<ExecuteOnceAsync>d__c.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<>c__DisplayClass2.<<ExecuteAsync>b__1>d__4.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteRetry>d__16.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.BackoffRetryUtility`1.<ExecuteAsync>d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Linq.DocumentQueryExecutionContext.<ExecuteAllAsync>d__7.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at
Microsoft.Azure.Documents.Linq.DocumentQuery`1.<GetEnumeratorTAsync>d__10.MoveNext()
— End of inner exception stack trace —
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)
at System.Threading.Tasks.Task`1.get_Result()
at
Microsoft.Azure.Documents.Linq.DocumentQuery`1.GetEnumerator()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Leadbox.DataAccess.CustomerRepository.ReadByLeadId(Guid id) inThanks!
@AzureSupport
-
Edited by
Tuesday, March 22, 2016 5:49 PM
-
Edited by
Answers
-
This was fixed in 1.5.2 of the .NET SDK for DocumentDB. Please update your SDK.
-
Proposed as answer by
Ryan CrawCour [MSFT]
Tuesday, March 29, 2016 8:28 PM -
Marked as answer by
Han, MSFT
Friday, September 30, 2016 10:47 PM
-
Proposed as answer by
We are here once again to help you debug common .NET exceptions. This time I want to help you debug the rather generic System.AggregateException. As the name implies, AggregateException
is used to batch one or more exceptions together in a single exception. In this post, I’ll show you why this exception occurs and how to debug it in your C# code.
Causing and handling the error
Let’s start by forcing a new AggregateException
. The exception is used heavily in .NET’s Task libraries, why choosing an example involving tasks is a no-brainer:
Task task1 = Task.Factory.StartNew(() => { throw new ArgumentException(); } );
Task task2 = Task.Factory.StartNew(() => { throw new UnauthorizedAccessException(); } );
try
{
Task.WaitAll(task1, task2);
}
catch (AggregateException ae)
{
}
In the example above, we spin up two tasks, each throwing an exception. By calling WaitAll
we tell .NET to invoke and wait for a result from each of the two tasks. The combined result of the two tasks will be an AggregateException
.
You’ve probably come to this article because of one of the following error messages:
- System.AggregateException: One or more errors occurred.
- A task was canceled
- ‘System.AggregateException’ occurred in mscorlib.dll
In the following section, I will show you how to debug and fix each.
Debugging the error
When inspecting the exception from the previous example in the debugger, we see the two thrown exceptions in the InnerExceptions
property:
Just as promised in the name, AggregateException
is a wrapper of other exceptions. In the example, both the ArgumentException
and the UnauthorizedAccessException
is available as inner exceptions.
In some scenarios you would add a catch blog per exception like this:
try
{
...
}
catch (ArgumentException ex1)
{
// Log and re-throw
}
catch (UnauthorizedAccessException ex2)
{
// Log and swallow
}
This way, you can generate individual error messages to the user, log the exception but only re-throw one of them, or something third. Rather than looping over each exception in the InnerExceptions
property, AggregateException
provides a handy little helper method named Handle
:
try
{
...
}
catch (AggregateException ae)
{
ae.Handle(inner =>
{
// Log inner
...
return inner is UnauthorizedAccessException;
});
}
In the example, the Handle
method logs each exception. The func
needs to return a bool
indicating if each exception has been handled. In this case, we tell the Handle
method that the UnauthorizedAccessException
is handled, but not the ArgumentException
. This will cause the AggregateException
to be thrown back to the calling code, but without the UnauthorizedAccessException
in the InnerExceptions
property (because we marked that exception as already handled).
AggregateExceptions from HttpClient
When dealing with the System.Net.Http.HttpClient
class, you may experience the AggregateException
. This is mostly when implementing async code using the old API (Wait
, ContinueWith
, etc.). Let’s look at an example:
try
{
var client = new HttpClient();
var task = client.GetStringAsync("https://httpstat.us/500");
task.Wait();
var result = task.Result;
}
catch (AggregateException ex)
{
throw ex;
}
The request to https://httpstat.us/500
returns an HTTP status code of 500
which throws a HttpRequestException. I’m using the GetStringAsync
method as an example, but the code would look similar if using other async messages like PostAsync
. As we saw previously, exceptions from the tasks API are wrapped in an AggregateException
, containing the HTTP exception in the InnerExceptions
property.
To get the actual exception, you have a range of options. I’ll re-use the need for logging the exception to illustrate. Let’s start with the Handle
method I showed you in a previous example:
try
{
...
}
catch (AggregateException ex)
{
ex.Handle(inner =>
{
if (inner is HttpRequestException)
{
// Log the exception
return true;
}
return false;
});
}
I’m checking if the inner exception is of type HttpRequestException
and in that case tell the Handle
method that this exception has been handled. In any other scenario, I tell Handle
to re-throw the original exception (by returning false
).
Another approach will be to use the ContinueWith
method to catch and handle the AggregateException
:
var client = new HttpClient();
var task = client
.GetStringAsync("https://httpstat.us/500")
.ContinueWith(t =>
{
try
{
return t.Result;
}
catch (AggregateException ex)
{
ex.Handle(inner =>
{
if (inner is HttpRequestException)
{
// Log the exception
return true;
}
return false;
});
}
catch (Exception ex)
{
throw ex;
}
return null;
});
task.Wait();
var result = task.Result;
I’ve basically just moved the try/catch from before inside the ContinueWith
method.
Finally, if you are on .NET 4.5 (you probably are and if not, you should be) you can use the await
keyword:
var client = new HttpClient();
try
{
var result = await client.GetStringAsync("https://httpstat.us/500");
}
catch (HttpRequestException ex)
{
// Log the exception
}
catch (Exception ex)
{
throw ex;
}
Notice how the code catches HttpRequestException
instead of AggregateException
. This is because .NET automatically unwraps the AggregateException
and throws the underlying exception instead. This is what you want in most cases. Yet another benefit of porting existing async code to use the await
keyword.
Also make sure to read the other posts in this series: Debugging common .NET exception.
elmah.io: Error logging and Uptime Monitoring for your web apps
This blog post is brought to you by elmah.io. elmah.io is error logging, uptime monitoring, deployment tracking, and service heartbeats for your .NET and JavaScript applications. Stop relying on your users to notify you when something is wrong or dig through hundreds of megabytes of log files spread across servers. With elmah.io, we store all of your log messages, notify you through popular channels like email, Slack, and Microsoft Teams, and help you fix errors fast.
See how we can help you monitor your website for crashes
Monitor your website
3 / 3 / 1 Регистрация: 09.08.2020 Сообщений: 46 |
|
1 |
|
VS 2019 Ошибка при публикации22.09.2021, 17:44. Показов 8697. Ответов 7
Уважаемые пользователи, почему возникает данная ошибка? Не могу опубликовать проект. В файле «tmp4D94»: Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.
0 |
2189 / 2102 / 468 Регистрация: 17.02.2019 Сообщений: 3,495 |
|
22.09.2021, 18:14 |
2 |
А что пишут в
0 |
3 / 3 / 1 Регистрация: 09.08.2020 Сообщений: 46 |
|
22.09.2021, 18:16 [ТС] |
3 |
January29, вот: Microsoft.WebTools.Shared.Exceptions.WebToolsException: При публикации произошла ошибка. Не удалось определить причину ошибки. Дополнительные сведения см. в журнале вывода.
0 |
2189 / 2102 / 468 Регистрация: 17.02.2019 Сообщений: 3,495 |
|
22.09.2021, 19:46 |
4 |
Yes Chad, На всякий случай сделайте бэкап проекта Добавлено через 16 минут
1 |
3 / 3 / 1 Регистрация: 09.08.2020 Сообщений: 46 |
|
22.09.2021, 19:52 [ТС] |
5 |
January29, к сожалению, данный способ не помог. К слову, данная ошибка возникает в любом (даже пустом) проекте.
0 |
2189 / 2102 / 468 Регистрация: 17.02.2019 Сообщений: 3,495 |
|
22.09.2021, 20:43 |
6 |
Вот только сейчас опубликовал. Все норм. Ну да ладно. Не по теме: Будем думу думать.
1 |
2189 / 2102 / 468 Регистрация: 17.02.2019 Сообщений: 3,495 |
|
26.09.2021, 22:51 |
7 |
Yes Chad,как то так пишут. Решение:
Эта ошибка возникает, когда, по крайней мере, насколько мне известно, в Visual Studio 2019 были текущие обновления. Когда я столкнулся с этой ошибкой, у меня были другие приложения в решении, похоже, что Visual Studio испытывает проблемы при создании других проектов, включенных в то же решение. Если вам нужно узнать больше о вашем конкретном сценарии проекта, проверьте окно вывода в Visual Studio на наличие сведений об ошибках. Это полезно при диагностике проблемы, например, в ошибке, зарегистрированной в консоли вывода (Сборка + IntelliSense), может быть указано: «Платформа RuntimeIdentifier» win-x64 «и платформа X86 должны быть совместимы», тогда вы будете знать, что вам нужна одна и та же платформа как в профиле платформы, так и в профиле публикации.
0 |
3 / 3 / 1 Регистрация: 09.08.2020 Сообщений: 46 |
|
26.09.2021, 23:05 [ТС] |
8 |
Сообщение было отмечено January29 как решение РешениеЯ нашел решение. Nuget.org начал принудительно использовать TLS 1.2 (и отказался от поддержки TLS 1.1 и 1.0) в начале 2020-го года. Это и вызывало ошибку при публикации приложения в Visual Studio. В Windows 7 TLS 1.2 по умолчанию отключен, однако его можно включить.
1 |
IT_Exp Эксперт 87844 / 49110 / 22898 Регистрация: 17.06.2006 Сообщений: 92,604 |
26.09.2021, 23:05 |
Помогаю со студенческими работами здесь Ошибка при публикации приложения MVC с базой MS SQL Server подход Database First Стала возникать «Ошибка при создании формы» после публикации Ошибка публикации приложения Ошибка публикации приложения Ошибка после публикации сайта на Somee.com Ошибка 500 на хосте, после публикации сайта Ошибка браузера CefSharp после публикации проекта Искать еще темы с ответами Или воспользуйтесь поиском по форуму: 8 |