菜鸟教程小白 发表于 2022-12-12 23:39:46

ios - 在 Xamarin.IOS 中使用 Office 365 API 时出现 NullReferenceException


                                            <p><p>首先我遇到了这个问题:
<a href="https://stackoverflow.com/questions/24511469/using-office-365-api-in-xamarin-android" rel="noreferrer noopener nofollow">Using Office 365 API in Xamarin.Android</a> </p>

<p>现在在 Xamarin IOS 中测试相同,我得到了另一个 :(</p>

<pre><code>{System.NullReferenceException: Object reference not set to an instance of an object
at Microsoft.Office365.OAuth.Authenticator.GetRefreshToken (System.String resource) in &lt;filename unknown&gt;:0
at Microsoft.Office365.OAuth.Authenticator+&lt;GetAuthenticationResult&gt;d__c.MoveNext () in &lt;filename unknown&gt;:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult () in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
at Microsoft.Office365.OAuth.Authenticator+&lt;AuthenticateAsync&gt;d__6.MoveNext () in &lt;filename unknown&gt;:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult () in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59
at Office365InXamarinApps.ViewModel.ContactsViewModel+&lt;EnsureClientCreated&gt;d__9.MoveNext () in c:\DevApps\GitHub\Office365InXamarinApps\scr\Office365InXamarinApps\Office365InXamarinApps\ViewModel\ContactsViewModel.cs:76 }
</code></pre>

<p>代码在这里:<a href="https://github.com/saramgsilva/Office365InXamarinApp" rel="noreferrer noopener nofollow">https://github.com/saramgsilva/Office365InXamarinApp</a> </p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>Office 365 API Preview 有问题,我无法使用它,因此我使用 Office 365 REST API 创建了另一个演示。</p>

<p> <a href="https://github.com/saramgsilva/Office365RESTAPISample" rel="noreferrer noopener nofollow">https://github.com/saramgsilva/Office365RESTAPISample</a> </p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 在 Xamarin.IOS 中使用 Office 365 API 时出现 NullReferenceException,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/24541318/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/24541318/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 在 Xamarin.IOS 中使用 Office 365 API 时出现 NullReferenceException