सिस्टम प्राप्त करना। ऑर्ग्यूमेंट अपवाद - घटना के लिए अपरिभाषित कीवर्ड मान 1 का उपयोग करें कार्य के लिए अपरिभाषित कीवर्ड मान 1 का उपयोग करें।ArgumentException - ईवेंट के लिए अपरिभाषित कीवर्ड मान 1 का उपयोग async
वहाँ कुछ गड़बड़ है जब दृश्य स्टूडियो 2013 अद्यतन 3.
मैं WP8.1 यूनिवर्सल और Silverlight क्षुधा के बाद मैं दृश्य स्टूडियो स्थापित उपयोग कर रहा हूँ के साथ एक यूनिवर्सल अनुप्रयोग में पहले इंतजार बयान चल रहा 2013 अद्यतन 3.
अपवाद एमुलेटर/डिवाइस मोड में होता है। मैंने बिना किसी संकल्प के इस मुद्दे पर शोध करने में कुछ दिन बिताए हैं।
मेरे पास विंडोज़ देव केंद्र मंच पर एक भाई लेख है लेकिन मैंने माइक्रोसॉफ्ट से कोई जवाब नहीं सुना है।
कोड सीधे आगे है। एक बार आंतरिक अपवाद फेंकने के बाद, प्रतीक्षा कभी वापस नहीं आती है।
क्या किसी और को async के साथ इन मुद्दों का सामना करना पड़ रहा है ?? संकल्प ?
public async Task<StorageFolder> FolderExists(StorageFolder parent, string folderName)
{
StorageFolder result = null;
try
{
// Exception happens here. The code never returns so the thread hangs
result = await parent.GetFolderAsync(folderName);
}
catch (Exception ex)
{
if (FeishLogger.Logger.IsDebug)
ex.LogException(() => string.Format("FolderExists File: {0}\\{1}", parent.Path, folderName));
}
return result;
}
पूर्ण अपवाद:
System.ArgumentException occurred
_HResult=-2147024809
_message=Use of undefined keyword value 1 for event TaskScheduled.
HResult=-2147024809
IsTransient=false
Message=Use of undefined keyword value 1 for event TaskScheduled.
Source=mscorlib
StackTrace:
at System.Diagnostics.Tracing.ManifestBuilder.GetKeywords(UInt64 keywords, String eventName)
InnerException:
मैं एक नमूना परियोजना उपलब्ध है। एक शेल यूनिवर्सल ऐप बनाना और कुछ प्रतीक्षा कथन जोड़ना समस्या को फिर से शुरू करता है।
private async Task AsyncMethod()
{
Debug.WriteLine("({0:0000} - Sync Debug)", Environment.CurrentManagedThreadId);
// Uncomment this line to make it work
//await Task.Delay(1);
// Fails only if the line above is commented
await Task.Run(() => Debug.WriteLine("({0:0000} - Async Debug)", Environment.CurrentManagedThreadId));
}
यहाँ AsyncMethod
protected override async void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
// TODO: change this value to a cache size that is appropriate for your application
rootFrame.CacheSize = 1;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
#if WINDOWS_PHONE_APP
// Removes the turnstile navigation for startup.
if (rootFrame.ContentTransitions != null)
{
this.transitions = new TransitionCollection();
foreach (var c in rootFrame.ContentTransitions)
{
this.transitions.Add(c);
}
}
rootFrame.ContentTransitions = null;
rootFrame.Navigated += this.RootFrame_FirstNavigated;
#endif
await AsyncMethod();
await AsyncMethods();
await AsyncMethods();
await AsyncMethods();
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
}
मैंने विंडोज फोन एसडीके, एमुलेटर और विजुअल स्टूडियो को हटा दिया है, और पुनः स्थापित किया है। सब कुछ स्थापित करने के बाद भी समस्या बनी रहती है !! कृपया –
में मदद करें मुझे एक ही समस्या का सामना करना पड़ा - क्या आपने इसे काम किया? –
एमएसडीएन फोरम में एक काम है: [माइक्रोसॉफ्ट इसे संबोधित करते समय हैक वर्कअराउंड] (http://social.msdn.microsoft।com/फ़ोरम/windowsapps/en-US/3e505e04-7f30-4313-aa47-275eaef333dd/systemargumentexception-use-of-undefined-keyword-value-1-for-event-functionscheduled-in-async? forum = wpdevelop) –