1

When I drag-and-drop a *.csproj file to the Visual Studio window, it says:

"Project files cannot be dropped onto the application. They must be opened via the File menu."

Why?

It is NOT a duplicate of that question, because other file types (*.config, *.cs, *.txt) can be drag-and-dropped without any error.

Community
  • 1
  • 1
dimmoborgir
  • 189
  • 1
  • 9
  • 4
    This already has an answer: http://stackoverflow.com/questions/15226600/visual-studio-does-not-let-me-drag-drop-items-into-it – KidCode Jan 12 '16 at 11:19
  • 2
    That is another problem: any file can't be drag-and-dropped when VS is running as Administrator. I my case, VS is **not** running as Administrator, and other files (except *.csproj) **can** be drag-and-dropped. – dimmoborgir Jan 12 '16 at 12:35
  • 3
    This certainly doesn't have an answer in that proposed duplicate, but I'm afraid we might never get to know, unless someone from the VS team decides to answer. Anyway, nominated for reopening. – Sami Kuhmonen Jan 12 '16 at 12:54
  • Why is this question closed (again)? It is certainly not a duplicate to the other one. If closed at all, it could only be "off topic" or "too broad" or whatever, but not a duplicate. – Christian.K Jan 12 '16 at 13:06
  • 2
    This is not a bug, but feature. Sounds like limitation of VS (message is pretty self-explaining isn't it?), probably because VS have to handle compatibility (when you open solution from old project it will display converting wizard) and related things (nuget, etc.), dragging just `csprj` is meaningless, it needs related files . Can you specify VS version and edition btw? – Sinatr Jan 12 '16 at 13:06
  • @Christian.K, people make mistakes. (@Daniel didn't pay enough attention it seems). This is what for we have re-open queue. – Sinatr Jan 12 '16 at 13:14
  • @Sinatr, yes of course. That's why a bunch of people have already reopend the question once (before it got closed again ;-) More or less I added my comment to prevent yet another closure (at least for the same reason) when the question hopefully gets reopened again. – Christian.K Jan 12 '16 at 13:14
  • @Sinatr, VS 2015 Professional Update 1, VS 2013 Professional Update 4. Why VS wouldn't just do those actions, which it does when I go to: File - Open - Project - (Select *.csproj file) - Open ? – dimmoborgir Jan 12 '16 at 13:45
  • 4
    @dimmoborgir, you can have your [vote](https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/6101114-allow-opening-a-project-file-via-drag-and-drop-on) if you think this feature is a must. – Sinatr Jan 12 '16 at 13:51
  • 1
    It may just be not worth their while developing new UI to support this. What should the default be if a solution is already open? File -> Add -> Existing Project (adds it to the existing project) or File -> Open -> Project/Solution (closes existing solution, loads new one). Neither one is inherently the "right" thing to do. Note that the message tells you to use the File menu, not which option to select within it. – Damien_The_Unbeliever Jan 12 '16 at 14:51
  • 1
    Several people have answered "why doesn't VS have this feature" - because no one has requested, designed, built, tested, and shipped it. So is your question _really_ "what are the challenges with allowing drag-and-drop for projects in VS? – D Stanley Jan 12 '16 at 14:54
  • But, it *does* have the feature. A Microsoft programmer wrote that code that displays the dialog box. And the message got localized in every language that VS supports. Never done by accident. A project requires a solution. You never would want VS to accidentally create one. D+D the .sln file instead. – Hans Passant Jan 12 '16 at 15:37
  • I do sometimes want to open just *.csproj. For example, when only project and source files are sent to me by a student. In that case VS creates new solution (which you can save or not). It does the same when I double-click *.csproj file in Windows Explorer. – dimmoborgir Jan 13 '16 at 06:35

0 Answers0