Skip to content

Prevents Roslyn Compilation Errors During DNN v10 Upgrade#6452

Merged
valadas merged 1 commit intodnnsoftware:release/10.0.0from
tvatavuk:feature/fix6448
Mar 14, 2025
Merged

Prevents Roslyn Compilation Errors During DNN v10 Upgrade#6452
valadas merged 1 commit intodnnsoftware:release/10.0.0from
tvatavuk:feature/fix6448

Conversation

@tvatavuk
Copy link
Copy Markdown
Contributor

Fixes #6448

Summary

Prevents Roslyn from running to avoid potential compilation errors when a newer version of Roslyn is installed in the next steps with Microsoft.CodeDom.Providers.DotNetCompilerPlatform_04.01.00_Install.zip.

Copy link
Copy Markdown
Contributor

@valadas valadas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoaaa, that is an interesting idea, the packaging install then puts this back I assume right?

@valadas valadas added this to the 10.0.0 milestone Mar 14, 2025
@valadas valadas changed the title Fix #6448: Prevent Roslyn Compilation Errors During DNN v10 Upgrade by Removing Existing Compiler Before Installing New Version Prevents Roslyn Compilation Errors During DNN v10 Upgrade Mar 14, 2025
Copy link
Copy Markdown
Contributor

@bdukes bdukes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this, since it sounds like it resolved your issues in comparison to other approaches you tried.

It seems like this could happen during a regular upgrade of the Roslyn package, not just during a DNN upgrade. How reliably are you seeing the error condition? I wasn't able to reproduce with a couple of attempts.

@valadas valadas merged commit acb928f into dnnsoftware:release/10.0.0 Mar 14, 2025
3 checks passed
@tvatavuk
Copy link
Copy Markdown
Contributor Author

I'm fine with this, since it sounds like it resolved your issues in comparison to other approaches you tried.

It seems like this could happen during a regular upgrade of the Roslyn package, not just during a DNN upgrade. How reliably are you seeing the error condition? I wasn't able to reproduce with a couple of attempts.

I encountered a compilation error in approximately 80% of my tests under the following scenario:

  1. Clean install of DNN 9.13.8
  2. Installation of Microsoft.CodeDom.Providers.DotNetCompilerPlatform (v3.6)
  3. Installation of 2sxc 19.03.02 LTS
  4. Installation of 2sxc Content templates and all 2sxc App templates
  5. Adding 2sxc Content and 2sxc Apps to multiple pages
  6. Upgrading to DNN_Platform_10.0.0-rc.NN_Upgrade.zip

This issue appeared consistently across multiple test runs, making it a highly reproducible scenario in environments with several 2sxc content and app instances before the upgrade to 10.0.0.

@tvatavuk
Copy link
Copy Markdown
Contributor Author

First, thank you for reviewing and merging this PR.

Since this fix initially removed already installed parts of the extension in 10.00.00.config and then installed the upgraded version via Microsoft.CodeDom.Providers.DotNetCompilerPlatform_04.01.00_Install.zip, I conducted further testing. Unfortunately, I discovered an additional scenario that results in a compilation error.

Because of this, I continued searching for a better solution.

The latest version of the fix is now self-contained in the most logical place—Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dnn—and no longer modifies 10.00.00.config.

This fix effectively uninstalls Roslyn by:

  • Making necessary changes in web.config
  • Unregistering the assembly
  • Removing all files from bin\roslyn

I verified the fix with multiple test scenarios, all of which executed several times without issues:

  1. Clean install of DNN_Platform_10.0.0-rc.15_Install.zip
  2. Clean install of DNN 9.13.8, followed by an upgrade using DNN_Platform_10.0.0-rc.15_Upgrade.zip
  3. Clean install of DNN 9.13.8, then installation of Microsoft.CodeDom.Providers.DotNetCompilerPlatform (v3.6), followed by an upgrade using DNN_Platform_10.0.0-rc.15_Upgrade.zip
  4. Clean install of DNN 9.13.8, then installation of Microsoft.CodeDom.Providers.DotNetCompilerPlatform (v3.6), followed by 2sxc 19.03.02 LTS (including all content and app templates), then an upgrade using DNN_Platform_10.0.0-rc.15_Upgrade.zip

Since all tests were successful, I believe the best course of action is to create a new PR with this improved fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants