English 中文(简体)
Lucene.NET on shared hosting
原标题:

I m trying to get Lucene.NET to work on a shared hosting environment. Mascix over on codeproject outlines here how he got this to work on godaddy. I m attempting this on isqsolutions.

Both examples he posted run fine on my local machine and both throw the same error on the the shared hosting server:

Compiler Error Message: CS0246: The type or namespace name  Lucene  could not be found (are you missing a using directive or an assembly reference?)

Line 1:  <%@ Page Language="C#" %>Line 2:  
Line 3:  <%@ Import Namespace="Lucene.Net.Index" %>
Line 4:  <%@ Import Namespace="Lucene.Net.Analysis.Standard" %>
Line 5:  <%@ Import Namespace="Lucene.Net.Documents" %>

I tried adding a direct reference to the Lucene.NET assambly in web.config like so:

<add assembly="Lucene.Net, Version=2.3.1.2, Culture=neutral, PublicKeyToken=a58a1be7fafc31f5"/>

But this throws its own error as well. I guess my question is: am I missing something simple or can a server side setting cause this to not work at all?

最佳回答

If Lucene.NET is not installed on the server, you will have to copy the Lucene.NET dll in your project and add a reference to this copy. You now probably have a reference that links to some dll in a Program Files directory for example. Which exists on your server, but not the deployment server.

Alternatively, you can also set the property Copy to output directory to Copy always on the dll.

问题回答

I created a asp.net app that uses Lucene and it works ok. Here´s a link to my post about it (Goomez). Also, the code is available for download. Hope it helps





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签