SitecoreUnicorn / Unicorn

A Sitecore utility designed to simplify deployment of Sitecore items across environments automatically
MIT License
269 stars 116 forks source link

Type load exception on Dilithium with Dilithium config disabled #249

Closed WizX20 closed 6 years ago

WizX20 commented 7 years ago

Sitecore 8.2.170728 Unicorn 4.0.2: Unicorn.Dilithium.config has been disabled.

[TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Unicorn.Data.Dilithium.DilithiumSitecoreDataStore'. Assembly: 'Unicorn, Version=4.0.2.0, Culture=neutral, PublicKeyToken=null'.] Unicorn.Data.Dilithium.DilithiumExtensions.EnablesDilithiumSql(IConfiguration configuration) +0 Unicorn.ControlPanel.Controls.ConfigurationInfo.Render(HtmlTextWriter writer) +833 Unicorn.ControlPanel.Responses.ControlPanelPageResponse.Execute(HttpResponseBase response) +379 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.ProcessRequest(HttpContext context) +690 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.Process(HttpRequestArgs args) +94

(Sorry for the dutch in the message there)

Just upgraded the Unicorn packages, am I missing something?

kamsar commented 7 years ago

It looks like an assembly might be out of date? Check the deployed version. Either way some config is still referencing the dilithium data store; it is possible to enable it without the config file, which just changes the defaults to dilithium

On Thu, Sep 28, 2017, 5:07 AM WizX20 notifications@github.com wrote:

Sitecore 8.2.170728 Unicorn 4.0.2: Unicorn.Dilithium.config has been disabled.

[TypeLoadException: De verklaring waarnaar wordt verwezen in een methode-implementatie mag geen afsluitingsmethode zijn. Type: Unicorn.Data.Dilithium.DilithiumSitecoreDataStore. Assembly: Unicorn, Version=4.0.2.0, Culture=neutral, PublicKeyToken=null.] Unicorn.Data.Dilithium.DilithiumExtensions.EnablesDilithiumSql(IConfiguration configuration) +0 Unicorn.ControlPanel.Controls.ConfigurationInfo.Render(HtmlTextWriter writer) +833 Unicorn.ControlPanel.Responses.ControlPanelPageResponse.Execute(HttpResponseBase response) +379 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.ProcessRequest(HttpContext context) +690 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.Process(HttpRequestArgs args) +94

(Sorry for the dutch in the message there)

Just upgraded the Unicorn packages, am I missing something?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kamsar/Unicorn/issues/249, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGU_XY3LEOllyc7wK91DOrd9zM4GJedks5sm4wBgaJpZM4PnKba .

WizX20 commented 7 years ago

I re-fetched the sources, removed obj and cleared the bin directories. Clean and rebuild, removed all binaries and configs related with rainbow and unicorn. And finally re-deployed. It does not seem to help. The deployed version is correct.

Weird, I installed it on a vanilla Sitecore of the same version and it seems to work. Well, back to the drawing board!

WizX20 commented 7 years ago

Ok, I've played around with it a bit and it now crashes on the Sitecore vanilla installation too.

If I disable the Foundation.Serialization.config it works.

The additional files: App_Config-Include.zip

WizX20 commented 7 years ago

Uncommented al the include nodes in Foundation.Serialization.config, then there is a logical exception that there are no nodes :)

Enabled as only include: `

        </include>
        <include name="Settings.Foundation" database="master" path="/sitecore/system/Settings/Foundation">
            <exclude children="true" />
        </include>
        <include name="Settings.Project" database="master" path="/sitecore/system/Settings/Project">
            <exclude children="true" />
        </include>`

Still no-go, this also breaks Unicorn.

kamsar commented 7 years ago

In the original exception, what would the message be in English? Google Translate nets me the lovely and I'm sure incorrect TypeLoadException: The declaration referred to in a method implementation must not be a termination method

WizX20 commented 7 years ago

Try to get Windows to use English instead of the default installed language..anyway I worked it out this is the message in English:

Declaration referenced in a method implementation cannot be a final method. Type: 'Unicorn.Data.Dilithium.DilithiumSitecoreDataStore'. Assembly: 'Unicorn, Version=4.0.2.0, Culture=neutral, PublicKeyToken=null'.

If I use a powershell script to execute the sync via shared key: [MissingMethodException: Method not found: &#39;Void Kamsar.WebConsole.TextWebConsole..ctor(System.Web.HttpResponseBase, Boolean, Boolean)&#39;.] Unicorn.ControlPanel.Responses.WebConsoleResponse.Execute(HttpResponseBase response) +0 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.ProcessRequest(HttpContext context) +690 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.Process(HttpRequestArgs args) +94 (Object , Object[] ) +74

Error: Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +479 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Nexus.Web.HttpModule.?(Object ?, EventArgs ?) +490 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +91

WizX20 commented 7 years ago

Found it! NuGet failed to update the reference to the new Kamsar.WebConsole.dll. In visual studio the reference was ok, but when I cleared out my packages folder I noticed the reference went into broken state... so when upgrading re-check your references to the rainbow and unicorn binaries.

kamsar commented 7 years ago

How odd, well glad you figured it out!

cassidydotdk commented 6 years ago

Reopening this to investigate. Just did a 3.3.2 upgrade to 4.0.3 and was hit by this error.

Declaration referenced in a method implementation cannot be a final method. Type: 'Unicorn.Data.Dilithium.DilithiumSitecoreDataStore'. Assembly: 'Unicorn, Version=4.0.3.0, Culture=neutral, PublicKeyToken=null'. 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.TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Unicorn.Data.Dilithium.DilithiumSitecoreDataStore'. Assembly: 'Unicorn, Version=4.0.3.0, Culture=neutral, PublicKeyToken=null'.

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:

[TypeLoadException: Declaration referenced in a method implementation cannot be a final method. Type: 'Unicorn.Data.Dilithium.DilithiumSitecoreDataStore'. Assembly: 'Unicorn, Version=4.0.3.0, Culture=neutral, PublicKeyToken=null'.] Unicorn.Data.Dilithium.DilithiumExtensions.EnablesDilithiumSql(IConfiguration configuration) +0 Unicorn.ControlPanel.Controls.ConfigurationInfo.Render(HtmlTextWriter writer) +772 Unicorn.ControlPanel.Responses.ControlPanelPageResponse.Execute(HttpResponseBase response) +379 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.ProcessRequest(HttpContext context) +710 Unicorn.ControlPanel.UnicornControlPanelPipelineProcessor.Process(HttpRequestArgs args) +94 (Object , Object[] ) +74 Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args) +469 Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain) +22 Sitecore.Nexus.Web.HttpModule.’(Object , EventArgs ) +517 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +139 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +88

cassidydotdk commented 6 years ago

Definitely some assembly conflict nonsense. It caught me out though. I copied debug builds of all Unicorn/Rainbow assemblies to the target bin folder and the error went away. I then deleted my debug assemblies, redeployed the solution that was failing like above - and the error is still gone.

I did do a Kamsaw.Webconsole updated manually as described above, but that did not make the problem go away.

Maybe Configy?