SPContext.Current is null while calling
SPContext.Current can only be used from a Web context.
This means it works fine as long as an
By definition, this is always the case for Web parts, controls and Web pages.
For list event receivers and feature event receivers, it may or it may not be available: it depends on how the item (resp. the feature) as been added (resp. activated): from the UI (most common case:
SPContext.Current is then available), from PowerShell (not available), from custom .exe (not available)...
In a feature event receiver you can safely use
In a list event receiver, you can easily get access to the Web that originated the event with
For workflows, it also depends, as a workflow action may run in the Web context that triggered it (OK) or in a job (KO).
Jobs always run in a dedicated process (owstimer.exe) where
SPContext.Current is never available. The concept of "contextual Web" has no signification here, since a job runs out of any user interaction, and, most of the time, simply loops through all existing sites.
SPContext.Current is not available in all scopes - it will work in Event Receivers and web service calls, but will be null in Timer Jobs and within RunWithElevatedPrivileges (as suggested here). From where are you trying to access SPContext.Current?