Added helpful error message when ELMAH SQL objects are missing #492

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
@Haacked
Member

Haacked commented Apr 29, 2012

When running a clean clone of NuGet gallery, there's a manual configuration step that's required to get ELMAH working.
But the error message ELMAH gives doesn't help much. I added some code so that we present a more helpful message.

ELMAH not configured correctly.
Run the SQL script 'Elmah.SqlServer.sql' located in '{SolutionDir}\packages\elmah.sqlserver.1.2\content\App_Readme\' against your SQL database.
Added helpful error message when ELMAH SQL objects are missing
When running a clean clone of NuGet gallery, there's a manual configuration step that's required to get ELMAH working.
But the error message ELMAH gives doesn't help much. I added some code so that we present a more helpful message.

    ELMAH not configured correctly.
    Run the SQL script 'Elmah.SqlServer.sql' located in '{SolutionDir}\packages\elmah.sqlserver.1.2\content\App_Readme\' against your SQL database.
@Haacked

This comment has been minimized.

Show comment Hide comment
@Haacked

Haacked Apr 29, 2012

Member

Even better might be to have .\Build-Solution.ps1 run the SQL script. But given the script will be at a different location for each version of ELMAH, I decided not to do that at this time because I'm lazy.

Member

Haacked commented Apr 29, 2012

Even better might be to have .\Build-Solution.ps1 run the SQL script. But given the script will be at a different location for each version of ELMAH, I decided not to do that at this time because I'm lazy.

@davidfowl

This comment has been minimized.

Show comment Hide comment
@davidfowl

davidfowl Apr 29, 2012

Member

Why not do this: https://github.com/davidfowl/JabbR/blob/master/JabbR/Migrations/201201280922163_ElmahInSql.cs

BTW I use the exact same script in JabbR. 😄

Member

davidfowl commented Apr 29, 2012

Why not do this: https://github.com/davidfowl/JabbR/blob/master/JabbR/Migrations/201201280922163_ElmahInSql.cs

BTW I use the exact same script in JabbR. 😄

@Haacked

This comment has been minimized.

Show comment Hide comment
@Haacked

Haacked Apr 29, 2012

Member

Ah, so it's an embedded resource? I like that. If others agree, I'll do that and send a pull request. I'll have to edit the chapter I'm writing though to remove the part about running the script manually. :P

Member

Haacked commented Apr 29, 2012

Ah, so it's an embedded resource? I like that. If others agree, I'll do that and send a pull request. I'll have to edit the chapter I'm writing though to remove the part about running the script manually. :P

@Haacked

This comment has been minimized.

Show comment Hide comment
@Haacked

Haacked Apr 29, 2012

Member

Also, do you know if that migration fails if someone already manually ran the script?

Member

Haacked commented Apr 29, 2012

Also, do you know if that migration fails if someone already manually ran the script?

@davidfowl

This comment has been minimized.

Show comment Hide comment
@davidfowl

davidfowl Apr 29, 2012

Member

I believe it noops (IF NOT EXISTS etc) but I dunno for sure.

Member

davidfowl commented Apr 29, 2012

I believe it noops (IF NOT EXISTS etc) but I dunno for sure.

@Haacked

This comment has been minimized.

Show comment Hide comment
@Haacked

Haacked Apr 29, 2012

Member

I'll double check. This got me thinking though, what if the elmah sql package had a PS script that checked to see if Migrations were enabled, and if so, generated a migration that does this. Too invasive?

Member

Haacked commented Apr 29, 2012

I'll double check. This got me thinking though, what if the elmah sql package had a PS script that checked to see if Migrations were enabled, and if so, generated a migration that does this. Too invasive?

@davidfowl

This comment has been minimized.

Show comment Hide comment
@davidfowl

davidfowl Apr 29, 2012

Member

No I like that, I'd prefer if I didn't have to do anything. Or maybe another package that's Elmah.EntityFramework.Migration or something that does what you suggest so people aren't surprised.

Member

davidfowl commented Apr 29, 2012

No I like that, I'd prefer if I didn't have to do anything. Or maybe another package that's Elmah.EntityFramework.Migration or something that does what you suggest so people aren't surprised.

@half-ogre

This comment has been minimized.

Show comment Hide comment
@half-ogre

half-ogre Apr 30, 2012

Contributor

I think doing what Jabbr is doing is a good start. I've been thinking of writing an EF-based ELMAH provider, which would then have actual entities for EF, and the migrations stuff would just be automatic. That, to me, is the proper fix. But, like I said, I'm fine starting with what Jabbr is doing.

Contributor

half-ogre commented Apr 30, 2012

I think doing what Jabbr is doing is a good start. I've been thinking of writing an EF-based ELMAH provider, which would then have actual entities for EF, and the migrations stuff would just be automatic. That, to me, is the proper fix. But, like I said, I'm fine starting with what Jabbr is doing.

@half-ogre

This comment has been minimized.

Show comment Hide comment
@half-ogre

half-ogre Jun 13, 2012

Contributor

So, shall I pull this in until we do something smarter?

Contributor

half-ogre commented Jun 13, 2012

So, shall I pull this in until we do something smarter?

@davidfowl

This comment has been minimized.

Show comment Hide comment
@davidfowl

davidfowl Jun 13, 2012

Member

Weren't we just going to copy the migration from jabbr?

Member

davidfowl commented Jun 13, 2012

Weren't we just going to copy the migration from jabbr?

@davidfowl

This comment has been minimized.

Show comment Hide comment
@davidfowl

davidfowl Jun 13, 2012

Member

Weren't we just going to copy the migration from jabbr?

Member

davidfowl commented Jun 13, 2012

Weren't we just going to copy the migration from jabbr?

@half-ogre

This comment has been minimized.

Show comment Hide comment
@half-ogre

half-ogre Jun 25, 2012

Contributor

Fixed with fa70cef

Contributor

half-ogre commented Jun 25, 2012

Fixed with fa70cef

@half-ogre half-ogre closed this Jun 25, 2012

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