No component for supporting the service CMS.Helpers.ICurrentCookieLevelProvider was found - kentico

Hi I am having a kentico 11 website. I am getting following error when am trying host and run it locally from IIS
Server Error in '/' Application.
No component for supporting the service CMS.Helpers.ICurrentCookieLevelProvider was found
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: Castle.MicroKernel.ComponentNotFoundException: No component for supporting the service CMS.Helpers.ICurrentCookieLevelProvider was found
Source Error:
Line 16: protected override void OnPreRender(EventArgs e)
Line 17: {
Line 18: base.OnPreRender(e);
Line 19:
Line 20: lblText.Text = "The web site doesn't contain any content. Sign in to administration and edit the content.";
Source File: \CMS\Default.aspx.cs Line: 18
Stack Trace:
[ComponentNotFoundException: No component for supporting the service CMS.Helpers.ICurrentCookieLevelProvider was found]
Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext) +144
Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments) +40
Castle.Windsor.WindsorContainer.Resolve() +69
CMS.Core.IoCContainer.Resolve() +93
[ServiceResolutionException: Resolution of 'CMS.Helpers.ICurrentCookieLevelProvider' failed with the following error: No component for supporting the service CMS.Helpers.ICurrentCookieLevelProvider was found]
CMS.Core.IoCContainer.Resolve() +262
CMS.Helpers.CookieHelper.IsCookieAllowedInternal(String name) +38
CMS.Helpers.CookieHelper.GetValueInternal(String name, Boolean useDefaultValue, Boolean allowSensitiveData) +397
CMS.DocumentEngine.DocumentContext.GetCurrentStylesheet(PageInfo pageInfo) +87
CMS.UIControls.DocumentBase.get_CurrentStylesheet() +31
CMS.UIControls.DocumentBase.SetCSS() +21
CMS.UIControls.DocumentBase.PreRender() +44
_Default.OnPreRender(EventArgs e) in \CMS\Default.aspx.cs:18
System.Web.UI.Control.PreRenderRecursiveInternal() +132
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4005
Any help would be much appriciated.

Looks like some of CMS libraries may be missing. How did you setup the website: did you install Kentico or got the code and database backup? Check the missing references in CMS project in Visual Studio, clean, rebuild and try again.

Related

Azure Storage Emulator returns 500 internal server error

I have an application that uses Azure Storage, when I have reinstalled the Azure Storage Emulator and Explorer and then run the app, I get this error.
The app was working before I reinstalled.
[WebException: The remote server returned an error: (500) Internal Server Error.]
Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException(HttpStatusCode expectedStatusCode, HttpStatusCode actualStatusCode, T retVal, StorageCommandBase`1 cmd, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\Common\Shared\Protocol\HttpResponseParsers.Common.cs:54
Microsoft.WindowsAzure.Storage.Blob.<>c__DisplayClass57.<PutBlobImpl>b__56(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Blob\CloudBlockBlob.cs:3132
Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse(IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:300
[StorageException: The remote server returned an error: (500) Internal Server Error.]
Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End() in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\StorageAsyncResult.cs:77
Microsoft.WindowsAzure.Storage.Core.Util.<>c__DisplayClass7.<CreateCallbackVoid>b__5(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:121
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
Microsoft.AspNetCore.DataProtection.AzureStorage.<StoreElementAsync>d__14.MoveNext() +1308
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +32
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +62
Microsoft.AspNetCore.DataProtection.AzureStorage.AzureBlobXmlRepository.StoreElement(XElement element, String friendlyName) +161
Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.IInternalXmlKeyManager.CreateNewKey(Guid keyId, DateTimeOffset creationDate, DateTimeOffset activationDate, DateTimeOffset expirationDate) +1493
Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager.CreateNewKey(DateTimeOffset activationDate, DateTimeOffset expirationDate) +150
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.CreateCacheableKeyRingCore(DateTimeOffset now, IKey keyJustAdded) +645
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.Microsoft.AspNetCore.DataProtection.KeyManagement.Internal.ICacheableKeyRingProvider.GetCacheableKeyRing(DateTimeOffset now) +12
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRingCore(DateTime utcNow) +517
Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] plaintext) +90
[WebException: The remote server returned an error: (500) Internal
Server Error.]
One of the workaround you may follow to resolve the above issue:
Try to rename the application name with some other name and restart the azure storage emulator(>run AzureStorageEmulator.exe start) and run the application.
Alternatively to resolve with Azure storage explorer please find this SO THREAD as suggested by #Seth .
For more information you can refer this SO THREAD .

Dotnet Core 2.0 Web App Publish to Azure Fails

From VS 2017
what I tried:
Build in release mode & debug mode both builds fine.
Set Build verbosity to Diagnostic, there is not much information
indicating code error.
However .tmp dump file indicates some error.
I suspect these are visual studio internal errors:
5/4/2018 9:34:44 PM
System.AggregateException: One or more errors occurred. ---> System.Exception: Publish failed due to build errors. Check the error list for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass40_0.<PublishAsync>b__2()
at System.Threading.Tasks.Task`1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__88.MoveNext()
---> (Inner Exception #0) System.Exception: Publish failed due to build errors. Check the error list for more details.<---
===================
Setting RazorCompileOnBuild property to true should resolve your problem.
Take a look on following question
Had to set build verbosity to diagnostics then found out there were some errors in un-used Razor view pages.
There must be a way to compile Razor during build time rather than when publishing.

Xamarin installation failed in MAC OS X

I am facing problem to instal Xamarin in my Mac machine. It's giving problem in monotouch framework installation.
I have down loaded from http://xamarin.com and
down loaded file name is : XamarinInstaller.dmg
My Mac book specifications : lion 10.8.2
Please help me out..
I am getting below error.
Mono Framework installation failed with more than one exception (Attempt #Mono Framework)
Some installation errors are present.
Exception type: System.AggregateException
Message: Some installation errors are present.
Exception type: Xamarin.Web.Installer.InstallException
Message: Failed to attach DMG image '/Users/abcd.is/Library/Caches/XamarinInstaller/Universal/downloads/MonoFramework-MDK-2.10.12.macos10.xamarin.x86.dmg'. Error code 1.
at Xamarin.Web.Installer.MacInstallationArchiveHandler.MountDmg (System.String path) [0x00000] in :0
at Xamarin.Web.Installer.MacInstallationArchiveHandler.InstallDmg (System.String path, Boolean needsPrivileges) [0x00000] in :0
at Xamarin.Web.Installer.Installer.InstallationArchiveHandler.Install (System.String path, Boolean needsPrivileges) [0x00000] in :0
Exception type: Xamarin.Web.Installer.InstallException
Message: Failed to attach DMG image '/Users/abcd.is/Library/Caches/XamarinInstaller/Universal/downloads/MonoFramework-MDK-2.10.12.macos10.xamarin.x86.dmg'. Error code 1.
Actually, restarting the installer worked for me.

VS2012 - Sudden Death

I have a fairly consistent but random occurrence of sudden death in Visual Studio 2012. This usually happens when I press F6 to build - VS will disappear without any message or warning.
The event log has this:
Error Handler Exception: System.ServiceModel.CommunicationException: There was an error reading
from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.IOException: The read operation
failed, see inner exception. ---> System.ServiceModel.CommunicationException: There was an error
reading from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.PipeException: There was an
error reading from the pipe: Unrecognized error 109 (0x6d).
at System.ServiceModel.Channels.PipeConnection.OnAsyncReadComplete(Boolean haveResult, Int32 error, Int32 numBytes)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.ConnectionStream.EndRead(IAsyncResult asyncResult)
at System.Net.FixedSizeReader.ReadCallback(IAsyncResult transportResult)
--- End of inner exception stack trace ---
at System.Net.Security.NegotiateStream.EndRead(IAsyncResult asyncResult)
at System.ServiceModel.Channels.StreamConnection.EndRead()
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext) \r\n at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Channels.TransportDuplexSessionChannel.EndTryReceive(IAsyncResult result, Message& message)
at System.ServiceModel.Dispatcher.DuplexChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
I suspect it may be some extension I have installed but I've removed all the latest one I've installed and it persists.
Anyone had a similar experience?
Sounds like a bad installation to me. Try running a repair on your Visual Studio 2012 installation by selecting the application name in Windows Programs and Features and clicking on the Change button.

Not running in a hosted service or the Development Fabric (Production, not debug/local)

Im just getting started with Windows Azure and have got a small MVC application running locally using the Azure emulator. I signed up for a free trial, downloaded my publishing profile and imported it into VS2012. Published to Azure and got some assembly reference errors. I resolved this by setting them to copy local = true and now i get:
Not running in a hosted service or the Development Fabric.
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.InvalidOperationException: Not running in a hosted service or the Development Fabric.
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:
[InvalidOperationException: Not running in a hosted service or the Development Fabric.]
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.GetDefaultStartupInfoForCurrentRoleInstance() +447
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener..ctor() +40
[ConfigurationErrorsException: Could not create Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.]
System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData) +6792949
System.Diagnostics.TypedElement.BaseGetRuntimeObject() +45
System.Diagnostics.ListenerElement.GetRuntimeObject() +83
System.Diagnostics.ListenerElementsCollection.GetRuntimeObject() +143
System.Diagnostics.TraceInternal.get_Listeners() +181
System.Diagnostics.TraceInternal.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args) +155
DotNetOpenAuth.Loggers.TraceLogger.Info(Object message) +26
DotNetOpenAuth.Logger.CreateWithBanner(String name) +45
DotNetOpenAuth.Logger..cctor() +14
[TypeInitializationException: The type initializer for 'DotNetOpenAuth.Logger' threw an exception.]
DotNetOpenAuth.Logger.get_Library() +14
DotNetOpenAuth.Reporting.Initialize() +410
DotNetOpenAuth.Reporting.set_Enabled(Boolean value) +31
DotNetOpenAuth.Reporting..cctor() +285
[TypeInitializationException: The type initializer for 'DotNetOpenAuth.Reporting' threw an exception.]
Microsoft.Web.WebPages.OAuth.PreApplicationStartCode.Start() +41
[InvalidOperationException: The pre-application start initialization method Start on type Microsoft.Web.WebPages.OAuth.PreApplicationStartCode threw an exception with the following error message: The type initializer for 'DotNetOpenAuth.Reporting' threw an exception..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethodsCore(ICollection`1 methods, Func`1 setHostingEnvironmentCultures) +550
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +132
System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath) +90
System.Web.Compilation.BuildManager.ExecutePreAppStart() +135
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
[HttpException (0x80004005): The pre-application start initialization method Start on type Microsoft.Web.WebPages.OAuth.PreApplicationStartCode threw an exception with the following error message: The type initializer for 'DotNetOpenAuth.Reporting' threw an exception..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
--------------------------------------------------------------------------------
If seen this error if you are testing locally and have set the web project as the startup project rather than the cloud project, but as I say, this works fine locally against the emulator, but deploying into Azure causes this to fail.
Any ideas what I'm missing here?
Thanks
Try deleting the Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener trace listener configuration in your web.config. See this related SO post. DotNetOpenAuth.Logger seems to conflict with WAD (windows azure diagnostics).
Remove trace listener from web.config:
<trace>
<listeners>
<add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
<filter type="" />
</add>
</listeners>
</trace>
Set the Windows Azure Role project as the "Startup" project. This solved my problem. I encountered the same issue when I set another webapp in the same solution as startup project.

Resources