Git Product home page Git Product logo

Comments (10)

Scighost avatar Scighost commented on June 12, 2024

win7需要安装.NET Framework 4.8运行时,然后就可以运行;
下面两个功能因为用到了win10的系统通知,会有一些问题:
任务提醒:我没有做捕获异常,在win7上会闪退;
米游社签到:不会有通知提醒;
其他功能应该不会受系统影响。

from keqingniuza.

wuguxi5 avatar wuguxi5 commented on June 12, 2024

好的,谢谢

from keqingniuza.

wuguxi5 avatar wuguxi5 commented on June 12, 2024

[2021-10-08 06:51:56.172 | Launcher 2.1.0]
System.Threading.Tasks.TaskCanceledException: 已取消一个任务。
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KeqingNiuza.Launcher.MainWindow.d__39.MoveNext() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\MainWindow.xaml.cs:行号 336
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KeqingNiuza.Launcher.MainWindow.d__38.MoveNext() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\MainWindow.xaml.cs:行号 300
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KeqingNiuza.Launcher.MainWindow.<Window_Loaded>d__36.MoveNext() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\MainWindow.xaml.cs:行号 237
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
在 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Windows.Threading.DispatcherOperation.Invoke()
在 System.Windows.Threading.Dispatcher.ProcessQueue()
在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在 System.Windows.Application.RunDispatcher(Object ignore)
在 System.Windows.Application.RunInternal(Window window)
在 KeqingNiuza.Launcher.App.Main() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\obj\Release\App.g.cs:行号 52

[2021-10-08 06:57:46.265 | Launcher 2.1.0]
System.Threading.Tasks.TaskCanceledException: 已取消一个任务。
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KeqingNiuza.Launcher.MainWindow.d__39.MoveNext() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\MainWindow.xaml.cs:行号 336
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KeqingNiuza.Launcher.MainWindow.d__38.MoveNext() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\MainWindow.xaml.cs:行号 300
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 KeqingNiuza.Launcher.MainWindow.<Window_Loaded>d__36.MoveNext() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\MainWindow.xaml.cs:行号 237
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.DispatcherOperation.InvokeImpl()
在 MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Windows.Threading.DispatcherOperation.Invoke()
在 System.Windows.Threading.Dispatcher.ProcessQueue()
在 System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
在 System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
在 System.Windows.Application.RunDispatcher(Object ignore)
在 System.Windows.Application.RunInternal(Window window)
在 KeqingNiuza.Launcher.App.Main() 位置 D:\a\KeqingNiuza\KeqingNiuza\src\KeqingNiuza.Launcher\obj\Release\App.g.cs:行号 52

from keqingniuza.

wuguxi5 avatar wuguxi5 commented on June 12, 2024

启动器无法打开软件本体,但是从bin目录打开exe可以,以上为日志内容

from keqingniuza.

Lightczx avatar Lightczx commented on June 12, 2024

https://github.com/Scighost/KeqingNiuza/blob/main/src/KeqingNiuza.Launcher/MainWindow.xaml.cs#336

from keqingniuza.

Scighost avatar Scighost commented on June 12, 2024

你这个问题挺有意思,文档上提到了没有TaskCanceledException异常,但你又的确碰到了。
可能是网络问题,试一试这个检查更新的网页能不能打开。

from keqingniuza.

Lightczx avatar Lightczx commented on June 12, 2024

你这个问题挺有意思,文档上提到了没有TaskCanceledException异常,但你又的确碰到了。 可能是网络问题,试一试这个检查更新的网页能不能打开。

GetByteArrayAsync

[__DynamicallyInvokable]
public Task<byte[]> GetByteArrayAsync(Uri requestUri)
{
	return GetContentAsync(requestUri, HttpCompletionOption.ResponseContentRead, HttpUtilities.EmptyByteArray, (HttpContent content) => content.ReadAsByteArrayAsync());
}

GetContentAsync

private Task<T> GetContentAsync<T>(Uri requestUri, HttpCompletionOption completionOption, T defaultValue, Func<HttpContent, Task<T>> readAs)
{
	TaskCompletionSource<T> tcs = new TaskCompletionSource<T>();
	GetAsync(requestUri, completionOption).ContinueWithStandard(delegate(Task<HttpResponseMessage> requestTask)
	{
		if (!HandleRequestFaultsAndCancelation(requestTask, tcs))
		{
			HttpResponseMessage result = requestTask.Result;
			if (result.Content == null)
			{
				tcs.TrySetResult(defaultValue);
			}
			else
			{
				try
				{
					readAs(result.Content).ContinueWithStandard(delegate(Task<T> contentTask)
					{
						if (!HttpUtilities.HandleFaultsAndCancelation(contentTask, tcs))
						{
							tcs.TrySetResult(contentTask.Result);
						}
					});
				}
				catch (Exception exception)
				{
					tcs.TrySetException(exception);
				}
			}
		}
	});
	return tcs.Task;
}

其中,此处可以引起任何异常

try
{
	readAs(result.Content).ContinueWithStandard(delegate(Task<T> contentTask)
	{
		if (!HttpUtilities.HandleFaultsAndCancelation(contentTask, tcs))
		{
			tcs.TrySetResult(contentTask.Result);
		}
	});
}
catch (Exception exception)
{
	tcs.TrySetException(exception);
}

所以是有可能出现TaskCancelException的
微软的文档不能全信

from keqingniuza.

Lightczx avatar Lightczx commented on June 12, 2024
internal static bool HandleFaultsAndCancelation<T>(Task task, TaskCompletionSource<T> tcs)
{
	if (task.IsFaulted)
	{
		tcs.TrySetException(task.Exception.GetBaseException());
		return true;
	}
	if (task.IsCanceled)
	{
		tcs.TrySetCanceled();
		return true;
	}
	return false;
}

from keqingniuza.

wuguxi5 avatar wuguxi5 commented on June 12, 2024

你这个问题挺有意思,文档上提到了没有TaskCanceledException异常,但你又的确碰到了。 可能是网络问题,试一试这个检查更新的网页能不能打开。

能打开

from keqingniuza.

Scighost avatar Scighost commented on June 12, 2024

修复了「已取消一个任务」时的闪退,但是不能保证正常更新。

from keqingniuza.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.