User Profile
mbalcarek
Copper Contributor
Joined Feb 24, 2020
User Widgets
Recent Discussions
SharePoint Update several managed metadata fields with one ExecuteQuery()
I have C# CSOM code that updates a single managed metadata field value, but I found that I have to perform the following after each field is updated: item.Update(); //context.Load(item); context.ExecuteQuery(); otherwise only the last field is set correctly. When I have several managed metadata fields, this seems really inefficient and causes multiple versions of my document to be posted, one for each field update - can I update all my managed metadata fields using a single ExecuteQuery()? This code is used in SP 2013 and SPO. if (taxField.AllowMultipleValues) { termValues = item[fieldName] as TaxonomyFieldValueCollection; foreach (TaxonomyFieldValue tv in termValues) { termValueString += tv.WssId + ";#" + tv.Label + "|" + tv.TermGuid + ";#"; } termValueString += "-1;#" + termValueString + "|" + termId; termValues = new TaxonomyFieldValueCollection(context, termValueString, taxField); taxField.SetFieldValueByValueCollection(item, termValues); } else { termValue = new TaxonomyFieldValue(); termValue.Label = fieldValue; termValue.TermGuid = termId; termValue.WssId = -1; taxField.SetFieldValueByValue(item, termValue); } item.Update(); //context.Load(item); context.ExecuteQuery(); single2.3KViews0likes1CommentIntermittent - An existing connection was forcibly closed by the remote host - ExecuteQuery()
Hello, I have run the following code against our SharePoint Online, from several servers and local PCs and I get an intermittent error. It works on a server for a while, and then fails on the same server for a while: IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. Is this my issue or an issue with SharePoint Online? Using .net framework 4.7.2, nuget Microsoft.SharePointOnline.CSOM package 16.1.21312.12000 static void Main(string[] args) { ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; . . string webUrl = "https://tenant.sharepoint.com/sites/SandBox"; using (Microsoft.SharePoint.Client.ClientContext ctx = new Microsoft.SharePoint.Client.ClientContext(webUrl)) { SecureString securePassword = new NetworkCredential("", "pass").SecurePassword; ctx.Credentials = new SharePointOnlineCredentials("user@tenant.onmicrosoft.com", securePassword); Web web = ctx.Web; ctx.Load(web, w => w.Title, w => w.Description); ctx.ExecuteQuery(); } Unhandled Exception: System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) at System.Net.TlsStream.CallProcessAuthentication(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) at System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) at System.Net.ConnectStream.WriteHeaders(Boolean async) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetResponse() at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetIdcrlHeader(Uri url, Boolean alwaysThrowOnFailure, EventHandler`1 executingWeb Request) 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.GetWebRequestExecutor() at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate() at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest() at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery() at PCS.ConsoleApp.SPPermissions.Program.Main(String[] args)11KViews0likes2Comments"Add shortcut to OneDrive" not visible to guest users
I have a Teams site (without O365) in SharePoint online. If I navigate to a document library, users that are native to the tenant can see "Add shortcut to OneDrive", while guest users cannot. My test guest user has "Full" access to the library. I have also tried giving this user some licenses to see if that made a difference. I also went into Azure AD https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/CompanyRelationshipsMenuBlade/Settings and set: Guest users have the same access as members (most inclusive) What is required for these guest users to see this option? They have the option in their native tenant. Thanks for any insight.5.7KViews0likes3CommentsRe: SharePoint Online - Document (Content Organizer) Routing Frequency from Drop Off Library
Is there PowerShell or C# (CSOM?) code that can be written to submit documents that are in a drop off library, basically mimicking manual submissions? Or possibly a Power Automate approach?1.2KViews0likes0CommentsRe: SharePoint 2013 EXIF data lost from jpg image files
EXIF data (10/23/2020) is retained in jpg files in SharePoint 2013. I have tested SharePoint 2013 with EXIF data from first principals: first manually uploading jpg file to SharePoint and then downloading it, and it retains the EXIF data using CSOM code to upload the file and then manually down load it, and it retains the EXIF data Microsoft.SharePoint.Client.File.SaveBinaryDirect(context, doclibRelativeUrl, fs, true); I used https://www.conversion-tool.com/exifreader to check for the metadata . Looks like our issue may be related to our 3rd party software, or the code used to upload the images. My apologies for wasting everyone's time here.1.9KViews0likes1CommentSharePoint 2013 EXIF data lost from jpg image files
Hello, We upload jpg images to our SharePoint 2013 site, and have noticed that we lose the EXIF data (lat / long) from the jpg. A a third party app which produced the images. I have noticed https://docs.microsoft.com/en-us/sharepoint/troubleshoot/administration/automatic-exif-property-import-unsupported which discusses SharePoint Online indicates some changes - it is unclear whether this affects on-premise versions of SharePoint. Is there a way to maintain the EXIF data in SharePoint 2013?Solved2KViews0likes4Comments
Recent Blog Articles
No content to show