I just uninstalled and tried to reinstall the Optimus package and it crashed in the middle. I'm now getting a 500 server error when I try to access my website or the Umbraco backend so hopefully I can fix this and then I'll get back to you with the web.config file.
I had looked for the empty attributes but didn't find any.
Do you have a pre-Optimus copy of your web.config and /views/web.config file you can revert to?
It might be that you have an existing namespaces element in your config file, in Optimus v1.2.0 this would be checked and added to rather than you ending up with duplicates as happens in v1.1.0
If you want to give it a try and are just using Optimus.Core and no providers, then you can get a preview copy of v1.2.0 from here (If you are using any providers, let me know, as you can't use v1.1 providers with v1.2)
I've managed to restore the web.config so the website is back up and running.
I then tried to install v1.2.0 but it's given me a 500 error during install as well so I'm not sure what's happened so that the installs keep failing.
Here's my web.config after having attempted the install (broken) of v1.2.0. I notice that "~/bundles" isn't part of umbracoReservedPaths but maybe it didn't get to adding that before it crashed.
The web.config was in use by a process so couldn't be written to. I think that's what was causing the problem. I've tried another install and it worked. I had to manually add "~/bundles" to the web.config though.
The css is now being combined but in the file it says that the minification failed with:
Ok, I would interested to see the contents of your log file from when you installed v1.2 if possible?
I had success with your web.config, I added the section group manually, then installed Optimus again (you can do this with v1.2) which added the other missing parts, including the namespace required by webforms
Thanks Jeavon. Managed to find the error in the CSS which was around that line and it's now minifiying but there were problems in the display. Turns out I was including a print css file which had media="print" in the html but obviously Optimus wouldn't know that it was for print only so I removed it from the bundle and it's working perfectly now!
2013-11-28 16:06:01,459 [84] INFO Umbraco.Core.UmbracoApplicationBase - [Thread 81] Application shutdown. Reason: BinDirChangeOrDirectoryRename
2013-11-28 16:06:04,850 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Determining hash of code files on disk
2013-11-28 16:06:04,897 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Hash determined (took 16ms)
2013-11-28 16:06:04,912 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of umbraco.interfaces.IApplicationStartupHandler
2013-11-28 16:06:05,178 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of umbraco.interfaces.IApplicationStartupHandler, found 18 (took 265ms)
2013-11-28 16:06:05,240 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter
2013-11-28 16:06:05,240 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter, found 0 (took 8ms)
2013-11-28 16:06:05,256 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of Umbraco.Web.Mvc.SurfaceController
2013-11-28 16:06:05,256 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of Umbraco.Web.Mvc.SurfaceController, found 0 (took 6ms)
2013-11-28 16:06:05,256 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of Umbraco.Web.WebApi.UmbracoApiController
2013-11-28 16:06:05,272 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of Umbraco.Web.WebApi.UmbracoApiController, found 3 (took 6ms)
2013-11-28 16:06:05,272 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of Umbraco.Core.Media.IThumbnailProvider
2013-11-28 16:06:05,272 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of Umbraco.Core.Media.IThumbnailProvider, found 3 (took 7ms)
2013-11-28 16:06:05,272 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of Umbraco.Core.Media.IImageUrlProvider
2013-11-28 16:06:05,287 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of Umbraco.Core.Media.IImageUrlProvider, found 1 (took 7ms)
2013-11-28 16:06:05,725 [13] INFO Umbraco.Web.Search.ExamineEvents - [Thread 83] Initializing Examine and binding to business logic events
2013-11-28 16:06:06,037 [13] INFO Umbraco.Web.Search.ExamineEvents - [Thread 83] Adding examine event handlers for index providers: 3
2013-11-28 16:06:06,147 [13] ERROR System.Web.Optimization.BundleCollection - [Thread 83] Error adding bundles: System.NullReferenceException: Object reference not set to an instance of an object.
at BundleTransformer.Core.Transformers.CssTransformer.CreateDefaultMinifier()
at BundleTransformer.Core.Transformers.CssTransformer..ctor(IMinifier minifier, IList`1 translators, String[] ignorePatterns, CoreSettings coreConfig)
at BundleTransformer.Core.Transformers.CssTransformer..ctor(IMinifier minifier, IList`1 translators, String[] ignorePatterns)
at Optimus.BundleConfig.RegisterBundles(BundleCollection bundles)
System.NullReferenceException: Object reference not set to an instance of an object.
at BundleTransformer.Core.Transformers.CssTransformer.CreateDefaultMinifier()
at BundleTransformer.Core.Transformers.CssTransformer..ctor(IMinifier minifier, IList`1 translators, String[] ignorePatterns, CoreSettings coreConfig)
at BundleTransformer.Core.Transformers.CssTransformer..ctor(IMinifier minifier, IList`1 translators, String[] ignorePatterns)
at Optimus.BundleConfig.RegisterBundles(BundleCollection bundles)
2013-11-28 16:06:06,162 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of umbraco.interfaces.IApplication
2013-11-28 16:06:06,178 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of umbraco.interfaces.IApplication, found 7 (took 20ms)
2013-11-28 16:06:06,256 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Starting resolution types of umbraco.interfaces.ITree
2013-11-28 16:06:06,303 [13] INFO Umbraco.Core.PluginManager - [Thread 83] Completed resolution of types of umbraco.interfaces.ITree, found 28 (took 48ms)
2013-11-28 16:06:09,647 [13] INFO Umbraco.Core.PluginManager - [Thread 88] Starting resolution types of umbraco.interfaces.IPackageAction
2013-11-28 16:06:09,662 [13] INFO Umbraco.Core.PluginManager - [Thread 88] Completed resolution of types of umbraco.interfaces.IPackageAction, found 25 (took 27ms)
2013-11-28 16:06:09,725 [13] ERROR umbraco.cms.businesslogic.packager.PackageAction - [Thread 88] Error loading package action 'Umbundle.SetAttributeValue' for package Optimus.Core
System.IO.IOException: The process cannot access the file 'D:\Websites\XXXXXX\web.config' because it is being used by another process.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.Xml.XmlDocument.Save(String filename)
at Optimus.Umbraco.Installer.SetAttributeValue.Execute(String packageName, XmlNode xmlData)
at umbraco.cms.businesslogic.packager.PackageAction.RunPackageAction(String packageName, String actionAlias, XmlNode actionXml)
2013-11-28 16:06:09,850 [13] WARN Optimus.Umbraco.Installer.AddBundleTransformerProvider - [Thread 88] Error at AddBundleTransformerProvider package action: Attribute "enabled" not found.
2013-11-28 16:06:09,866 [13] WARN Optimus.Umbraco.Installer.AddBundleTransformerProvider - [Thread 88] Error at AddBundleTransformerProvider package action: Attribute "enabled" not found.
2013-11-28 16:06:10,209 [13] ERROR umbraco.cms.businesslogic.packager.PackageAction - [Thread 88] Error loading package action 'Umbundle.SetAttributeValue' for package Optimus.Core
System.IO.FileNotFoundException: Could not find file 'D:\Websites\XXXXXX\config\appSettings.config'.
File name: 'D:\Websites\XXXXXX\config\appSettings.config'
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at System.Xml.XmlUrlResolver.GetEntity(Uri absoluteUri, String role, Type ofObjectToReturn)
at System.Xml.XmlTextReaderImpl.OpenUrlDelegate(Object xmlResolver)
at System.Threading.CompressedStack.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.CompressedStack.Run(CompressedStack compressedStack, ContextCallback callback, Object state)
at System.Xml.XmlTextReaderImpl.OpenUrl()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
at System.Xml.XmlDocument.Load(XmlReader reader)
at Umbraco.Core.XmlHelper.OpenAsXmlDocument(String filePath)
at Optimus.Umbraco.Installer.SetAttributeValue.Execute(String packageName, XmlNode xmlData)
at umbraco.cms.businesslogic.packager.PackageAction.RunPackageAction(String packageName, String actionAlias, XmlNode actionXml)
Great, thanks. I will have a look and see if we can check if the config file being accessed is in use by another process before attempting to add to it.
I had the web.config open in visual studio at the time of installation.
Also, I'm noticing that in 1.2 it will bundle the files even if "debug=true" is set in the config file - maybe that's just because you guys are still testing at the moment before release?
This discussion inspired me to write a new package action for adding the ~/bundles/ path and it now doesn't matter where you have stored your appSettings so it will work for both v6 and v7 and also for anyone who has moved their appSettings to some other named file such as web.config.appSettings.config. :-)
404 error with bundled CSS
Having a hard time getting Optimus (v.1.1.0) to work on my v6.1.6 install of Umbraco. It's the first time I've installed Optimus so I'm not upgrading.
Created the bundle and added it to my master page using:
Got a compile error as Styles wasn't recognised so I added:
to the web.config and /views/web.config
The page now loads but I get a 404 error when I try to view the CSS at /bundles/styles
Any ideas? I tried installing the latest System.Web.Optimization from NuGet and I have this in the web.config:
Thanks, Ian.
Hmm can you post web.config make sure the dependency elements don't have the empty attribute (was a bug)
Or might be that Optimus was unable to update your web.config if you post we can have a look
I just uninstalled and tried to reinstall the Optimus package and it crashed in the middle. I'm now getting a 500 server error when I try to access my website or the Umbraco backend so hopefully I can fix this and then I'll get back to you with the web.config file.
I had looked for the empty attributes but didn't find any.
Hi Ian,
Do you have a pre-Optimus copy of your web.config and /views/web.config file you can revert to?
It might be that you have an existing namespaces element in your config file, in Optimus v1.2.0 this would be checked and added to rather than you ending up with duplicates as happens in v1.1.0
If you want to give it a try and are just using Optimus.Core and no providers, then you can get a preview copy of v1.2.0 from here (If you are using any providers, let me know, as you can't use v1.1 providers with v1.2)
Jeavon
Thanks Jeavon.
I've managed to restore the web.config so the website is back up and running.
I then tried to install v1.2.0 but it's given me a 500 error during install as well so I'm not sure what's happened so that the installs keep failing.
Here's my web.config after having attempted the install (broken) of v1.2.0. I notice that "~/bundles" isn't part of umbracoReservedPaths but maybe it didn't get to adding that before it crashed.
Strange, 500 error is probably because you are missing the bundleTransformer section group:
Could you please check and post any error from /App_data/Logs/UmbracoTraceLog.txt log file
The web.config was in use by a process so couldn't be written to. I think that's what was causing the problem. I've tried another install and it worked. I had to manually add "~/bundles" to the web.config though.
The css is now being combined but in the file it says that the minification failed with:
/* Minification failed. Returning unminified contents. (1276,48): run-time error CSS1036: Expected expression, found '}'
From a quick Google at looks as if this isn't a problem with Optimus but rather something wrong in the CSS or a bug in how the minifier handles CSS3.
Hi Ian,
Ok, I would interested to see the contents of your log file from when you installed v1.2 if possible?
I had success with your web.config, I added the section group manually, then installed Optimus again (you can do this with v1.2) which added the other missing parts, including the namespace required by webforms
I wonder what's locking the web.config...
Jeavon
Have you checked that line 1276 in the combined but not minified file, there is probably a simple syntax error to be updated.
The fact that I had it open could be something to do with it? :)
Depends what it was open in, there should be an entry in the log file which might reveal more....
Yup looks like syntax error in your css
Thanks Jeavon. Managed to find the error in the CSS which was around that line and it's now minifiying but there were problems in the display. Turns out I was including a print css file which had media="print" in the html but obviously Optimus wouldn't know that it was for print only so I removed it from the bundle and it's working perfectly now!
Great, thanks. I will have a look and see if we can check if the config file being accessed is in use by another process before attempting to add to it.
At least you have have v1.2 already :-)
Thanks for the help!
I had the web.config open in visual studio at the time of installation.
Also, I'm noticing that in 1.2 it will bundle the files even if "debug=true" is set in the config file - maybe that's just because you guys are still testing at the moment before release?
Thanks again, Ian.
Hey there is also a optimus setting you need to configure if you want to to follow the debug setting :) check the /app_plugins/optimus/*.config file
That's brilliant, cheers Tim!
I struggled with this for quiet some time until finding a solution mainly because of my web.config.appSettings.config file.
Modifying the following key with the ~/bundles/ path pretty much took care of my issues.
<add key="umbracoReservedPaths" value="~/umbraco,~/install/,~/bundles/" />
Found it strange that this wasn't added to my web.config by the install.
Hmm, we do have a package action that should do that. Just to check, are you using Umbraco v7 and Optimus v1.2.0?
If you could check your log file from when you installed Optimus and post any exceptions logged it be really useful?
Thanks,
Jeavon
I am using Umbraco 6.1.6 since Umbraco 7 ( isn't supported by our staff yet )
No errors to speak of in our UmbracoTraceLog
Yeah it should add them but in v7 the app settings are stored in different file in /config so maybe a permissions issue...
Ah ok, so you have moved your appsettings to web.config.appSettings.config instead of web.config?
This discussion inspired me to write a new package action for adding the ~/bundles/ path and it now doesn't matter where you have stored your appSettings so it will work for both v6 and v7 and also for anyone who has moved their appSettings to some other named file such as web.config.appSettings.config. :-)
What that is awesome Jeavon :)
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.