5

In VS 2015, I have a solution that builds and debugs just fine. But, when I go to publish it, it won't let me because of 60 intellisense errors.

I've found a few threads like these:

Visual Studio 2015: Intellisense errors but solution compiles

Intellisense keeps showing errors while build is successful Visual Studio 2015

I've tried all the answers & suggestion, even in the comments.

What I've tried:

  • Go into the references of every project in the solution. Remove the reference to C#, and to all of the other projects. Clean. Rebuild (which of course failed.) Then add them all back. Clean. Rebuild.

  • Delete every .suo file within the solution. Clean. Rebuild.

  • Delete all of the bin and obj folders within the solution. Clean. Rebuild.

  • Do all of the above, but wait to do a clean and rebuild until all three steps had been done. Then clean & rebuild.

  • Updated every nuget package in the solution to the newest version.

Anyone else ever seen this and found a fix?

UPDATE:

The 60 errors are all over the place. Here's just a sample: enter image description here

Community
  • 1
  • 1
Casey Crookston
  • 13,016
  • 24
  • 107
  • 193
  • 3
    What do the errors say? – mason May 12 '17 at 17:13
  • 2
    I highly suspect they are a red herring, but see update to OP – Casey Crookston May 12 '17 at 17:14
  • 1
    Does it build in the Release build configuration? – stuartd May 12 '17 at 17:17
  • 1
    Good question. And yes, it does. – Casey Crookston May 12 '17 at 17:19
  • I'm starting to think I'm going to need to create a new solution and start migrating projects into it one at a time. – Casey Crookston May 12 '17 at 17:44
  • "The 60 errors are all over the place." ~ I've seen VS throw apparently random errors when just 1 line is bad; fix that and they all go away. But that was on build, not publish. Have you tried publishing locally to your workstation? Maybe rebooting? Sounds very frustrating. Good luck. – Ken Palmer May 12 '17 at 20:29
  • I think you could ignore errors in the `index.d.ts` file. Focus on the other errors, maybe: "Copying file "Views\Shared\_LayoutPrivate.cshtml" ... Could not find the file". Is the file present? – Dávid Molnár May 14 '17 at 09:42
  • Have you tried closing/reopening the solution? I've gotten into hopeless Visual Studio situations like this and usually restarting VS fixed it for me. – Seano666 May 15 '17 at 16:59
  • This issue isn't getting a lot of my time because it's not stopping me from working, only from publishing. And, other devs are able to publish just fine. However, we have narrowed it down to being an issue with TypeScript. Some of the other devs said they were having this same issue in VS2015, and after they upgraded to VS2017 it went away. @Seano666, yes, many times. – Casey Crookston May 16 '17 at 13:43

1 Answers1

1

This question is getting a lot of views, and some stars. So I thought I would circle back to it and post the solution I found.

It turns out that my issue centered on TypeScript. Another developer had installed in on this solution while using Visual Studio 2017. And when I tried to publish using Visual Studio 2015, it kept throwing the Intellisense errors and would not let me publish.

The only way we figured out how to get around this was for me to upgrade to VS 2017. (I intended to anyway, but this just hurried the process up a little.) Once the upgrade was complete, the Intellisense errors went away and I was able to publish.

I hope this helps other people.

Casey Crookston
  • 13,016
  • 24
  • 107
  • 193