2

I have an old VB.Net project where I'm contributor and for compatibility reasons I need to keep underscore continuation characters where they are at code but Visual Studio 2017 is removing those.

For example:


Cache.Add(
    "cacheErr", _
    objArray, _
    Nothing, _
    Date.Today.AddHours(1), _
    System.Web.Caching.Cache.NoSlidingExpiration, _
    System.Web.Caching.CacheItemPriority.Normal, _
    Nothing)

When I open the file and change some of code the underscores are removed like this:

Cache.Add(
    "cacheErrDispensacion", 
    objArray, 
    Nothing, 
    Date.Today.AddHours(1), 
    System.Web.Caching.Cache.NoSlidingExpiration, 
    System.Web.Caching.CacheItemPriority.Normal, 
    Nothing)

As a result, this can not compile at older versions of visual studio.

I would like to know if there is a configuration to prevent this behaviour with Visual Studio 2017.

plr108
  • 1,201
  • 11
  • 16
E. Montoya
  • 21
  • 5
  • Actually, they would have to be very, *very* old versions - implicit line continuation goes back to *at least* 2012. I dont think it can be disabled. You may need to get an ancient copy, or the others could get a newer version – Ňɏssa Pøngjǣrdenlarp Apr 25 '18 at 20:21
  • Haha @Plutonix you make it sound like they are from antiquity. – NoAlias Apr 25 '18 at 21:33
  • Related [question](https://stackoverflow.com/questions/31874556/prevent-visual-studio-2015-from-removing-line-continuation-characters-in-vb?rq=1) about VS 2015 recommends disabling the "Pretty listing" option of the text editor. – Ryan Roos Apr 25 '18 at 21:46
  • There is an answer [here](https://stackoverflow.com/questions/31874556/prevent-visual-studio-2015-from-removing-line-continuation-characters-in-vb) which may be worth a look at. – Unknown User Apr 25 '18 at 22:08
  • @Plutonix you are right! hahaha... It is an ancient code made with vs2003 Pre-release I think. Framework 1.1 – E. Montoya Apr 26 '18 at 22:32

0 Answers0