Rashim's Blog

Archive for the ‘Deployment’ Category

Last couple of months, I was in rush and could not contribute to the community as much as I have been expected, but regularly I have been answering the questions and giving solutions of different technical problems that I have got through e-mail from different know-how guys.  Solving and replying those critical problems engage me 2-3 hours a day and at the same time I have to spend 8-9 hours a day in my office, so it is really tough to allocate time for writing about something new. But, then again, it is all about our part of  life; I would come up writing with new and cutting edge technologies very soon again.

Today I would like to give a solution of a weird problem that I had confronted for deploying SQLite.

”Could not load file or assembly ‘System.Data.SQLite.dll’ or one of its dependencies.”

For solving this issue I had tried a whole variety of ways but had not got my problem solved. What I had done to solve this issue was that I installed   the version sqlite-netFx40-setup-bundle-x86-2010- and then copy the System.Data.SQLite.dll to my project folder and refer this dll to my project. It solved the problem in my development PC but when I had gone for deployment I had got another error which is like that,

“Unable to load DLL ‘SQLite.Interop.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)”

It shows that the native interop assembly is required either for x86 or x64 architecture. As  ‘System.Data.SQLite.dll’  is a mixed mode assembly, I suspected it would automatically loads its native code. But I had got no luck really!! The reason behind this is might be that a particular mixed mode assembly is either for x86 or x64 not for both. Anyway I really don’t know what was the exact reason inside for this issue. After trying in many different ways I had come across the solution finally. Here it is.

First we need to install SQLite and in my case I installed it from NuGet gallery.To do that you can follow the steps that have been given below:

Go to the TOOLS->Library Package Manager->Package Manager Console of the Visual studio.


  Then run the command Install-Package System.Data.SQLite


Now in your project you have got two folders x86 and x64, underneath this folder you will find those SQLite.Interop.dll’. 


Now go to the properties windows of those dlls and set build action is content and Copy to output directory is Copy always.


Like the way you also need to change the property settings for  ‘System.Data.SQLite.dll’.

That’s it. Now build your app. You are ready to deploy and see it is working perfectly in your client machine too.

When I tried to create a virtual directory in the remote server using Nant build script It did not create and showed the error message below:

The webservice at 'remote_machine' does not exist or is not reachable

I am afraid to say that I spent a full working day to find out the proper solution for that and finally solved it. I hope it would also help those who are facing similar kind of weird problems as well. Having said that the OS of my remote server  is windows server 2008 r2 and IIS version is 7. Anyway let’s start with that,

First thing first, you need to check that you are able to connect to the remote server from IIS Manager of your local machine/current server. To do that, please follow the instructions given below.

1. Go to the IIS Manager of local machine/Current server
2. File->Connect to a Server
3. Put Remote Server name and Credentials and then try to connect

Well, Could you connect to the remote server? I suspect you might not be able also it might show a warning message like that


Okay.Lets move to fix it up. What you require to repair this issue is to enable the Management Service of remote server so that it would allow Remote Connection. For doing this you could follow this link.

Or you could follow the instructions given below,

1.Run the following command

     Dism /online /enable-feature /featurename:IIS-ManagementService

2. Go to the registry editor and,

     Set EnableRemoteManagement to 1
     under HKEY_LOCAL_MACHINE\Software\Microsoft\WebManagement\Server

3. Finally run the command again

      Net start wmsvc

Now try to connect to the remote server again from IIS Manager of your local machine/current server. This is Okay now right? 🙂

What next….

You should run the TeamCity Build Agent under the Administrative privileges. To ensure that you need to create a domain user account and have to give it the administrative privileges and finally use this account for TeamCity Build Agent. After creating a domain user account which has a administrative privileges you need to follow the instructions,

1. Open Services Management Console
2. Stop the TeamCity Build Agent Manually
3. Select TeamCity Build Agent and go to its Properties window
4. On the Properties window, select LogOn tab.
5. Select this account(not Local system) and then put the credential
6. Start the TeamCity Build Agent

Which might look like this figure


That’s it. Try to deploy your project with TeamCity again. Problem Solved right??

%d bloggers like this: