This project has moved and is read-only. For the latest updates, please go here.


VS2013 crashes when adding reference with dependencies that cannot be found


Using VS2013 Ultimate, the Visual Studio IDE crashes when adding a reference to a .NET DLL which has dependencies that cannot be found. This can be worked around by copying all the DLLs in to the same folder as the startup file.

The following exception can be seen when selecting 'debug' on the 'VS2013 has encountered a problem..." dialog:

System.IO.FileNotFoundException was unhandled
Message: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Microsoft.PythonTools.IronPython.Interpreter.dll
Additional information: Could not load file or assembly 'xxx, Version=, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

This behaviour can be seen in code using the clr.AddReferenceToFileAndPath, via the Add Reference dialog in the solution explorer, as well as specifying the search path to the folder in the solution explorer.

This is seen in the most recent version of the tools, PTVS 2.1 RC.


Zooba wrote Aug 27, 2014 at 4:50 PM

That section of log isn't actually all that helpful, so I've removed it.

If VS is totally crashing, then we should have stack traces included in the output of Tools -> Diagnostic Info (inside VS). Can you copy those for us (or just email the whole text to and we'll go through it).

Zooba wrote Aug 27, 2014 at 5:14 PM

I haven't been able to reproduce this locally, though I have found a few places that seem like they may need stronger exception handling.

I'm very interested to find out where the exception is coming from though, since all the ones I could cause are correctly handled.

cmist wrote Aug 28, 2014 at 9:10 AM

Hi - tried to email the dump file through both inline and as a txt attachment but can't:
_ Your message can't be delivered because delivery to this address is restricted._

Zooba wrote Aug 28, 2014 at 2:17 PM

I received the emails anyway - not sure why you're getting that error but I'll look into both of them when I get a chance. Thanks.

Ptools wrote Aug 28, 2014 at 5:16 PM

hi, the email is not ptvscore - sorry.

Zooba wrote Aug 29, 2014 at 8:03 PM

Thanks, I've had a look at the reports and the code involved.

One of the errors is very strange (the one you mentioned in the email), and I've forwarded that to another team member who knows this area better. We'll see what he says (he's currently away, so it'll be a few days).

The FileNotFoundException is due to VS not loading dependencies until they are needed, and we may "need" them in a lot of different places. Unfortunately, we haven't covered all of these areas with exception handling - it isn't obvious that "what type is this parameter?" may respond with file-not-found. Going through and making this more robust is certainly something we're keen to do, but I don't think it'll happen for PTVS 2.1 - we're very cautious about doing anything to destabilise the product and this would touch too many areas.

That said, we're still looking into it, and if we find an easy and safe way to handle this then it may still get in.

Zooba wrote Oct 1, 2014 at 9:48 PM

This should have been fixed in our latest dev build, so if you'd like to try that out and let us know if the problem is gone, that'd be great.