Replies: 1 comment
-
@leigh-pointer found a solution for ensuring this is set by default in the external template :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
One of the concepts that @leigh-pointer suggested for making development easier in external modules/themes is to include the Oqtane.Server project in your module Solution and mark it as the Startup Project. This allows you to run the external module/theme directly from within Visual Studio and set breakpoints in your external module/theme code - which makes debugging much more productive. The external Module and Theme templates now include this concept by default when you scaffold a new project.
When using this approach you must use the Build / Build Solution option in Visual Studio. The Build / Build Solution option only builds projects which have been modified. And since you should never modify the code in the Oqtane.Server project, this approach works well.
However there is one challenge. If you accidentally choose Build / Rebuild Solution, Visual Studio will attempt to build the Oqtane.Server project as well. This will fail because you do not have all of the other dependencies linked to your solution. And once this fails you will no longer be able to build your external Module/Theme solution. The only solution is to open the Oqtane.sln and do a Build / Rebuild Solution to repair the broken build. Once this is done, your external Module/Theme solution will build again.
I recently discovered a solution to the problem described above. In Visual Studio you can use the Configuration Manager option to exclude a project from building within a solution. Within your external Module/Theme solution use the Visual Studio menu:
And in the Configuration Manager dialog remove the checkmark from the Build column for the Oqtane.Server project:
Now when you perform a Build / Rebuild Solution, the Oqtane.Server project will be ignored. The metadata for this setting seems to be stored in the Visual Studio user settings - so it unfortunately cannot be scripted into the solution file (so the external Module/Theme templates cannot include this setting by default).
Hopefully you find this useful.
Beta Was this translation helpful? Give feedback.
All reactions