My release dll is not working on other devices vb.net autocad - vb.net

I am working on a project to make an Autocad addon for our engineering department. The project is nearly finished, but when I build the project and send the dll to my colleagues for them to add in autocad, it is not working for them. I can not seem to find a solution on the internet.
- I am using Visual studio 2019
- Autocad 2020
- I make the dll's by releasing it on a x64 platform
- They "netload" it in autocad and the commands that work on my device do not work on theirs
I hope somebody can help me, I am a self thought vb.net engineer for autocad, so I am not that experienced with the basics.

The signing thing should not be required - it works okay here.
Some things to check:
in VS2019, did you set Copy -> false for the DLLs that are referenced ?
when the receiver of your DLL does a right-click on the DLL (in the file explorer), is there an option to unlock the file ? If so, unlock it
Use AnyCPU
I always distribute the Debug version, maybe give that a try ?
is there an error message that you can share ?

It's trusted on your device but unless it's signed it won't be trusted on other machines. That is a security requirement to stop unsigned assemblies from running unknown script.
You can use a self signing certificate for your own machine but unless it comes from an known certification authority it may kick up a stink. You could attempt to add it to their Global Assemby Caches or to see some security is blocking it.

Related

Outlook Addin Updating - Replacing DLL sufficient?

Working on an outlook addin and I was wondering if manually replacing the compiled DLL on a target machine is sufficient when I decide to update my addin ? is that practice even valid for stability ?
on some minor changes i did to my addin for tests, It seemed to work, even without changing the manifest, or re-deploying but I'm not sure it will still work if the project changes from end to end - Like, is it possible to take a whole different addin dll, and simply place it instead of a dll that is already installed - and walla ? does its manifest even acknowledge the content of the dll or simply point to it?
is sufficient when I decide to update my addin ? is that practice even valid for stability ?
Theoritically, you can replace the add-in assembly with a new one. But the host application should be closed at that time to let you delete/overwrite an existing file. Be aware, the Trust center settings in Outlook can be adjusted to load only signed with a digital signature assemblies. In that case your add-in will not be loaded by the host applications.
Consider using ClickOnce for updating add-ins on the fly. See Deploying an Office Solution by Using ClickOnce for more information.
Yes, as long as you do not change the addin's class name.

Visual Studio 2012 fails to compile exe with no code errors

When running a project in Test or Debug configuration in VB.NET using Visual Studio 2012, sometimes it gives the following error as the reason for "Build Failed"
Error 1 Could not copy the file "obj\Debug\MyProgram.exe" because it was not found. MyProgram
There are no issues with the code as it was just compiled seconds before this (sometimes I start the program again just to see how everything gets laid out visually and then go back to the code to make Location adjustments)
What I found is this. If I wait , when I go to test compile again -- it just magically starts working again -- Only to fail again later.
Sometimes, I can get 10-15 good compiles before it wigs out.
About my system configuration:
I do not have any other version of Visual Studio or standalone .NET language installed
The paths are set correctly (else it would never compile in the first place.. not just occassionaly fail)
The program can be a simple program with absolutely no code added (aka... New > WinForms Project > Compile)
The project, language (and all requirements), and project output path are on a local drive that is connected directly to the PC internally (using C:\code* for projects and the standard install location for Visual Studio 2012)
I checked the smart data and scanned my hard drive for any errors ... none ever encountered. The temperature of my system (CPU), and the drive is around 25-30 degrees C.
I am really baffled as to why this happens and at random. I have also tried completely clearing out the bin/ folder, and even Moving the project or repointing where the compiled output path is.
Deleting the .suo file helps sometimes, but not all the time.
I believe this is something that may be able to be tweaked in the UI somehow, however I do not know anything about manually linking and compiling programs.
Lastly -- it does not matter whether I run VS in "Administrator" mode (elevated privileges) or as a user.
Some methods that may help you
Have you tried to reinstall Visual Studio. If that does not work you may need to install some of Windows Updates, the compiler may be missing some essential libraries/references to compile your application.
Check your .Net Target Framework, setting your application to a new framework that you don't have installed can stop the application from compiling yet even stop it from being debugged, having a compiler that is to low, this may come with errors for the compiler but not for the IDE/Visual Studio to notice.
Try cleaning your project solution's output folder by right clicking your solution then try to rebuild your project/solution.
Check your compilation references in your project's properties, check if a reference added is not on your computer
Reinstall/Update .Net Framework, same here some requirements may be missing from your installation
Try installing a newer version of Visual Studio, try Vs2013 - this contains various improvements and fixes, Visual Studio 2015 is fast approaching, a recommendation install VS2015 when the full version gets released it will contain a lot of useful features for future .net programming.
Create an new Administrator account and Run VS with Administrator rights and try compiling then, this fixes some of problems in vs and other microsoft products, it might work here.
Install all of the .Net Frameworks from the lowest to current 4.5, this may help when some of the used references/libraries are not on your local hard drive.
if none of these methods work, i would not know of the problem one last thing you could try is installing Windows to another hard drive and try using that installation of windows and see what happens... Hope this helps.
Best regards!
I faced this kind of problem because of my virus guard
blocked my application(but it is not have any harmful code :) )
exclude your project folder from virus guard
or
simply disable it(not recommended)

OneNote 2013 Add-in won't load. How to debug?

I'm following the excellent tutorial by Malte Ahrens on how to create a OneNote add-in.
Initially I followed it step by step, making a few changes (just renaming the class, and using my own name and GUID in the assembly) info. As I'm using VS2012 and am not yet ready to hand-roll a WiX installer I manually copied over the built dll to the correct place and also created a registry file to make the requisite entries. I confirmed that they were all there, loaded up OneNote but no add-in, going to "mange COM addins" section I saw the following error:
Load Behavior: Not loaded. A runtime error occurred during the loading of the COM Add-in.
I spent some time debugging this but didn't get very far. So this afternoon I decided to start again but copy his code verbatim. I simply downloaded the example project, used the trial of Vdproj to Wix to create the installer and built everything.
I get the exact same error.
Why is this please? What does this mean and most importantly how do I debug the problem?
A few specifics about my environment and where it may differ from the original tutorial.
I am running Office 2013 AND it's 64bit. His tutorial is for 2010. This means when I loaded up the demo solution I had to remove the non-existent reference to the Onenote 14 Interop and add the v15 version.
In terms of registry entries they go to the right place, not the WOW6432 registry nodes. I doubly know this as if I load up OneNote and then refresh the HKCR registry node for the add-in, the LoadBehavior switches to 0x00000002, (disabled).
Other things that may be worth noting.
I have enabled OneNote logging and it's quiet on my issue.
There are 2 other posts on here with a seemingly similar problem (but Office 2010) here and here, neither got a response. The first guy had it loading once, but then had to manualy start it each time, mine never loads (and I've not signed my assembly) the second guy never got a response.
As I say, even knowing how to debug this further would be a great step forwards.
Edit:
I've gone back to debugging my own version, which is almost identical anyway as I'm not sure what the installer is actually doing and I think because it's a demo of the wix converter it's only allowing me to build for x86.
If I add OneNote.exe under "start external program" and run debug on my add-in, I see the following lines appear when I try and tick the add-in under "manage COM add-ins" within OneNote. I'm afraid I'm still pretty green at all this so I'm not sure what it means.
First-chance exception at 0x00007ffe4f86ab78 in ONENOTE.EXE: 0x800401FD: Object is not connected to server.
First-chance exception at 0x00007ffe4f86ab78 in ONENOTE.EXE: 0x800401FD: Object is not connected to server.
First-chance exception at 0x00007ffe4f86ab78 in ONENOTE.EXE: 0x800401FD: Object is not connected to server.
Also, since reading up more I think me simply copying my dll into the install folder program files\[manufacturer]\[application] (as I don't have an installer) was not enough. I've now executed this against my dll
PS C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319> .\RegAsm.exe
and it came back with
Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.33440
for Microsoft .NET Framework version 4.0.30319.33440
Copyright (C) Microsoft Corporation. All rights reserved.
Types registered successfully
Is there anything else I should be doing to register the dll correctly?
Enable logging for OneNote 2013:
Create a file "EnableOneNote2013APILogging.reg"
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\OneNote\Options\Logging]
"EnableLogging"=dword:00000001
"EnableTextFileLogging"=dword:0000001
"ttidLogObjectModel"=dword:00000001
"ttidLogObjectModelAddins"=dword:00000001
Create a file "DisableOneNote2013APILogging.reg"
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\OneNote\Options\Logging]
"EnableLogging"=dword:00000000
"EnableTextFileLogging"=dword:0000000
"ttidLogObjectModel"=dword:00000000
"ttidLogObjectModelAddins"=dword:00000000
This is based on http://blogs.msdn.com/b/descapa/archive/2006/12/08/debugging-the-onenote-api-enable-logging.aspx but you need to add EnableTextFileLogging ;-).
The logfile is created in %temp%\OneNote.log
For OneNote 2010 change the path in the .reg files to \14.0\ instead of \15.0\

ChilkatXML ActiveX DLL registered but failing

I have an old legacy VB6 application that uses the free ChilkatXML ActiveX DLL extensively. I recently installed this application on a customer's PC – running 64 Bit Win7 (which it usually runs okay on) – and the XML document saving functions are failing. At first it was even failing to open existing documents, but I ran the full Chilkat installer – as it's a free component – and that part at least appears to be fixed.
The customer admitted the PC previously had a virus on it, so I'm thinking there may be some residual OS damage the clean up operation has missed. I've opened the DLL in Dependency Walker, which reported an error with the SYSNTFY.DLL module not being found – although I've checked and that DLL does exist in their System32 folder. I've tried copying the 32Bit version of that dll from my system into their sysWOW64 folder but that didn't work either – not that I realistically expected it to.
So, any ideas on what I need to do to fix this problem please?

VB.Net Installation and DLL horrors

have been working and wearing out my fingers doing google searches with this one:
I generally develop on server side, but we require small desktop apps to connect certain hardware pieces with our web based software -- I put something together with very limited knowledge of VB.Net no issues there. I don't know much about making installers, messing with the registry or signing programs to make antivirus software not flag my executables as unsafe.
My main woe is that I have a DLL file I used for my installation which I don't know how to register during the installation process. I am using VB.Net Express 2010 for the actual application code and InnoIDE to compile an installation script with those files.
Is there a script I can add to InnoIDE so it will register the DLL file for me? Or is this something I can do programmatically from VB.Net (Express version, not full...). The DLL is a COM library, so according to the research I did it requires registering.
As an aside, any information anyone could provide in terms of signing the application or something which will stop antivirus software from warning users that this file could be potentially unsafe? We use Avast in the office and in all test machines Avast tried to have the app run in the sandbox every time I ran it.
Thank you in advance, and please let me know if this question requires further information.
Since InnoIDE is just a graphical interface to Inno Setup you could try using the Pascal Scripting function RegisterServer.
From above link
Registers the DLL/OCX with the specified filename. If Is64Bit is True,
the DLL/OCX will be loaded as a 64-bit image and registered in a
64-bit process. If FailCriticalErrors is True, the system will not
display any critical-error-handler message boxes. Raises an exception
if not successful.