【发布时间】:2018-01-26 04:51:24
【问题描述】:
我正在开发 Xamarin 提供的 AzureStorage 云解决方案。 https://developer.xamarin.com/guides/xamarin-forms/cloud-services/storage/azure-storage/
这就是我在 GetContainer() 方法中得到的。
类型初始化器 'Microsoft.WindowsAzure.Storage.CloudStorageAccount' 抛出了一个 异常
我在示例项目中应用了我的连接字符串并且它有效,但在我自己的项目中却没有。
有人遇到过这个问题吗?请帮我。
提前致谢。
错误信息:
System.TypeInitializationException: The type initializer for 'Microsoft.WindowsAzure.Storage.CloudStorageAccount' threw an exception. ---> System.NotImplementedException: The method or operation is not implemented.
at Microsoft.WindowsAzure.Storage.CloudStorageAccount.Setting (System.String name, System.String[] validValues) [0x00000] in <667a5fa37f124e50ab7a68ecb3437b13>:0
at Microsoft.WindowsAzure.Storage.CloudStorageAccount..cctor () [0x00000] in <667a5fa37f124e50ab7a68ecb3437b13>:0
--- End of inner exception stack trace ---
at MyTenantWorld.AzureStorage.GetContainer (MyTenantWorld.ContainerType containerType) [0x00020] in <9816076ee17d42efaf1050c5169a4310>:0
at MyTenantWorld.AzureStorage+<UploadFileAsync>d__3.MoveNext () [0x0001a] in <9816076ee17d42efaf1050c5169a4310>:0
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <3fd174ff54b146228c505f23cf75ce71>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <3fd174ff54b146228c505f23cf75ce71>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <3fd174ff54b146228c505f23cf75ce71>:0
at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0
at MyTenantWorld.SettingsPage+<SaveData>d__20.MoveNext () [0x00309] in <9816076ee17d42efaf1050c5169a4310>:0
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <3fd174ff54b146228c505f23cf75ce71>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_0 (System.Object state) [0x00000] in <3fd174ff54b146228c505f23cf75ce71>:0
at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <d855bac285f44dda8a0d8510b679b1e2>:0
at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <d855bac285f44dda8a0d8510b679b1e2>:0
at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <d855bac285f44dda8a0d8510b679b1e2>:0
at at (wrapper dynamic-method) System.Object:a4fed05a-cd7a-4756-85bb-5dd975374042 (intptr,intptr)
【问题讨论】:
-
在不知道异常是什么的情况下,很难知道发生了什么。您可以添加完整的崩溃信息吗?例如单击 xamarin 为您提供的崩溃窗口中的复制按钮并粘贴到此处。对于它的价值,documentation for the constructor you're using 列出了它可以抛出的可能异常。
-
@BergQuester,我刚刚添加了错误消息,谢谢。
-
System.NotImplementedException,这里的方法似乎没有在 Mono 框架(用于 Xamarin)或您链接的库版本中实现。
-
@LasseV.Karlsen,你能澄清一下吗?
标签: c# xamarin xamarin.forms azure-storage azure-blob-storage