Ticket T293314
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

ImageCollection - Resource images are analyzed slowly if a project is large

ImageCollection - Cannot add from project resource file

created 9 years ago (modified 9 years ago)

I found tTwo other un-resolved cases of the same thing happening - see details here:
https://www.devexpress.com/Support/Center/Question/Details/Q459035
https://www.devexpress.com/Support/Center/Question/Details/T147036

My case is the same…

Very large project - has been working fine previously.
Just went to edit (add to) the images in a DevExpress.Utils.ImageCollection on a UserControl and got the same error, after freezing Visual Studio for about 2 minutes.
---------------------------
Microsoft Visual Studio
---------------------------
Operation is not valid due to the current state of the object.
---------------------------
OK
---------------------------
Attempted to replicate by creating a test project - but couldn't replicate.
The problem is when clicking on "Load from Project Resources" on the Add button in the "ImageInfo Collection Editor"
When adding a new UserControl (WinForms .net 4.5 - C#) to the existing project - dropping an ImageCollection on it - and attempting to "Load from Project Resources" - problem still occurs, so it is a project wide problem.

Show previous comments (7)

    ARGHH - I had to kill the vs process after taht - and now when re-starting vs - I get
    ---------------------------
    Microsoft Visual Studio
    ---------------------------
    The Add-in 'VMDebugger' failed to load or caused an exception.
    Would you like to remove this Add-in?
    If you choose yes, you will need to reinstall the Add-in to use it again.
    Error Message: Unspecified error
    Error number: 80004005
    ---------------------------
    Yes   No
    ---------------------------

      Ok - managed to get this out after turning off debug symbols (and some other things)
      Not sure what version of Visual Studio KA18588 is for - but some of the options weren't there - or different.  Perhaps that article could indicate the version used?
      Anyway…
      > Microsoft.VisualStudio.CSharp.Services.Language.dll!Microsoft.VisualStudio.CSharp.Services.Language.BaseException.ThrowENOTIMPL() + 0x1d bytes
      Microsoft.VisualStudio.CSharp.Services.Language.dll!Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CodeModelProjectCache.FindOrCreateItem(Microsoft.RestrictedUsage.CSharp.Core.FileName fileName, object parent) + 0x263 bytes
      Microsoft.VisualStudio.CSharp.Services.Language.dll!Microsoft.VisualStudio.CSharp.Services.Language.CodeModel.CodeModelFactory.Microsoft.VisualStudio.CSharp.Services.Language.Interop.ICodeModelFactory.CreateFileCodeModel(Microsoft.VisualStudio.CSharp.Services.Language.Interop.ILangService languageService, object parent, Microsoft.VisualStudio.CSharp.Services.Language.Interop.IProject project, string fileName) + 0x70 bytes
      [Native to Managed Transition]
      [Managed to Native Transition]
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectResearcherBase.GetFileCodeModel(EnvDTE.ProjectItem item) + 0x21 bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectResearcherBase.ProcessProjectItem(EnvDTE.ProjectItem item = COM Object, object data = null) + 0x13 bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectResearcherBase.RefreshCore(EnvDTE.ProjectItems items, object data = null) + 0x6f bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectResearcherBase.RefreshCore(EnvDTE.ProjectItems items, object data = null) + 0x62 bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectResearcherBase.RefreshCore(EnvDTE.ProjectItems items, object data = null) + 0x62 bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectResearcherBase.Refresh(object data = null) + 0x1f bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectImageResourceResearcher.Refresh(object data) + 0x1d bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectImagePicker.ProjectImageSelectionForm.InitResourceFileList() + 0x6d bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ProjectImagePicker.ProjectImageSelectionForm.ProjectImageSelectionForm(DevExpress.Utils.Design.ProjectImagePicker.IProjectImagePickerOwner owner) + 0xd1 bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ImageCollectionProjectImageInfoCreator.CreateForm(bool addOnly, DevExpress.Utils.Design.ProjectImagePicker.IProjectImagePickerOwner owner) + 0x3f bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ImageCollectionProjectImageInfoCreator.Create(bool addOnly) + 0x79 bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ImageCollectionAction.EditImages(DevExpress.Utils.ImageCollection col = {DevExpress.Utils.ImageCollection}, System.ComponentModel.IComponent component = {DevExpress.Utils.ImageCollection}, System.IServiceProvider serviceProvider, System.Type itemType = {Name = "ProjectImageInfo" FullName = "DevExpress.Utils.ProjectImageInfo"}, bool preserveSelected = false) + 0x7e bytes
      DevExpress.Design.v15.1.dll!DevExpress.Utils.Design.ImageCollectionActionList.OnLoadFromProjectResources() + 0x29 bytes
      [Native to Managed Transition]
      System.Design.dll!System.ComponentModel.Design.DesignerActionMethodItem.Invoke() + 0x59 bytes
      System.Design.dll!System.ComponentModel.Design.DesignerActionPanel.MethodLine.OnLinkLabelLinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) + 0x37 bytes
      System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.OnLinkClicked(System.Windows.Forms.LinkLabelLinkClickedEventArgs e) + 0x5d bytes
      System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.OnMouseUp(System.Windows.Forms.MouseEventArgs e = {X = 50 Y = 10 Button = Left}) + 0x181 bytes
      System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0x274 bytes
      System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x892 bytes
      System.Windows.Forms.dll!System.Windows.Forms.Label.WndProc(ref System.Windows.Forms.Message m) + 0x34 bytes
      System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.WndProc(ref System.Windows.Forms.Message msg) + 0x17 bytes
      System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x11 bytes
      System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x39 bytes
      System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 514, System.IntPtr wparam, System.IntPtr lparam) + 0x5e bytes

        …and if I leave it until I get the error as originally reported - the only stack trace is:
        > Microsoft.VisualStudio.dll!Microsoft.VisualStudio.UIService.System.Windows.Forms.Design.IUIService.ShowError(string message) + 0x5c bytes
        System.Design.dll!System.ComponentModel.Design.DesignerActionPanel.ShowError(string errorMessage) + 0x3e bytes
        System.Design.dll!System.ComponentModel.Design.DesignerActionPanel.MethodLine.OnLinkLabelLinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e) + 0xda bytes
        System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.OnLinkClicked(System.Windows.Forms.LinkLabelLinkClickedEventArgs e) + 0x5d bytes
        System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.OnMouseUp(System.Windows.Forms.MouseEventArgs e = {X = 30 Y = 8 Button = Left}) + 0x181 bytes
        System.Windows.Forms.dll!System.Windows.Forms.Control.WmMouseUp(ref System.Windows.Forms.Message m, System.Windows.Forms.MouseButtons button, int clicks) + 0x274 bytes
        System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x892 bytes
        System.Windows.Forms.dll!System.Windows.Forms.Label.WndProc(ref System.Windows.Forms.Message m) + 0x34 bytes
        System.Windows.Forms.dll!System.Windows.Forms.LinkLabel.WndProc(ref System.Windows.Forms.Message msg) + 0x17 bytes
        System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x11 bytes
        System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x39 bytes
        System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 514, System.IntPtr wparam, System.IntPtr lparam) + 0x5e bytes

        Answers approved by DevExpress Support

        created 9 years ago

        Hi,

        Thank you for the provided call stacks. We have discussed them with our developers and come to the conclusion that this issue can be caused by the fact that we analyze files not in an optimal way. Thus, if your application is large, you can experience such issues. Our developers have seriously re-worked our analyzer to improve the performance within the ImageCollection - Resource images are analyzed slowly if your project is large thread. Please download a hotfix from that ticket when it is ready and inform us if now you can load images from the project's resources.

        In addition, I would like to give you information you may be interested in. Our ImageCollection supports loading images from referenced assemblies. It means that you can create a separate library that will hold all the necessary images and reference this library in any project you need. We describe this approach in the ImageCollection help article. It is also possible to assign images to our controls or their elements at design time by using a smart tag. For instance, to assign an image to a bar item, simply use its smart tag and set an image by using our Image Picker as shown in the attached video. I hope that this information will be useful as well.

          Comments (1)

            Great thanks.
            I look forward to testing the hotfix when it's ready.

            Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

            Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.