45

I have a solution that builds fine in VS2015. I just installed VS2017 RTM and after conversion, attempts to build the solution fail immediately with the error:

Build Failure. Error: 'path' cannot be an empty string ("") or start with the null character.

How can I get around this?

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742

5 Answers5

80

The problem seems to be with the new lightweight solution loading feature of VS2017.

To fix it, first clean up:

  • Close Visual Studio 2017
  • Delete or rename the .vs folder
  • Reopen the solution

Afterwards, don't re-enable lightweight solution loading for that solution.

You can completely disable lightweight solution loading for all solutions in the options, but if the problem only applies to some solutions then that might be a bit heavy handed.

Drew Noakes
  • 300,895
  • 165
  • 679
  • 742
13

I also had this problem with all of my VS2015 (aka project.json) - projects. Deleting the .vs folder didn't solve the problem.

I finally come up with disabling the "lightweight solutions load" checkbox under Tools -> Options -> Projects and Solutions -> Lightweight solution load for all solutions

  • Interesting that this happened in VS2015 too. I didn't think the concept of lightweight solution loaded existed there. I ran some more experiments earlier today and came to the conclusion that the feature doesn't work for my current solution. Are you using any uncommon project types? – Drew Noakes Mar 08 '17 at 09:26
10

I ran into the same problem in visual studio 2017, with a large solution that loaded light weight. I looked at :https://developercommunity.visualstudio.com/content/problem/15861/unable-to-build-solution-after-upgrading-to-the-la.html

And they also suggest not to light weight load solution:
a) right click on you solution
b) disable the lightweight loading
c) close the solution
d) reload and recompile the solution.

kfn
  • 620
  • 1
  • 7
  • 26
1

I ran into this problem with a bad bower.json configuration. Back up the bower.json file and clear the dependencies. See if that removes the error. If so, re-add the dependencies one by one until the problem goes awa

  • Interesting. I will give this a shot, thanks. I also have a bower file which isn't used and might be broken. Will report back. – Drew Noakes Mar 09 '17 at 07:20
  • I removed bower completely from the solution and still see this error if I remove the `.vs` folder, start VS and enable lightweight solution load. – Drew Noakes Apr 17 '17 at 20:30
1

These solutions didn't work for me, but I found .vs\config\applicationhost.config and it had

    <location path="" overrideMode="Allow">

I added the folder to which I would deploy the project, and it built. (or would have if I didn't have compiler errors :)

theGleep
  • 1,179
  • 8
  • 14
  • I had high hopes for this, but trying it out gave me [this problem instead](https://stackoverflow.com/q/45695002/24874). Lightweight solution load seems to quite unreliable. Glad this worked for you though. What did you set the path to? Does it have to be a file path? If so, absolute or relative? – Drew Noakes Aug 28 '17 at 12:44
  • I think it was an absolute path, but I don't remember for sure. I've had the problem recur, but turning off lightweight load has fixed it more permanently. – theGleep Aug 29 '17 at 17:41