'='是一个意外的令牌。预期的标记是';'。第1行,第107位。 [英] '=' is an unexpected token. The expected token is ';'. Line 1, position 107.

查看:106
本文介绍了'='是一个意外的令牌。预期的标记是';'。第1行,第107位。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用sharepoint.client在代码中登录sharepoint。但结果证明是问题。


'='是一个意外的令牌。预期的标记是';'。第1行,第107位。    at System.Xml.XmlTextReaderImpl.Throw(例外e)

    at System.Xml.XmlTextReaderImpl.Throw(String res,String [] args)

    at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1,String expectedToken2)

    at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos,String expectedToken1,String expectedToken2)

    at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue,EntityExpandType expandType,Int32& charRefEndPos)

    at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos,Int32& endPos,Int32& outOrChars)

    at System.Xml.XmlTextReaderImpl.FinishPartialValue()

    at System.Xml.XmlTextReaderImpl.get_Value()

    at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)

    at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r,LoadOptions o)

    at System.Xml.Linq.XDocument.Load(XmlReader reader,LoadOptions options)

    at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.DoGet(String url)

    at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.RequestFederationProviderInfo(String domainname)

    at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetFederationProviderInfo(String domainname)

    at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.InitFederationProviderInfoForUser(String username)

    at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username,String password,String serviceTarget,String servicePolicy)

   在Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(URI(URL),用户名字符串,SecureString的密码,布尔alwaysThrowOnFailure,EventHandler`1 executingWebRequest)

    at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url,Boolean refresh,Boolean alwaysThrowOnFailure)

    at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context,HttpWebRequest request)

    at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()

    at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()

    at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()

    at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()



问题是什么,我该怎么办?


感谢您的建议。



解决方案

您好,


我偶尔遇到这个问题,因为它与我的特定测试服务器相关
通常 ,如果我在不同的服务器上测试,代码工作正常。


您可以尝试重启服务器检查问题是否存在,因为当我通常重新启动测试服务器时问题就会消失。


最好的问候,



I am using sharepoint.client to login sharepoint in code. but it turns out to be the issue.

'=' is an unexpected token. The expected token is ';'. Line 1, position 107.   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
   at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2)
   at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
   at System.Xml.XmlTextReaderImpl.FinishPartialValue()
   at System.Xml.XmlTextReaderImpl.get_Value()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.DoGet(String url)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.RequestFederationProviderInfo(String domainname)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetFederationProviderInfo(String domainname)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.InitFederationProviderInfoForUser(String username)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password, Boolean alwaysThrowOnFailure, EventHandler`1 executingWebRequest)
   at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh, Boolean alwaysThrowOnFailure)
   at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context, HttpWebRequest request)
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()

what's the problem and what should I do?

thanks for the suggestion.

解决方案

Hi,

I faced this occasionally while it related to my specific test server usually, if I test in a different server, the code works fine.

You could try to restart your server to check whether the issue exists as the issue will be gone when I restart my test server usually.

Best Regards,

Lee


这篇关于'='是一个意外的令牌。预期的标记是';'。第1行,第107位。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆