Visual Studio website: errors on one site, not on another

43 views Asked by At

in VS2013 Ultimate, this code works fine in one website, but gives the errors below in another (both sites local, on same machine).

Imports DocumentFormat.OpenXml.Packaging
Imports DocumentFormat.OpenXml.Presentation
Imports A = DocumentFormat.OpenXml.Drawing
Imports System.Collections.Generic


Dim slideIndex As Integer = 1
Dim wrkSlideIDList As New SlideIdList
wrkSlideIDList = wrkPreso.Presentation.SlideIdList
Dim n As Object = wrkSlideIDList.Count
Dim x2 As Object = wrkSlideIDList(slideIndex)

Errors:

Class 'DocumentFormat.OpenXml.Presentation.SlideIdList' cannot be indexed because it has no default property

'Count' is not a member of 'DocumentFormat.OpenXml.Presentation.SlideIdList'.

Another thing is that on the "working" site, I can comment out ALL the Imports, and while that causes many other errors, it won't cause the errors above.

I've compared the References between the two sites (twice), and they are the same (best I can tell). I may not have compared the references properly, but what else might I look for?

1

There are 1 answers

0
wayfarer On

I found a workaround:

For slideIndex = 0 To wrkSlideIDList.ChildElements.Count - 1
    wrkSlideID = wrkSlideIDList.ChildElements(slideIndex)

which works fine, so I'm attributing the problem to obscure VS behavior, and considering this resolved.