Deploying Com Interop into sharepoint server - sharepoint

I have a com interop dll (zkemkeeper.dll) that i have to register and use, i wonder how can i deploy that to the SharePoint server using SharePoint package?

You cannot deploy COM or COM Interop DLL to SP farm by SP solution. You need to install the component on every SP server in the farm by other means.
Create an MSI installer to be executed on every machine. MSI can be rolled out automatically too.
Provide a PowerShell script to be executed on every machine. PowerShell can be run remotely too.
Deploy a timer job with your solution that would be executed after the installation automatically or manually and would write to the registry the necessary COM stuff.
The first two options are my favourite because they shouldn't cause technical problems at the customer. The third one appears to promise installation without visiting every machine but the Timer Service user identity would need permission to write to the local registry which may not always be granted; and you'd have to resort to 1. or 2. anyway.
You should think about switching over to ASP.NET or .NET components on the long term. There are many components available in pure .NET that can be deployed by SP solutions. You can also consider pure HTML/JavaScript controls. I would probably go for the option 1. and invest the saved time to other architecture without the COM Interop.
--- Ferda

If you are using Sharepoint 2010, see How to: Add and Remove Additional Assemblies.
See also:
Deploying custom dll's in SharePoint 2010
Visual Studio - SharePoint 2010 - Include Assembly > Quick Question
Include 3rd party dll in the Sharepoint project while packaging the wsp
visual studio does not copy assembly into gac
How to install a WSP that has dependant assemblies?

Interop.zkemkeeper.dll regsvr32 error or InitializeComponent
Then you need done the step following:
Go to the website: http://www.zktechnology.com
Download ->Software Download->ZK Access for C3 panels
Extract files
Install
Open visual studio -> Solution Project->references-> Add Interop.zkemkeeper.dll
Good luck

Related

Finding DLL Dependencies for Classic ASP Web application

I am a system admin tasked with migrating Classic ASP based web application from Windows Server 2003 (IIS 6) to Windows Server 2008 r2 (IIS 7.5)
The application is very old written in around 2002-03 and the concerned developer people are not around anymore to let me know anything related to this Web Application.
After lot of trial and error, I have been able to get the Web Application running on 2008 r2.
While navigating through application, I am getting various errors which on further investigation I understood are related to DLLs which the Web Application is invoking.
My issue is, I don't know what all DLLs are used/invoked on the source server, which I need to copy & register on the new server.
I tried to use DependancyWalker but I am not able to find a way to use this tool for Web Application.
I would really appreciate this community's help in this regard.
I found out a simple way of finding the DLLs which are specific to my Web Application.
I got a small freeware utility called as RegDLLView from Nirsoft.net which lists all the DLLs which are registered with the Server with File Paths, Description, Company name, etc details.
I found out all the DLLs which my Web Application is invoking by checking the company name and paths of all the DLLs which were listed.
Now I just have to copy these DLLs to my new server and register these on the new system.
It's not rocket science.
When you find a COM component dependancy you can use the ProgId to identify and locate the DLL which is registered in the Windows Registry.
The only DLL dependancies come from COM component DLLs and these can only be invoke in Classic ASP / VBScipt with the
Server.CreateObject("ProgId")
and
CreateObject("ProgId")
respectively.
Wrote about this extensively here
Error ASP 0177: 8007007e Server.CreateObject fails for COM DLL

VSTO Addin Creates 2 items in Add/Remove programs

I have created a vsto addin in VS2012. I have added an installation project to the solution using Installsheild LE. After installing the exe that I get, I get the expected item added to my add/remove programs. However when I open Word, I get prompted with a Microsoft Office Customization Installer prompt which says the publisher is unknown. I click OK to this and it adds my addin as expected, which all works fine but I also get a second item appear in my add/remove programs.
Can anyone tell me why I am getting the second item in add/remove programs and offer any advice about what I should do to avoid this?
You have to add "|vstolocal" to the addin registry value that points to your addin file. This tells ClickOnce to run it directly and not install it per-user.
You also want to digitally sign the addin using a certificate issued by someone in the users trusted root. This could be VeriSign or others. If you create your own certificate you have to use custom actions to install the root certificate in the certificate store and to register the publisher cert as a trusted publisher.
I've created about a dozen of these installers over the last 8 years and it's tricky at first but gets easier over time. Several of my customers are using InstallShield LE to get the prereqs installed but then I factor all the components out into a WiX merge module where I can use things like the Util extension to install certificates.
It looks like you use ClickOnce and MSI installers to deploy the add-in. You need to remove any of them. Both kind of installers are described in the following articles in MSDN:
Deploying an Office Solution by Using ClickOnce
Deploying an Office Solution by Using Windows Installer
Is that your dev machine and got Visual Studio in it? I have seen this happened with Windows 7 during development the addin is added in to add/remove programs. This has gone later when I updated my Windows 7 machine. Some updates from Microsoft has removed this later.

SharePoint 2010 Web Front End Application Server dll deployment

We have a SharePoint farm configured with one SQL server, an Application server and one Web Front End. All assemblies run from the GAC on the WFE, except one. This one dll has to be forced (using gacutil) into the GAC on the App server in order to see changes in our SharePoint application.
My question is, what determines that this dll must run on the App server and not with the rest on the WFE? I assume because of this, I cannot debug in Visual Studio from the WFE. Do I have to install Visual Studio on the App server as well?
When setting up a timer job, it's possible to use the constructor to specify a specific server. That's likely how things got set up for this solution and associated .dll file. More info on that here:
http://www.martinhatch.com/2009/08/sharepoint-timer-jobs-and-multiple.html
As for adding Visual Studio to servers on your farm, if this is your production farm I do not recommend doing this. If you really need to debug in production (you really, really should have a development box set up for this), do it via remote debugging.

How do I create an InstallShield LE project to install a windows service?

I downloaded Visual Studio 2012 yesterday when it was released on MSDN. I have noticed that a few of the project types that we had in 2010 are gone or different. The biggest difference for me right now is the removal of the Windows Installer project. Now we are being forced to use the InstallShield LE (Limited Edition). The problem here is that I write a ton of Windows Services and I can't see how to setup InstallShield LE. It appears that we (my company) will have to invest in licenses for the professional edition.
Has anyone found a way to install services in InstallShield LE? When using the Windows Installer project, you just set the custom actions.
For Visual Studio 2012 & InstallShield LE, do the following:
Run through the InstallShield project assistant and add the primary output of your service to the Application files section.
After you are done with the project assistant, double click the "Files" item under step two of the setup project.
Right click on the primary output of your service, and go to properties.
Click the "COM and .NET Settings" tab, and place a check in the "Installer Class" checkbox.
Click Ok
Now, once you build and run your install, your service will show up in the Windows Services snap in.
Note that this assumes you added a "Project Installer" to your service project (Right click on the service design sheet and click "add installer"). I can confirm this work on Windows 8 with Visual Studio 2012 / InstallShield LE.
I've recently installed VS 2012 with Install Shield LE. At first I kept getting a ISEXP -5036 internal server error after a build (this was after setting up a ISLE project and running through the Install Shield Project Assistant). Eventually I found out that it was trying to create the MSI in the DVD-5 media type which is where it was failing. For some reason, creating the solution again from scratch somehow recognizes to only build to the CD_ROM and SingleImage media types which works.
Anyway to rectify the 5036 error, click the Build tab in VS 2012 (top menu), select configuration manager and you should see that your IS setup file is selected on the DVD-5 configuration. Change this to CD_ROM and click close. Once you build/rebuild it will complete with no IS 5036 error.
While using the installer class checkbox may work for some instances, you may experience the following error:
Error 1001.The specified service already exists
Here is an excerpt from this link on how to resolve this issue:
For Error: Error 1001.The specified service already exists
This error will occur if the component installing a .NET Service is
incorrectly configured with ".NET Installer Class" set to Yes. The
method to install a .NET Service is to use Component\Advanced
Settings\Services view, not the ".NET Installer Class" setting.
Making definitions in the Component\Advanced Settings\Services view
creates entries in the Windows Installer ServiceControl and
ServiceInstall Tables. These entries are used by the Windows
Installer "InstallServices" action to install the Service.
If your project is .NET, then try then you can use the ServiceProcessInstaller class with InstallShield LE.
To get it to work with InstallShield, you have to go into the InstallShield "files" tree and right click on your file. Then check the checkbox for "Installer class" on the "COM and .NET settings" tab.
I have gotten it to work, but I've had problems on some OS's like Windows 2008R2. Your mileage may vary.
Here is an example: http://www.codeproject.com/Articles/14353/Creating-a-Basic-Windows-Service-in-C
I had all sorts of problems with this.
As follows.
InstallShield takes ages to download
the registration process is a pain.
the configuration options are confusing and overly complex.
the accepted solution on this thread is a hack and it doesn't always work - see 1001 in the documentation - essentially you need to get through the paywall to get the right configuration options to install a windows service.
Solution for me as mentioned elsewhere - was to abandon InstallShield
Very easy from that point.
Edit: Update - install the latest version from here https://wix.codeplex.com/releases/view/115492 for vs 2013 / 2015
Visual Studio setup projects are back in VS 2013 as a visual studio extension.
https://visualstudiogallery.msdn.microsoft.com/9abe329c-9bba-44a1-be59-0fbf6151054d
Please update your solution and projects to VS 2013. If you are still in VS 2010, you are probably better off by upgrading directly to VS 2013.
My experience with Installsheild LE is that it is very quirky but once you figure out the tricks, it is easier to use. However, I think that the limited edition is a way by Microsoft and Flexera to sell the fully featured edition. In other words, first we pay Microsoft a lot of money for Visual Studio and then their partner (in crime) more for Installsheild. Bad strategy which did not work out since they had to bring back the setup projects in VS 2013.
I've written about this subject:
Augmenting InstallShield using Windows Installer XML - Windows Services
Basically you create a merge module using WiX to encapsulate the service and then add it to your installshield project. ( Be sure to associate to the INSTALLDIR directory to make sure your file goes where you expect ). Build and test on a VM. Piece of cake.
I'm using VS2012 and Installshield LE Spring Edition. I did not have to use Wix.
If you encounter the error "Could not create _isconfig.xml for use with InstallUtilLib.dll", please create a folder with the same name as your setup project and inside the setup project folder.
Credits to http://community.flexerasoftware.com/showthread.php?165929-Could-not-create-_isconfig-xml-for-use-with-InstallUtilLib-dll
I just got some problems finding where to add installer as referred in the answer. So here it is how.
Double click on your service class within your Windows service Project
A blank screen with the text "To add components to your class, drag them from the Toolbox and use the Properties window to set their properties..."
Right click anywhere but on the links and select "Add Installer"
see ya
Bear in mind that all the above explanation will not help you if you plan to create later an upgrade of that setup. InstallShiled LE can't stop the running service when you upgrade. You can't do it either from Window Service Installer -> BeforeInstall event.
Wanted to put this here;
On VS 2015, when doing this, I ran into the 1001 error upon installation repeatedly.
Answer on this page explained that on the newer versions (anything past 2012), apparently you need to explicitly leave the installer class option unchecked, and then add your windows service under the Services section under Step 3 of the installer project:
Error 1001 when installing custom Windows Service

How can I improve the edit-compile-test loop when developing a SharePoint workflow?

Recently I had to develop a SharePoint workflow, and I found the experience quite honestly the most painful programming task I've ever had to tackle. One big problem I had was the problems I encountered when I had to step through it in the debugger.
There's an article on how to debug a SharePoint workflow here that tells you how to set breakpoints etc. This involves copying the .pdb file into the GAC alongside the .dll file containing your workflow. You have to do this from a command prompt (or a batch file) because Windows Explorer doesn't let you view the relevant subdirectory of c:\windows\assembly.
However, if you do this, the next time you try to deploy the workflow from within Visual Studio, it complains that it can't be deployed because "the file may not be signed" and if you attempt to copy the new version of the dll into the GAC, it tells you that the .dll file is locked.
I've found that some of the time, you can get round this by doing an iisreset, but on other occasions you have to restart Visual Studio and there have been frequent times when I've even had to reboot the computer altogether because some mystery process has locked the file. When I don't use the debugger, on the other hand, everything works just fine.
Does anyone know of a simpler way of debugging workflows than this?
I've got a lot faster developing SharePoint-Solutions in general (not only Workflows) when i started using WSPBuilder. WSPBuilder has a Visual Studio Addin called WSPBuilder Extensions and in my opinion the WSPBuilder Extensions do a better job than the infamous Windows SharePoint Services 3.0 Tools: Visual Studio 2008 Extensions, Version 1.2. Thanks to the WSPBuilder Menu deploy/upgrade/uninstall of a solution is just one click away!
The SharePoint team is currently working on MOSS extensions for VS 2008 which will allow this type of functionality. This was available in VS 2005 with MOSS extensions, but has to be run off Windows Server with a full MOSS installation and the correct permissions set.
One thing that would really help is if the SharePoint team provided interfaces for the SP-specific workflow services needed to run SP workflows. This would allow you to mock those interfaces and run the workflows outside of SP proper. AFAIK, you can't do that today.
I've personally found SharePoint extremely painful to develop against... not just with workflows, but overall. I understand the administrative wins and the end user productivity, but it's a fairly dreadful experience for Joe .NET Developer.
As for speeding up the IIS reset, Andrew Connell has some tips here as well
http://www.andrewconnell.com/blog/archive/2006/08/21/3882.aspx
This brought my IIS reset time from 10+ seconds down to less than 2 seconds.
I'm not sure you need to get the pdb file into the GAC. (At least, the fix I'm about to describe works just fine for debugging SharePoint web parts in VS2005, which have a similar problem.)
There's a checkbox marked "Enable Just My Code (Managed Only)" in Tools-->Options-->Debugging; if you uncheck it, then Visual Studio will happily load your pdb's from the bin\Debug folder where it built them. Probably. Can't hurt to try, anyhow...
Check out STSDev on CodePlex by SharePoint MVPs like Ted Pattison, Andrew Connell, Scot Hillier, and more.
STSDEV is a proof-of-concept utility application which demonstrates how to generate Visual Studio project files and solution files to facilitate the development and deployment of templates and components for the SharePoint 2007 platform including Windows SharePoint Services 3.0 (WSS) and Microsoft Office SharePoint Server 2007 (MOSS). Note that the current version of the stsdev utility only supports creating projects with the C# programming language.
Keith

Resources