Why does A VB.NET DLL Addin for Inventor compiled on an Intel machine work on the Intel machine but not on AMD? - vb.net

Im developing continually an inventor Addin in VB.Net in visual studio 2019 ,
i have multiple machine different builds , but once in a while some machine just don't want to load the Addin f.e. the current version i have now works on all machines except one AMD machine .
When i compile the same project with the same settings no changes at all on the AMD machine with ANY CPU build option it runs without problem . When i do it on my primary developing machine it does not work on this other computer.
I checked dependencies with dependency walker , i do not get any error messages .
When i make breakpoints in DEBUG mode and debug dll compilation in the first methods called in the "StandardAddInServer.vb" file it does not reach it on the AMD machine when it is compiled on the Intel machine. But in reverse it runs smoothly .
I have no idea what this could be and I'm only speculating that is has to do with AMD/Intel difference of the machines . Any help would be appreciated to come to a solution.
Inventor 2018.3.7 Professional Build 287 is on the Intel i7-4771 machine Visual Studio Community 2019 16.3.9 , .NET 4.8.03761
Inventor 2018 Professional build 112 is on the AMD Ryzen 7 3700X machine Visual Studio Community 2019 16.7.2 .NET 4.8.03752
Any more information which could be helpful will be provided gladly .

Well.... i tought lets make the maschines identical in regards to software .. i started installing inventor updates one by one at Version 2018.3.1 the Addin magically was working .... so i hope i help somebody if the , addin automatically unloads without any error , its probably autodesk inventors fault ...

Are you using ANY CPU ,or are you forcing the project to a given bit size?
If you don't set this, and leave it at ANY CPU? Well, if you launch the application from Visual Studio (such as installing on that target machine), then the application will run as x32 bits.
HOWEVER if you launch the program from the windows command line (command prompt).
Well, if you use the x64 bit command prompt, you get a x64 bit running - in-process program. If any of your external .dll's or libraryes are x32 (or not compiled with ANY cpu), or you using any un-manage code libraies (say like ghostscript or some such)? Then your program will run (or try to) as x64 bits.
However, if you launch a x32 bit windows command prompt (there are two of them - one is x32, and one is x64). So, if you launch the .net exe (your program) from a windows x32 bit prompt, then your program will run in-process as x32 bits.
So, be careful here. Using ANY CPU from Visual Studio will ALWAYS get you a x32 bit program - including debugging. But RUNNING the program (launching outside of VS) will not always be x32 bits.
And the above behaviours seems to explain your issues/problems on the AMD machine. It was NOT that you installed VS on that machine, but that using VS to launch your program in fact FORCED it to run as x32 bits.
Bottom line:
do NOT use ANY CPU unless that is exactly what you need, and that you are VERY sure any external libraries are also compiled as ANY CPU, or in fact that any external libraries doe NOT USE any un-managed code.
All in all? I would config your project to force run as x86 ALWAYS, and thus you not get some surprises of code not working.
I doubt very much that the AMD CPU is the issue, and installing VS only worked because of forcing your project to run as x32 as opposed to x64 bits. It has zero to do with AMD here.

You could try with a former framework version like 4.6.2. That should fix the problem. It could be that the newer service packs of Inventor can deal with addins created with newer .net versions. When 2018 Inventor was released, .net 4.8 was not available.
Was Albert wrote is true as well. If the architecture of your dll doesn't meet that of your host process, it can't be loaded. A 64bit process can use 64bit dlls only whereas a 32bit one can deal with 32bit dll only. A .Net project won't be compiled by Studio into fully functional machine code (nowadays you can do this as well), but intermediate code only, which will be compiled finally by the .net framework on the target machine. If anyCPU is selected, you don't have to provide different versions for different hardware because of this behaviour.

Related

How to let CefSharp WinForms 32 bit run on Windows 64 bit?

I have downloaded the CefSharp 71.0.0-pre01 Source code from the official release, and built it successfully by VS 2015 on my Windows 7 Ultimate x64.
I have checked all x86 and x64 release build, and the project built all 22 items successfully includes the example exe.
The WinForm Example folder has 2 output in the bin, the x64 release can run well on my Win7 x64, but the x86 (32 bit) release doesn't work. Once I run the "CefSharp.WinForms.Example.exe", it shows
CefSharp.BrowserSubprocess has stopped working
When I click to check issue details, it shows:
Event Name: APPCRASH
Application Name: CefSharp.BrowserSubprocess.exe
But when I run the x86 release on the Win7 32bit machine, it works well.
I wanted to build an AnyCPU version but the project doesn't support AnyCPU, then I assumed the x86/32bit should work on both 64/32 machines. Is it possible to do that?
A case I've experienced is setting max_old_space_size to a large value which causes render subprocess to crash on startup when running in 32bit mode. Removing this option resolved the issue for me.

External function call: error 1097 upon changing machine

I have a LV program that calls an external library via wrapper functions that I downloaded via VI package manager (libxml2). This program works fine on computer A (Win7, LV2015 32-bit). Since it is meant to be portable, I have installed it on various computers (Win7) where it runs well, except for computer B. There, it throws an Error 1097 when calling the external library. The libxml2 package is obviously installed and I can see it on the Functions palette. Could it be due to the differing versions of Windows, or due to conflicts between Labview 32- and 64-bit? I open and run my program with LV 32-bit.
Computer A:
Labview 2015 (32-bit)
Windows 7
Computer B:
Labview 2015 (32-bit)
and Labview 2015 (64-bit)
Windows 10
It is very likely that the call parameters to the dll need to be changed between the 32bit and 64bit labview vi, this is indicative of the error 1097. If you have pointers or need to reserve memory these can have different size between the 64bit and 32bit variants.
For more help code needs to be shown also a more detailed error description if that is provided.
I was able to solve the problem: probably, there were race conditions and sometimes the DLL was getting illogical random input. It had nothing to do with the system.

VB.NET compiled app setup for x86 platform won't run on Windows XP/Vista 32-bit

Using VS 2010 Ultimate on my Windows 7 64-bit machine, I wrote a Windows Forms Application with Visual Basic and then compiled it with "Build" command specifically for x86 platforms ( I have tried assigning both "x86" and "Any CPU" on Active solution platform options in Configuration Manager). I have also made sure that TargetPlatform is set to x86 on Project Properties.
However, when I'm trying to run the .exe or the .msi file on my XP 32-bit machine, I get this message:
"This product is designed for x64 platform but is being installed on Intel. Obtain the correct setup from the manufacturer."
.NET Framework 4 client profile, which is a Prerequisite for my application, is also installed on the XP machine.
Does anyone have a clue for this? How can I fix this?
Thank you for your time.
I'm not sure about 2010, but in VS2008 it is sometimes necessary to go to Project Properties, Compile, Advanced Compile Options, and change the target CPU to from AnyCPU to x86.

what are all requirements for run the visual studio 2010 vb projects

I developed the project in visual studio 2010. That exe file is not supported for other PC's.
which dotnetframework to be installed? other than dotnetframework is there any other requirements needed?
Are you sure it's not the CPU type you specified during compiling (x86 vs x64 CPU). If you compiled in 64-bit and a user only has a 32-bit processor (x86), your code won't run.
The .Net Framework should work on any PC-based system, but be sure to include it in your deployment or setup package. (you can provide Excel, .NET Framework, and many other packages with your package.)
You should also try to find out what error messages your users are receiving -- which will point you in the right direction.

Does a 64-bit CruiseControl.NET exist?

Does a 64-bit CruiseControl.NET exist or do I need to install the 32-bit version? Our CI server is Server2003 64-bit. Currently I have been testing on WinXP Pro and no problems.
If I do need to run cc.net 32-bit on a 64-bit OS, what issues should I expect to encounter? This post mentions a couple, Running 32-bit ASP.NEt 3.5 apps in Windows 2003 64-bit . I would also need to have the .NET 2.0 and 3.5 framework installed. Do I install the 32-bit versions if running cc.net 32-bit? Can 32-bit and 64-bit coexist on the same server?
A quick peek at the source code reveals that CruiseControl.NET is compiled with "Any CPU" platform, so it will (and does) run on either a 32 or 64 bit runtime.
My notebook runs 64 bit O/S and has no problems with CruiseControl.NET server or web dashboard (IIS 7). Just install it as per normal and you should be fine.
Personally I'd be really worried if it needed > 3GB of memory :)
It shouldn't be anything you need to worry about. Cruise control just launches the build, subsequent steps such as compilation can be 64-bit.
I don't think there's much benefit from making CruiseControl 64-bit at the moment. I'm running CruiseControl without issues on a 64-bit machine. The setup was not much different, other than the folder which it was installed into (Program files (x86)).
Generally speaking, all 32bit applications will work on a 64bit OS. I have been doing this with my webapps for some time. You will encounter issues only if you are trying to reference assemblies across the bit boundary, ie. 64bit assembly from 32bit application.
You should be already to run CC on 32bit mode on 64bit OS.
There are no seperate version of CruiseControl for 64-bit. But but you may run into an ASP.NET error if working with Win. Server 2008 and IIS7.
Workaround:
"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe" -i
and
"C:\Windows\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe" -i "W3SVC/1/ROOT/ccnet"
NOTE: it is using Framework64 as this would not work for 32-bit.