You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ProjectItem.Save(null) throws ArgumentNullException: Value cannot be null. #483
Here is the exception:
[5076] Parameter name: fileName ---> System.ArgumentNullException: Value cannot be null.
[5076] Parameter name: fileName
[5076] at Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAFileItem.<>c__DisplayClass8.b__9()
[5076] at Microsoft.VisualStudio.Shell.InvokableAction.InvokeMethod()
[5076] at Microsoft.VisualStudio.Shell.InvokableBase.Invoke()
[5076] --- End of inner exception stack trace ---
[5076] at Microsoft.VisualStudio.Shell.ThreadHelper.InvokeOnUIThread(InvokableBase invokable)
[5076] at Microsoft.VisualStudio.Shell.ThreadHelper.Invoke(Action action)
[5076] at Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAFileItem.DoSave(Boolean isCalledFromSaveAs, String fileName)
[5076] at Microsoft.VisualStudio.FSharp.ProjectSystem.Automation.OAFileItem.Save(String fileName)
The linked doc is for EnvDTE.ProjectItem, but you are invoking on our OAFileItem. The latter indeed derives from the former, but docs for OAFileItem indicate that empty string is all that's expected to be handled at the OAFileItem level.
Other VS project systems based on the same MPF skeleton as F# have the same behavior (throw on null):
Activity
enricosada commentedon Jun 8, 2015
Got a fix for this one
latkin commentedon Jun 10, 2015
The linked doc is for
EnvDTE.ProjectItem, but you are invoking on ourOAFileItem. The latter indeed derives from the former, but docs forOAFileItemindicate that empty string is all that's expected to be handled at theOAFileItemlevel.Other VS project systems based on the same MPF skeleton as F# have the same behavior (throw on null):
So practically speaking, extensions should not rely on
nullbeing supported. Maybe we will support it, but it's not a particularly high-priority case.enricosada commentedon Jun 11, 2015
is more a compatibility fix with c# project system ( like some other hack ), but harmless
Fix 483 - project item save filename null