 |
|
|
|
Just not sure if this is the right place to post, but here it is. I have Sharepoint 2010 successfully running, and successful crawling of files. I can deploy a simple winforms application and get search results back. Now I use the exact same DLL from within a Visual Web GUI application, and have no idea what needs to be added. I don't know if this is a Sharepoint security issue when running under the "asp.net" world, or a VWG issue with properly naming the assemblies in the web.config.
I don't know if this is a permissions issue related to IIS, or something I have to do at the Sharepoint, or other Server level.
I think that I should not deploy the Microsoft DLLs for Sharepoint, as they are in the GAC.
When I run the search process, the error I get is:
could not load type microsoft.office.server.search.administration.searchserviceapplicationproxy from assembly microsoft.office.server.search, version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c
I am not running any kind of Sharepoint web site, or web part. I am running code directly against Sharepoint.
I believe the VWG app is running as a 32 bit application, and I KNOW the DLLs for Sharepoint (and Sharepoint itself is 64 bit). So because the winforms application works, and is set to ANY CPU, which means it will run 64 bit, I am not sure what this means in terms of VWG calling a DLL, made in Visual Studio 2008, set to ANY CPU. Don't know if there is a different approach I need to have VWG essentially call this 64 bit item.
I can run Sharepoint code directly on a server in a winforms app, but when simply attaching the asp.net web app to the winforms app (converted to a class DLL), I get this error. Just not sure it this means more security must be set.
The winforms application is made in Visual Studio 2008 on a 32 bit Windows 7 development machine. Even though I am not using this directly on the Win7 machine, it does compile. When I move it to the Windows Server 2008 live production server and run it, I can fully get a list of files from Sharepoint from a crawled file content source. The winforms application is set to run on any CPU, so I guess that is why it is allowed to compile and then work properly on the server, calling Sharepoint 64 bit DLLs.
Then I simply move that code into a class library DLL, and call it from an asp.net application (more specifically, a Visual Web GUI application). I get the "could not load type" error above. That is not a can't find file error, so I believe it finds the Sharepoint DLLs, but cannot execute them.
So I don't know if the 32 bit web application in IIS on Win 2008 can call the DLL that includes the Sharepoint 64 bit files.
I don't know if this is a
a) Security Issue
b) 32 to 64 bit issue
c) VWG issue
d) Some other issue
This is the code that works perfectly from just running a simple winforms app:
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Search
Imports Microsoft.SharePoint.Administration
Imports Microsoft.Office.Server
Imports Microsoft.Office.Server.Search
Imports Microsoft.Office.Server.Search.Administration
Imports Microsoft.Office.Server.Search.Query
Imports VaultSharepoint.Parse
Public Class SP
Public Shared Function LocateFilesSP(ByVal queryText As String, ByVal dtSyncJobs As DataTable) As DataTable
Dim rtc As ResultTableCollection = Nothing
Dim retResults As New DataTable()
Dim sqlText As String
Dim tempPath As String
Try
Dim context As SPServiceContext = SPServiceContext.GetContext(SPServiceApplicationProxyGroup.[Default], SPSiteSubscriptionIdentifier.[Default])
Dim ssap As SearchServiceApplicationProxy = TryCast(context.GetDefaultProxy(GetType(SearchServiceApplicationProxy)), SearchServiceApplicationProxy)
Using sqlQuery As New FullTextSqlQuery(ssap)
sqlText = "SELECT Author, Write, Path, Size, FileName FROM SCOPE() WHERE ("
With dtSyncJobs
' Pretty important line here. If no paths, then return nothing.
' If did not return nothing, then sqlText would error, not to mention the
' possibility of ALL files being shown to the user. The syntax here would
' accidentally not allow through, but be sure!
If .Rows.Count = 0 Then Return Nothing
For i As Integer = 0 To .Rows.Count - 1
' Add the file: prefix.
' Combine SyncPath and Folder; Folder might be empty.
tempPath = "file:" & _
(.Rows(i)!SyncPath.ToString & .Rows(i)!Folder.ToString).Replace("\", "/")
sqlText &= "(CONTAINS(Path,'""" & tempPath & "" & _
"" * """') And FREETEXT(DEFAULTPROPERTIES, '" & RepQuote(queryText) & "') And ISDOCUMENT=1) OR "
Next
End With
' Strip off the last OR part.
sqlText = sqlText.Substring(0, sqlText.Length - 4)
sqlQuery.QueryText = sqlText
sqlQuery.ResultTypes = ResultType.RelevantResults
sqlQuery.RowLimit = 10000
sqlQuery.ResultsProvider = SearchProvider.SharepointSearch
sqlQuery.EnableStemming = True
sqlQuery.EnablePhonetic = True
sqlQuery.TrimDuplicates = True
rtc = sqlQuery.Execute()
If rtc.Count > 0 Then
Using relevantResults As ResultTable = rtc(ResultType.RelevantResults)
retResults.Load(relevantResults, LoadOption.OverwriteChanges)
End Using
End If
End Using
Return retResults
End Try
End Function
End Class |
|
|
|
 |  |
|
|
|
Hi Derek,
My hunch is that this is a 32/64 bit issue, where you are running a 32bit process accessing a 64bit only DLL, although I wouldn't eat my hat if it was untrue :-)
What you can do is to force Visual WebGui to run in 64bit mode and see if the problem is solved by that switch. In some previous 6.4 version, and I do not have the information which version it was, the Visual WebGui assemblies were made 32bit / 64bit agnostic, meaning that they can run either as a 32bit or as a 64bit process.
In order to force Visual WebGui to run as 64bit application, you need to do two configuration changes on your IIS. First, you need to go to the Application Pool for the application and set "Enable 32-Bit Applications" to FALSE. Second, you need to register a 64bit *.wgx handler mapping for your website or application. The easiest way to do that is to open IIS manager and go to handler mappings (assuming IIS 7.x) and locate for instance *.ashx mappings. If you have a 64bit machine with ASP.NET 4.0 installed you will see 4 handler mappings for *.ashx, two for v4.0 (32bit and 64bit) and two for v2.0 (32bit and 64bit). If you are using VS2008, you would choose the v2.0 64bit *.ashx handler, double-click it and copy the Executable. Then create a new *.wgx mapping (in addition to your existing 32bit *.wgx) and paste the executable you copied before.
This should give you a 64bit running Visual WebGui application, which might possibly solve your problem.
Hope this helps,
Palli
Páll Björnsson -
Visual WebGui support team - Email: support@visualwebgui.com |
|
|
|
 |  |
|
|
|
What do I answer for this question when I add the wgx mapping?
Do you want to allow this ISAPI extension? Click "Yes" to add the extension with an "Allowed" entry to the ISAPI and CGI Restrictions list or to update an existing extension entry to "Allowed" in the ISAPI and CGI Restrictions list.
Yes-No-Cancel
************************************************************************************************************
And more importantly, when I tried both scenarios, answering Yes or No above, it does not work. The first screen of my web page does come up, but then I log on and get this. So if my first page comes up, something is allowing it to work, so:
1) Does that mean I properly have the version of VWG (6.4.0 RC1 for .NET framework 3.5, as read in the add/remove programs) that allowed for 32-64 bit to be agnostic?
2) When I log in I get this error, so where do I even begin troubleshooting this?
3) I assume this link means that I do not need 64 bit assemblies, because they were never produced. Please verify what these links mean. It seems that availability on the 64 bit assemblies was going to be created, but then Gizmox reverted to the fact that the 32 bit assemblies can work fine on a 64 bit machine.
http://www.visualwebgui.com/Developers/KB/tabid/654/category/Code3/article/w_deploying_64bit_assemblies_on_64bit_platform/Default.aspx
http://www.visualwebgui.com/Developers/Forums/tabid/364/forumid/29/threadid/25137/scope/posts/Default.aspx
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
Gizmox.WebGUI.Forms.Component.RenderDragAndDropAttributes(IContext objContext, IAttributeWriter objWriter, Boolean blnForceRender) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Component.cs:536
Gizmox.WebGUI.Forms.Component.RenderComponentAttributes(IContext objContext, IAttributeWriter objWriter) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Component.cs:486
Gizmox.WebGUI.Forms.Control.RenderAttributes(IContext objContext, IAttributeWriter objWriter) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:2575
Gizmox.WebGUI.Forms.ListView.RenderAttributes(IContext objContext, IAttributeWriter objWriter) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\ListView.cs:4556
Gizmox.WebGUI.Forms.Control.RenderControl(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:2919
Gizmox.WebGUI.Forms.Control.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3038
Gizmox.WebGUI.Forms.Control.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID, Boolean blnFullRedraw) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3004
Gizmox.WebGUI.Forms.Control.Render(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3060
Gizmox.WebGUI.Forms.Control.RenderControl(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:2928
Gizmox.WebGUI.Forms.Control.Gizmox.WebGUI.Common.Interfaces.IRenderableComponent.RenderComponent(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:2849
Gizmox.WebGUI.Forms.TabControl.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\TabControl.cs:526
Gizmox.WebGUI.Forms.Control.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID, Boolean blnFullRedraw) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3004
Gizmox.WebGUI.Forms.Control.Render(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3060
Gizmox.WebGUI.Forms.Control.RenderControl(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:2928
Gizmox.WebGUI.Forms.Control.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3038
Gizmox.WebGUI.Forms.HeaderedPanel.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) +455
Gizmox.WebGUI.Forms.Control.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID, Boolean blnFullRedraw) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3004
Gizmox.WebGUI.Forms.Control.Render(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3060
Gizmox.WebGUI.Forms.Control.RenderControl(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:2928
Gizmox.WebGUI.Forms.Control.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Control.cs:3038
Gizmox.WebGUI.Forms.Form.RenderControls(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Form.cs:1356
Gizmox.WebGUI.Forms.Form.Render(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Form.cs:1308
Gizmox.WebGUI.Forms.Form.RenderControl(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Form.cs:902
Gizmox.WebGUI.Forms.Form.Gizmox.WebGUI.Common.Interfaces.IForm.RenderForm(IContext objContext, IResponseWriter objWriter, Int64 lngRequestID) in c:\Program Files\Gizmox\Visual WebGUI\Sources 3.5\Gizmox.WebGUI.Forms\Form.cs:1030
A.c4d3cdb893b7f640a5aa2a40bfe2211b1.RenderResponse(IResponseWriter& objResponseWriter, IServerResponse objResponse, IRequestParams objRequest, Int64& lngTimeMarker, Int32 intNextInvokationTime, IForm objMainForm, Boolean blnFullResponse) +415
A.c4d3cdb893b7f640a5aa2a40bfe2211b1.ProcessRequest(HostContext objHostContext) +2696
[HttpException (0x80004005): Object reference not set to an instance of an object.]
A.c4d3cdb893b7f640a5aa2a40bfe2211b1.ProcessRequest(HostContext objHostContext) +4111
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +599
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +171
|
Version Information: Microsoft .NET Framework Version:2.0.50727.4963; WebGui Version:2.0.50727.5710
|
|
|
|
 |  |
|
|
|
Hi Derek,
You must answer "Yes" to this question generally, but since it was alredy enabled on the *.ashx extension, you may be able to get away with saying "No". I would recommend the Yes though.
1) No, this shouldn't mean that you don't have 64bit capable assemblies. You should get different error message if that was the case. To be sure, I verified a simple app in 6.4.0 RC1 64bit and it worked fine.
2) Not easy for me to say what this might be as I don't have your application. My best bet would be to go through the execution stack dump until you get to some control that's relevant for you and start looking there. The Top line in the stack dump references DragDropeventArgs and the forth line references ListView, so I would take a look at something related to DragDropEventArgs in your ListView for starters.
3) You are absolutely right about previous discussions, and I will update those threads and the wiki very shortly. The information about the bit agnostic capability of the Gizmox assemblies was brought to my attention a very short time ago and when I wrote the previous reply to you, it was the first time I had to verify this personally. So, yes, this means you do not need 64bit specific Gizmox assemblies, as was the original idea for implementing it.
Hope this helps,
Palli
Páll Björnsson -
Visual WebGui support team - Email: support@visualwebgui.com |
|
|
|
 |  |
|
|
|
OK, here is what I decided to do.
1) I could not get the 64 bit Visual Web GUI DLLs working. My first logon screen appeared, but then the error above happened. Not even going to begin researching what might have caused that. I have multiple 3rd party add-ons to the VWG project, so it could have easily chewed up two weeks solving that.
2) I completely switched to using web services inside a Winforms application (for quick testing) against the Sharepoint Server (a separate Win 2008 Server set up properly as a domain server). This worked almost out of the box. But then I moved the web services directly into the VWG site, and placed on the Win 2008 box. No can do. I wound up going in circles, having learned more about Kerberos and NTLM than I ever wanted to know. So Sharepoint does not expect you to use the web services from within a web app, unless you want to spend 3 days figuring it out, or a couple thousand bucks to a Sharepoint expert.
so we move on...
3) Working directly against the Sharepoint Object Model, which does not work from my local machine, because it does not have Sharepoint 2010 installed, and because it is not 64 bit (Sharepoint 2010 is ONLY 64 bit). But that was not my goal. It was to use Sharepoint only on the server from within my VWG application. So here is what I did. The Sharepoint query object model, which works out of the box perfectly if a Winforms application is installed directly on the server, was easily moved into a vb.net web services project. So then I call the web service from within the VWG application, all installed directly on the server. Works perfectly. This is how to bypass the issue of 32/64 bit, and VWG not being able to call it. VWG is supposed to work in 64 bit, but it will take somebody greater than I to get that working. I only had to form grey hair on about 1/4 of my head to figure this out.
Time for a hot tub. |
|
|
|
|  |