約1週間前に、Sharepointサイトにファイルをアップロードするコードが機能していました。突然それではなく、ClientContext ExecuteQuery()メソッドを実行すると、次のエラーが発生します。ExecuteQueryがSharepoint ClientContextで動作しなくなった
'='は予期しないトークンです。期待されるトークンは ';'です。ここで
は私のコードです:起こって変わったことはし
using (var context = new ClientContext(siteUrl))
{
context.Credentials = GetSharePointCredentials();
var web = context.Web;
Microsoft.SharePoint.Client.List list = context.Web.Lists.GetByTitle("Account");
context.ExecuteQuery();
はありません。どこから始めたらいいのか分かりません。何も変わっていません。コードは変更されていません。私はVisual Studioでデバッグモードに入っていますが、(a)プロダクションでソフトウェアを使用している人にとってはうまくいきません。(b)デバッグ中に実際に一度は動作しましたので、断続的です。時間は断続的と呼ばれる)。
私たちはそれが役立つならば、雲の中にSharepointをホストしています。ここで
スタックトレースです:オリジナルの答えに、ここで見られるような
The cause is that some ISP's "helpfully" hijack DNS. If you are on AT&T go here to opt out: http://www.att.net/dnserrorassist/about/srchTrm=Redirect%20Bin
:提供
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()
at vas.Dynamics.Crm.Library.CrmGateway.SaveFileToSharePoint(String siteUrl, String relativeUrl, String documentUrl, Byte[] documentData) in C:\Users\rmorgan\Source\Repos\backoffice\VAS.Dynamics.Crm.Library\VAS.Dynamics.Crm.Library\CrmGateway.cs:line 430
at vas.Dynamics.Crm.Library.CrmGateway.SaveDocument(Guid accountId, String documentName, Byte[] documentData) in C:\Users\rmorgan\Source\Repos\backoffice\VAS.Dynamics.Crm.Library\VAS.Dynamics.Crm.Library\CrmGateway.cs:line 233
at PrintEmailContractRenewal.Form1.CreatePdfDocuments(EntityCollection contractRenewals) in C:\Users\rmorgan\Source\Repos\backoffice\PrintEmailContractRenewal\PrintEmailContractRenewal\Form1.cs:line 190
スタックトレースを提供してください? – 12seconds
これを上に追加しました。それは何らかのXMLエラーです.1行目の位置107です。しかし、XMLは何ですか? – gareth99
どのようにファイルをSharePointに保存していますか?エラーは、XMLに不正な文字が含まれている可能性が高く、&と符号化する必要があります。&s; – 12seconds