Bug 2032 - ArgumentNullException when loading source files
Summary: ArgumentNullException when loading source files
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Project Model ()
Version: 2.8
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Lluis Sanchez
URL:
Depends on:
Blocks:
 
Reported: 2011-11-15 01:14 UTC by Igor
Modified: 2015-07-02 10:50 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Igor 2011-11-15 01:14:54 UTC
I'm getting the next trace:

=============== cut ======================================
System.ArgumentNullException: Value cannot be null.

Parameter name: path

   at System.IO.Path.GetFullPathInternal(String path)

   at System.IO.Path.GetFullPath(String path)

   at MonoDevelop.Core.FilePath.get_CanonicalPath()

   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFolder..ctor(FilePath absolutePath, IWorkspaceObject parentWorkspaceObject, Object parent)

   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFolder.get_Parent()

   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectFolderNodeBuilder.GetParentObject(Object dataObject)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Components.ExtensibleTreeView.GetNodeAtObject(Object dataObject, Boolean createTreeBranch)

   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectSolutionPad.SelectActiveFile()

   at MonoDevelop.Ide.DispatchService.GuiDispatch(MessageHandler cb)

   at MonoDevelop.Ide.Gui.Pads.ProjectPad.ProjectSolutionPad.OnWindowChanged(Object ob, EventArgs args)

   at System.EventHandler.Invoke(Object sender, EventArgs e)

   at MonoDevelop.Ide.Gui.Workbench.OnDocumentChanged(Object s, EventArgs a)

   at MonoDevelop.Ide.Gui.DefaultWorkbench.OnActiveWindowChanged(Object sender, EventArgs e)

   at Gtk.Notebook.SwitchPageSignalCallback(IntPtr arg0, IntPtr arg1, UInt32 arg2, IntPtr gch)

=============== cut ======================================

When loading the source file (*.cs) from external location.

External means that I have sources linked into the project and specified with their full path name inside of csproj file.

These files are located on a network drive - not sure if this could be a reason.

Despite the error message, the file itself is opened correctly.
Comment 1 Igor 2011-11-18 23:46:16 UTC
The problem was that the csproj file was manually created, and contained only


    <Compile Include="full/path/to/the/file">
    </Compile>

after readding the links via MD it became


    <Compile Include="full/path/to/the/file">
      <Link>the/file</Link>
    </Compile>


no more exception is thrown.

Not sure if the first form is legal (but since it compiles fine, believe it should also be usable).
Comment 2 Lluis Sanchez 2015-07-02 10:50:12 UTC
Already fixed.