Link to home
Start Free TrialLog in
Avatar of Sarah Ward
Sarah WardFlag for United States of America

asked on

Visual Studio 2017 Publish - Error on "Start Preview"

I'm having an issue previewing my changes before publishing my code.   When I click "Start Preview" I'm getting the following error:

The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Pretty vague.  What File name?  I did a Google search on the error and the results returned are from users having issues Publishing their solution.  I can publish the solution without error.  It's the "Start Preview" that fails.  

It's also a random error.  Sometimes it happens and sometimes the Preview works.

Any suggestions?
Avatar of Mlanda T
Mlanda T
Flag of South Africa image

Change the folder location of your project. I have found folder locations under "My Documents" to often cause issue. I now put my VS projects into a simple "C:\Projects" folder or something similar. The issue is normally that the length of the path to reach project files under the "My Docuements\Visual Studio 2017\Projects\..." path is  often longer than 256 characters.
Avatar of Sarah Ward

ASKER

Thanks, MlandaT.  I'll try this on Monday (working on a deadline now) and let you know if this resolves the problem.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.