Author Topic: Issue Publishing Project  (Read 8897 times)

Allan

  • Newbie
  • *
  • Posts: 4
    • View Profile
Issue Publishing Project
« on: January 15, 2014, 10:45:02 AM »
I'm having issues publishing a program using VS 2012.   (using EthernetIPforCLXCom)
First time I got error unable to install as OpcNetAPI version 2.1.105.1 be installed in Global Assembly Cache first.
Going from  http://advancedhmi.com/forum/index.php?topic=260.0  , I changed OpcNetApi and OpcNetApi.com  to copy local True.

After publishing second time, I now get error unable to install as OpcRcw.Da version 3.0.2.22  be installed in Global Assembly Cache first
Any suggestions as to what I do now?
Thanks
« Last Edit: January 15, 2014, 11:04:11 AM by Allan »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Issue Publishing Project
« Reply #1 on: January 15, 2014, 11:03:41 AM »
The recommended practice is not to use publish, but to copy the complete solution to the target and make a shortcut to the exe in the \bin directory.

The reasons for this is because it helps comply with the software licensing, it gives a backup, and also makes the complete solution available for the next person who comes along to edit.

Allan

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Issue Publishing Project
« Reply #2 on: January 15, 2014, 11:11:50 AM »
Thank you for your response. I'll use your method

lostcontrol

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Issue Publishing Project
« Reply #3 on: July 10, 2014, 11:29:46 PM »
The recommended practice is not to use publish, but to copy the complete solution to the target and make a shortcut to the exe in the \bin directory.

The reasons for this is because it helps comply with the software licensing, it gives a backup, and also makes the complete solution available for the next person who comes along to edit.
I just came across this when trying to find the OPC issue. I have been publishing & with Win7 the directory is hard to find. I have also copied the source across once complete.
By copying the complete solution across, how does one handle updates. I have been just copying the .exe file into where the application was published which has been sufficient, but can that method still be used?


lostcontrol

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Issue Publishing Project
« Reply #4 on: July 11, 2014, 02:27:06 AM »
Edit to above:
I was also fixated on creating a setup project so I could control where the application & therefore exe ended up.
But if I just copy the source as recommended, then updates are easier.

Archie is doing a create job!

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Issue Publishing Project
« Reply #5 on: June 16, 2015, 02:57:39 PM »
I was getting a similar error "application requires OpcNetAPI version 2.1.105.1 be installed in Global Assembly Cache first."
I tried copying over the AdvancedJHMI folder but that crashes with the error below.

I tried changing OpcNetApi  to copy local True as suggested in the OP link but that doesn't exist in the project References properties.

I don't know if this is related, but during development I sometimes get the error "'.ctor' is not a valid identifier. " but I've searched the entire solution and '.ctor' isn't found.

Thanks for any advice!

Davey

Development PC is running Win7/54, VB 2013 with platform "Any CPU". The target computer is Win7/32

  Problem Event Name:   CLR20r3
  Problem Signature 01:   advancedhmi.exe
  Problem Signature 02:   3.9.8.9
  Problem Signature 03:   55806c4a
  Problem Signature 04:   AdvancedHMIDrivers
  Problem Signature 05:   3.9.8.9
  Problem Signature 06:   55806c49
  Problem Signature 07:   219
  Problem Signature 08:   0
  Problem Signature 09:   System.InvalidOperationException
  OS Version:   6.1.7601.2.1.0.256.48
  Locale ID:   1033
  Additional Information 1:   0a9e
  Additional Information 2:   0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:   0a9e
  Additional Information 4:   0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Issue Publishing Project
« Reply #6 on: June 16, 2015, 03:03:47 PM »
Development PC is running Win7/54, VB 2013 with platform "Any CPU". The target computer is Win7/32
Try changing to x86. The OPC support files are 32 bit only, so you must force it to compile against 32 bit.

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Issue Publishing Project
« Reply #7 on: June 16, 2015, 03:19:30 PM »
I though of that but the only option in the Compile dropdown is "Any CPU". I'll dig around and see if I can change it elsewhere.

Thanks

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Issue Publishing Project
« Reply #8 on: June 16, 2015, 03:43:04 PM »
Figured that out (have to Add.. the x86 in Build config) and target is x86 but still the same error.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Issue Publishing Project
« Reply #9 on: June 16, 2015, 04:11:06 PM »
This gets to be a difficult one because once it crosses into OPC, it's in the hands of the OPC support files and the OPC server. Try to run just a blank project without anything on the form or any drivers added. Let's just make sure it's not .NET related

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Issue Publishing Project
« Reply #10 on: June 16, 2015, 06:35:14 PM »
I'm able to run another OPC client and connect to the OPC server running The OPC server is the same software and same configuration as my dev. PC.

I have to figure out how to create a second AdvancedHMI project - that's been on my to-do list ;-)

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Issue Publishing Project
« Reply #11 on: June 16, 2015, 07:34:03 PM »
I tried a second computer- 64bit Win 8.1. The installer gives the same OPC API missing error. When I copy the entire folder over  and run the bin > release exe i get a brief hourglass cursor, then nothing. No crash error, no program in the task bar nor Task manager, that I could find. I tried running as admin also.

Maybe I'll get inspired in a dream tonight.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Issue Publishing Project
« Reply #12 on: June 16, 2015, 08:55:01 PM »
Did you try to run a blank project with no controls or drivers?

If you run another OPC application, that only validates the OPC Server, but not the OPC support DLLs that act as the interface from ActiveX to .NET

daveyh

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: Issue Publishing Project
« Reply #13 on: June 17, 2015, 12:27:40 PM »
I created a new project with just a form and windows label & built and transferred to test PC. That ran.
I added an AdvancedHMI BasicLabel. Ran
Dropped an OpcDaCom control on the form. Crashed.
Deleted the control. Ran. 

I never was able to get the new project's OpcDaCom2 to actually read data from the OPC server though, even with the same settings as the OpcDaCom1.

At one point I deleted OpcDaCom1 and re-added it. The odd thing is that the other control's ComComponent property reverted to 'none' but the controls (eg BasicLabel) were still able to read data.

Not sure if related, but when I put the OpcDaCom control on the new form (OpcDaCom2), the original form with OpcDaCom1 then generates errors:

Object of type 'AdvancedHMIDrivers.OpcDaCom' cannot be converted to type 'AdvancedHMIDrivers.IComComponent'.   

Unable to cast object of type 'AdvancedHMIDrivers.OpcDaCom' to type 'AdvancedHMIDrivers.IComComponent'.

Thanks!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Issue Publishing Project
« Reply #14 on: June 17, 2015, 02:48:00 PM »
It sounds like it is definitely related to the OPC DLLs. Which unfortunately is the worst place for troubleshooting. You will need to have VS on the machine that is giving the problem. If you open OpcDaCom.vb and go to line 92, you will find the CreateDLLInstance sub. Put a breakpoint at the first line of that sub, then run the app. When it stops at the break point, use F10 to step through the code. That should get you closer to where the error comes from.


The error you get about conversion to IComComponent is a little quirk with Visual Studio and using source code drivers. Usually if you close all the forms in the designer, perform a Rebuild Solution, then open the form again, it will clear that up. If that doesn't work, you have to close Visual Studio and delete all the \bin and \obj directories (found in 3 places). Open VS and Rebuild.