Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smooth out potential issues using ResetDevSite #5310

Merged
merged 2 commits into from
Sep 22, 2022

Conversation

bdukes
Copy link
Contributor

@bdukes bdukes commented Sep 20, 2022

Summary

This PR resolves two issues we ran into while using ResetDevSite to setup a new DNN dev site (plus a third issue that I thought about while in the code).

DatabasePath Normalization

The first issue is that you get an obscure SQL error if the DatabasePath in your local settings uses / instead of \ (or, really \\ since it's a JSON file).

========================================
ResetDatabase
========================================
System.Data.SqlClient.SqlException (0x80131904): A file activation error occurred. The physical file name 'C:/dbs/dnn.local\dnn.local.mdf' may be incorrect. Diagnose and correct additional errors, and retry the operation.
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

DatabasePath Creation

The extra issue is that if DatabasePath doesn't already exist you get the following error:

========================================
ResetDatabase
========================================
System.Data.SqlClient.SqlException (0x80131904): Directory lookup for the file "C:\dbs\dnn.local\dnn.local.mdf" failed with the operating system error 3(The system cannot find the path specified.).
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.

Blank DnnConnectionString

The final issue we ran into was leaving DnnConnectionString blank and then getting a Yellow Screen of Death when the web.config was updated with the blank value. I added a check and throw an error if you're trying to set the web.config with a blank connection string.

SQL Server can't handle paths with forward slashes instead of
backslashes
@bdukes bdukes added this to the 9.11.1 milestone Sep 20, 2022
@bdukes bdukes requested a review from donker September 20, 2022 21:31
Copy link
Contributor

@david-poindexter david-poindexter left a comment

Choose a reason for hiding this comment

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

Nice enhancements @bdukes 🎉

Copy link
Contributor

@donker donker left a comment

Choose a reason for hiding this comment

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

Thanks!

@donker donker merged commit fe799a4 into dnnsoftware:develop Sep 22, 2022
@bdukes bdukes deleted the fix-database-path branch September 22, 2022 12:55
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.

None yet

3 participants