Problem
When opening any K2 site (i.e. Designer, Management, Workspace), the below error appears:
Server ErrorValue cannot be null.Parameter name: valueMore Detailsat System.String.IndexOf(String value, Int32 startIndex, Int32 count, StringComparison comparisonType)at SourceCode.Forms.AppFramework.StaticBundleFileVersionInfo..ctor(String filePath, IEnumerable`1 assemblies, Dictionary`2 assemblyFileHashes)at SourceCode.Forms.AppFramework.BundlingFileGenerator.CheckCreatePhysicalBundle(String bundleName, List`1 assemblies, Dictionary`2 assemblyFileHashes, Boolean isCssBundle, Boolean onlyVerifyFirstAssembly, String bundleIncludeDirectory, List`1 bundleIncludeDirectoryExclusions)at SourceCode.Forms.AppFramework.BundlingFileGenerator.CheckCreatePhysicalBundle(String bundleName, Assembly assembly, Dictionary`2 assemblyFileHashes, Boolean isCssBundle, String bundleIncludeDirectory, List`1 bundleIncludeDirectoryExclusions)at SourceCode.Forms.AppFramework.BundlingUtility.AddThemeSpecificCssBundles()at SourceCode.Forms.AppFramework.BundlingUtility.Execute()at SourceCode.Forms.AppFramework.BundlingUtility.c__DisplayClass69_0.b__0()at SourceCode.Forms.AppFramework.IO.MutexExecutor`1.Execute(Func`1 function)at SourceCode.Forms.AppFramework.BundlingUtility.AttemptMethod(String logPrefix, BundlingStatus inProgressStatus, BundlingStatus completedStatus, Action functionToExecute)at SourceCode.Forms.AppFramework.BundlingModule.OnPostAuthenticateRequest(Object sender, EventArgs e)at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)If you look into the Console tab on the browser Developer Tools, there is an error similar to this:‘Refused to apply style from ‘https:{K2 server url}/Management/Styles/Platinum2/Css/fonts.css?..’ because it’s MIME type (‘text/htm’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
Solution
You can try the following steps: 1. On the server where Smartforms is installed, navigate to the following folder: {K2 Installation Folder}\K2\K2 smartforms Runtime\Content.
2. Ensure that the K2 service account has permissions on the folder above and that the permissions are inherited by objects created inside the folder.3. Copy all the contents of the {K2 Installation Folder}\K2\K2 smartforms Runtime\Content folder and paste it outside the K2 folder (eg. Desktop)4. Clear the contents of the {K2 Installation Folder}\K2\K2 smartforms Runtime\Content folder.5. Clear the browser cache then re-open the browser.Please apply the same steps to clear the cache for K2 SmartForms Designer in this folder: {K2 Installation Folder}\K2 smartforms Designer\Content]