开发者

Lucene.NET on shared hosting

开发者 https://www.devze.com 2022-12-10 20:36 出处:网络
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.

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 se开发者_如何学Pythontting 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

0

精彩评论

暂无评论...
验证码 换一张
取 消