A content management system (CMS) is a software application or set of related programs that are used to create and manage digital content. CMSes are typically used for enterprise content management (ECM) and web content management (WCM)
Question:How to insert data into sitecore forms programmatically through c# code with custom MVC form ?
Description:I need to insert form data into sitecore experience forms with sitecore 9 and above. I need to create completely custom mvc form and yet insert its data into sitecore forms module.
Posted by: Junaid Aziz | Posted on: Mar 30, 2023
Question:"Telerik.Sitefinity.Security.SecurityDemandFailException" exception while trying to create and upload the document to sitefinity's document library
Description:I am getting following exception while trying to upload document to sitefinity's document library Telerik.Sitefinity.Security.SecurityDemandFailException Telerik.Sitefinity.Libraries.Model.DocumentLibrary, Telerik.Sitefinity.Model was not granted ManageDocument in Document for principals with IDs 00000000-0000-0000-0000-000000000000 [Image] I am using following method and it is throwing exception while I am trying to set its parent library as seen in the above screenshot public static void CreateDocumentNativeAPI(Guid masterDocumentId, string parentDocumentLibraryUrlName, string documentTitle, Stream documentStream, string documentFileName, string documentExtension) { LibrariesManager librariesManager = LibrariesManager.GetManager(); Document document = librariesManager.GetDocuments().Where(d => d.Id == masterDocumentId).FirstOrDefault(); if (document == null) { //The document is created as master. The masterDocumentId is assigned to the master version. document = librariesManager.CreateDocument(masterDocumentId); //Set the parent document library. DocumentLibrary documentLibrary = librariesManager.GetDocumentLibraries().Where(d => d.UrlName.ToLower() == parentDocumentLibraryUrlName).SingleOrDefault(); document.Parent = documentLibrary; //Set the properties of the document. document.Title = documentTitle; document.DateCreated = DateTime.UtcNow; document.PublicationDate = DateTime.UtcNow; document.LastModified = DateTime.UtcNow; document.UrlName = Regex.Replace(documentTitle.ToLower(), @"[^\w\-\!\$\'\(\)\=\@\d_]+", "-"); document.MediaFileUrlName = Regex.Replace(documentFileName.ToLower(), @"[^\w\-\!\$\'\(\)\=\@\d_]+", "-"); //Recompiles and validates the url of the document. librariesManager.RecompileAndValidateUrls(document); //Upload the document file. librariesManager.Upload(document, documentStream, documentExtension); //Save the changes. librariesManager.SaveChanges(); //Publish the DocumentLibraries item. The live version acquires new ID. var bag = new Dictionary<string, string>(); bag.Add("ContentType", typeof(Document).FullName); WorkflowManager.MessageWorkflow(masterDocumentId, typeof(Document), null, "Publish", false, bag); } }
Posted by: Khalid Abbas | Posted on: Jan 25, 2023
Question:Method not found: 'System.Web.HttpContext Sitecore.Pipelines.HttpRequest.HttpRequestArgs.get_Context()' with sitecore 10?
Description:I have sitecore 10 instance and I have just pushed my code to that instance and now I am keep getting the following error Method not found: 'System.Web.HttpContext Sitecore.Pipelines.HttpRequest.HttpRequestArgs.get_Context()'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.MissingMethodException: Method not found: 'System.Web.HttpContext Sitecore.Pipelines.HttpRequest.HttpRequestArgs.get_Context()'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [MissingMethodException: Method not found: 'System.Web.HttpContext Sitecore.Pipelines.HttpRequest.HttpRequestArgs.get_Context()'.] Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.Process(HttpRequestArgs args) +0 (Object , Object ) +14 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +490 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists) +236 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Web.RequestEventsHandler.OnPostAuthenticateRequest(HttpContextBase context) +218 Sitecore.Nexus.Web.HttpModule.(Object , EventArgs ) +185 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +223 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +94
Posted by: Junaid Aziz | Posted on: Dec 22, 2021
Question:Sitecore 10 Installation Error: Failed to Start Service 'Sitecore Marketing Automation Engine' while another instance of sitecore 9.0.2 also running on my system
Description:Note: I have multiple solr installed on my local environment one is for previous version and now I have added solr for sitecore 10 on port 8984 So my solr path for the sitecore 10 is https://localhost:8984/solr/ I am keep getting the same error and I have tried following steps fix the issue with no luck -we have tried removing all the certificates expect the certificate for solr -we have tried uninstall and reinstall the iis -Have enabled all the iis feature that are required -Tired running the following script with no result Get-Childitem cert:\LocalMachine\root -Recurse | Where-Object {$.Issuer -ne $.Subject} also tried the solution mention in the following links as well with no luck at all. https://sitecore.stackexchange.com/questions/27214/sitecore-9-3-installation-failing-failed-to-start-the-marketing-automation-en https://sitecore.stackexchange.com/questions/27643/failed-to-start-the-marketing-automation-engine-service-installation-sitecore https://sitecore.stackexchange.com/questions/20728/getting-error-failed-to-start-the-marketing-automation-engine-service-while Note: I am updating the errors that are shown under logs file on this location:App_Data\jobs\continuous\AutomationEngine\App_Data\Logs Error1: Error initializing XConnect client. System.AggregateException: One or more errors occurred. ---> Sitecore.XConnect.XdbCollectionUnavailableException: An error occurred while sending the request. ---> Sitecore.Xdb.Common.Web.ConnectionTimeoutException: A task was canceled. ---> System.Threading.Tasks.TaskCanceledException: A task was canceled. at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sitecore.Xdb.Common.Web.CommonWebApiClient`1.d__47.MoveNext() --- End of inner exception stack trace --- Error2: Failed to start the Marketing Automation Engine service. System.InvalidOperationException: This configuration has not been initialized. Please call the initialize method before using it. at Sitecore.XConnect.Client.XConnectClientConfiguration.CheckInitialized() at Sitecore.XConnect.Client.XConnectClientConfiguration.get_CurrentModel() at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) at Sitecore.XConnect.Configuration.Extensions.<>c__DisplayClass33_0.b__1(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitTransient(TransientCallSite transientCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitIEnumerable(IEnumerableCallSite enumerableCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ConstructorMatcher.CreateInstance(IServiceProvider provider) at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped(ScopedCallSite scopedCallSite, ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.b__0(ServiceProviderEngineScope scope) at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetService[T](IServiceProvider provider) at Sitecore.Xdb.MarketingAutomation.Engine.App.ServiceConfiguration.get_Engine() at Sitecore.Xdb.MarketingAutomation.Engine.App.EngineService.OnStart(String[] args)
Posted by: Tabish Usman | Posted on: Nov 24, 2021
Question:"Sitecore: Value cannot be null. Parameter name uri" error makes items inaccessible in sitecore cms backend
Description:we are using sitecore 8.1 and while using the cms backend our content team have raised some issue that they have mistakenly updated some wrong value in the "__Source Item" field of an item and after that the even the home item in that tree is inaccessible and throwing the following error Sitecore: Value cannot be null. Parameter name uri Note: previous value for the "__Source Item" was empty and it was unintentionally updated
Posted by: Sam Smith | Posted on: Sep 13, 2021
Question:What could be the best way to make one site’s code independent of other while using sitecore multisite with helix code architecture?
Description:We have three sites which were initially developed using sitecore (version 9.0.2) multisite with helix and sites are running live. We have these three sites and two domains so our final urls for three sites are something like as follows: 1)www.site1.com 2)www.site2.com 3)www.site2.com/site3 That means site3 is running on a sort of virtual directory on the same domain where site2 is running. My content structure shown in the following screenshot. [Image] and my site's “SiteDefinition.config” looks like the following one.(In which site3 is mainly setup using 'virtualFolder,physicalFolder' can be seen in the following code) <?xml version="1.0" encoding="utf-8" ?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore> <sites> <site name="site1" patch:before="site[@name='website']" enableTracking="true" hostName="site1.sc" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/site1" startItem="/Home" notFoundItem="/404" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" cacheRenderingParameters="true" renderingParametersCacheSize="10MB" enableItemLanguageFallback="false" enableFieldLanguageFallback="false" /> <site name="site2" patch:before="site[@name='website']" enableTracking="true" hostName="site2.sc" virtualFolder="/" physicalFolder="/" rootPath="/sitecore/content/site2" startItem="/Home" notFoundItem="/404" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" cacheRenderingParameters="true" renderingParametersCacheSize="10MB" enableItemLanguageFallback="false" enableFieldLanguageFallback="false" /> <site name="site3" patch:before="site[@name='site2']" enableTracking="true" hostName="site2.sc" virtualFolder="/site3" physicalFolder="/site3" rootPath="/sitecore/content/site3" startItem="/home" notFoundItem="/404" database="web" domain="extranet" allowDebug="true" cacheHtml="true" htmlCacheSize="50MB" registryCacheSize="0" viewStateCacheSize="0" xslCacheSize="25MB" filteredItemsCacheSize="10MB" enablePreview="true" enableWebEdit="true" enableDebugger="true" disableClientData="false" cacheRenderingParameters="true" renderingParametersCacheSize="10MB" enableItemLanguageFallback="false" enableFieldLanguageFallback="false" /> </sites> </sitecore> </configuration> Now we need to separate the sites code so that we can work on site3 independently while another team can take care of site1 and site2,is it possible to duplicate the code inside a folder named “site3” and only site3 will point to this code and other two sites will use the existing code? Further explanation about the approaches we have already discuss the with the teams internally, added The problem is that currently the code is deployed on single location which is utilized by all three sites,now Let say if i create separate feature modules for all the new feature of site3 even then what about the existing features of site3 as the existing feature shared the same .dll with others two sites and if i create all new features module then it will be reinventing the wheel and still if we have to made any changes to foundation .dlls then we will still have dependency, Note: The two teams that will be working on the sites are completely independent teams and will have no/ very less interaction in the future. we have already discussed a suggestion of sharing the same master repository of code between the teams that was not appreciated by both the teams because in that case who will take the merging the code responsibility and if any issues raise then there would be blame game.
Posted by: Tabish Usman | Posted on: Dec 17, 2019
Question:During the installation of sitecore 9 update 2 ,getting the "ERROR_DACFX_NEEDED_FOR_SQL_PROVIDER" error
Description:I am getting following error during installation of sitecore 9 update 2, Error Code: ERROR_DACFX_NEEDED_FOR_SQL_PROVIDER More Information: The SQL provider cannot run with dacpac option because of a missing dependency. Please make sure that DacFx is installed. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DACFX_NEEDED_FOR_SQL_PROVIDER. Install-SitecoreConfiguration : Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero exit code - (-1) At C:\resourcefiles\install.ps1:49 char:1 + Install-SitecoreConfiguration @xconnectParams -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Install-SitecoreConfiguration [TIME] 00:00:18 Invoke-CommandTask : Command C:\Program Files\iis\Microsoft Web Deploy V3\msdeploy.exe returned a non-zero exit code - (-1) At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.1.0\Public\Tasks\Invoke-WebDeployTask.ps1:36 char:2 + Invoke-CommandTask -Path $Path -Arguments $msdeployArgs -TaskName ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-CommandTask While I have installed the prerequisite which is "Microsoft SQL Server Data-Tier Application Framework" Note: I am installing sitecore 9 update 2 through powershall script and that was the final script I have run, I have installed all prerequisites and solr as well.
Posted by: Sam Smith | Posted on: Oct 24, 2019
Question:How to know whether the website was built using sitecore ?
Description:I want to detect if any website was built using sitecore while I don't have access for the site i.e I am visiting the website as a general user of the website, is it possible ?
Posted by: Sam Smith | Posted on: Aug 08, 2019
Question:Data at the root level is invalid. Line 1, position 1.
Description:I am getting following error on a website developed using sitecore 9 and already hosted on my local environment and was working until I have just installed another instance of website using sitecore 9.1 the site previously working fine,started throwing following error. Server Error in '/' Application. Data at the root level is invalid. Line 1, position 1. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Xml.XmlException: Data at the root level is invalid. Line 1, position 1. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [XmlException: Data at the root level is invalid. Line 1, position 1.] System.Xml.XmlTextReaderImpl.Throw(Exception e) +88 System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace() +6683419 System.Xml.XmlTextReaderImpl.ParseDocumentContent() +336 System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options) +60 System.Xml.Linq.XDocument.Parse(String text, LoadOptions options) +147 SolrNet.Impl.SolrCoreAdmin.Status() +67 Sitecore.ContentSearch.SolrProvider.SolrStatus.OkSolrStatus() +73 Sitecore.ContentSearch.SolrProvider.SolrStatus..cctor() +72 [TypeInitializationException: The type initializer for 'Sitecore.ContentSearch.SolrProvider.SolrStatus' threw an exception.] Sitecore.ContentSearch.SolrProvider.SolrStatus.SetIndexForInitialization(ISearchIndex solrIndex) +0 Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.SetForReinitialization() +202 Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.InitializeSolr() +129 Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Initialize() +46 Sitecore.ContentSearch.SolrProvider.SolrContentSearchManager.Initialize() +169 Sitecore.ContentSearch.SolrProvider.SolrNetIntegration.DefaultSolrStartUp.Initialize() +913 (Object , Object[] ) +71 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +469 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Nexus.Web.HttpModule.Application_Start() +161 Sitecore.Nexus.Web.HttpModule.Init(HttpApplication app) +764 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +570 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +169 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +372 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +329 [HttpException (0x80004005): The type initializer for 'Sitecore.ContentSearch.SolrProvider.SolrStatus' threw an exception.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708 Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.2633.0
Posted by: Sam Smith | Posted on: Jul 31, 2019
Question:how to change/update the display order of fields in sitecore backend?
Description:I have an sitecore item using so many data templates containing many fields but I want some of the fields at backend to appear at the top of the item so that it will be easy for the content author to populate the mandatory field first,but i don't see the option to manipulate the displaying order of the fields.
Posted by: Sam Smith | Posted on: Jul 12, 2019