ch
  • ch
  • Newbie Topic Starter
2011-05-19T21:26:53Z
My previous computer broke and I purchased a new machine.

I installed VS.NET and most other programs that I needed. I also transferred all of my existing project code etc and installed iGrid & igPrintmanager.

iGrid & igPrintManager work OK in new projects but I am getting this error when I try to use iGrid or igPrintmanager on existing projects (one that were already setup on previous machine)

Error message is :-


Microsoft Visual Studio

Failed to create component 'iGrid'. The error message follows:
'System.Runtime.InteropServices.COMException (0x8004D745): A reference to the component 'TenTec.Windows.iGridLib.iGrid' already exists in the project.
at VSLangProj.References.Add(String bstrPath)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.PerformReferenceUpdate(List`1 newReferences)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.System.ComponentModel.Design.ITypeResolutionService.ReferenceAssembly(AssemblyName name)
at Microsoft.VisualStudio.Design.Serialization.CodeDom.AggregateTypeResolutionService.ReferenceAssembly(AssemblyName name)
at System.Drawing.Design.ToolboxItem.GetType(IDesignerHost host, AssemblyName assemblyName, String typeName, Boolean reference)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host)
at System.Drawing.Design.ToolboxItem.CreateComponentsCore(IDesignerHost host, IDictionary defaultValues)
at System.Drawing.Design.ToolboxItem.CreateComponents(IDesignerHost host, IDictionary defaultValues)
at Sys...'

OK


=========== End of error message ============

This is how I installed iGrid on my new machine. First I installed the demo version and next copied over the four full-version iGrid igprintmanager components (TenTec.Windows.iGridLib.iGrid.dll and TenTec.Windows.iGridLib.iGrid.xml
and (TenTec.Windows.iGridLib.iGPrintManager.dll and TenTec.Windows.iGridLib.iGPrintManager.xml) files.


So please can you tell me which step(s) did I omit do wrong?

Thanks ch
Igor/10Tec
2011-05-20T13:19:07Z
Maybe, this is the key phrase which can help to solve the problem:

引用:

A reference to the component 'TenTec.Windows.iGridLib.iGrid' already exists in the project.



It seems you already have a reference to iGrid.NET in your project, and VS generates this error when you try to add one more reference to the same component.
ch
  • ch
  • Newbie Topic Starter
2011-05-20T18:33:51Z
Thank you Igor. I had seen that error message and suspected some duplication but I was unsure of how this might have happened. It turns out that the components had been installed to the default location but then a colleague moved the 10Tec components to a General/Library folder within the current project for neatness sake. Unfortunately this caused the iGrid components to be removed from the Toolbox view. But the program still could Build and run. Then, to fix that apparent problem, I tried to re-installed them; And so there were two of everything.

For now I'll return the 10Tec components to their default location and delete the other set of files. Hopefully all will be OK again. I'll reply to this thread after I have tried thos 'fix'.

Thank you for your prompt help.
Igor/10Tec
2011-05-21T07:27:32Z
Originally Posted by: ch 

... a colleague moved the 10Tec components to a General/Library folder within the current project for neatness sake. Unfortunately this caused the iGrid components to be removed from the Toolbox view.



Yes, sure - if you moved the DLLs, then they cannot be found by VS.

And there is one more thing that is the case for iGrid.NET 3.0. This version is implemented in two DLLs, one is the core functionality and the other is design-time only one (because of the so called client profile introduced in .NET Framework 4.0). The design-time part DLL is placed into a special separate folder, and the corresponding registry key which points to this folder is created during the demo installation; this key is needed in VS IDE so it can find the design-time part of the control.

That's why we ask all customers to install the demo first as it also makes some preparations in the system which allow us to use the component properly.
ch
  • ch
  • Newbie Topic Starter
2011-05-21T21:45:45Z
Hi Igor,

Thank you for your help so far. And I am happy to say that I am making progress. I have got iGrid working again and all 10Tec components are visible in the Toolbox also. No more "Already exists in project".

I am using iGrid.Net v2.5 but now when I use the igPrintManager with iGrid I get a different error message.

=====Error message===========
Could not load file or assembly 'TenTec.Windows.iGridLib.iGrid, Version=2.50.15.0, Culture=neutral, PublicKeyToken=9d47002745f2416c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
=====End of Error message===========

This happens with only a New From with just one iGrid and one igPrintManager added. None of my code is used. This error occurs within the call to InitializeComponent():


public Form1()
{
    InitializeComponent();
}

As shown in the error message, the igPrintManger is version 2.50.15.0 while I am using iGrid.net version 2.50.27.0.

Can you tell me if these product versions compatible?

Perhaps while transferring to the new machine I just managed to salvage these versions of the downloaded zip files.

Regards
ch
Igor/10Tec
2011-05-23T07:09:41Z
The version of the PrintManager should be the same as the iGrid.NET version. We use strong names for our assemblies, and in fact it is the requirement of the .NET Framework.

Check the references in your project. It seems, you need to point the proper version of the PrintManager.
ch
  • ch
  • Newbie Topic Starter
2011-05-23T12:10:18Z
Its working again.
Thank you very much for your help.
Regards
ch