I am trying to use IronPython (2.7.3) in my MS load test (Visual studio 2012)
When calling : var engine = Python.CreateEngine();
I am getting :
Failed to load language 'IronPython 2.7.3': The method or operation is not implemented. ---> System.NotImplementedException: The method or operation is not implemented.
at Microsoft.VisualStudio.TestTools.Common.EqtStringPerThreadWriter.get_Encoding()
at System.IO.TextWriter.SyncTextWriter.get_Encoding()
at IronPython.Runtime.PythonFile.InitializeConsole(SharedIO io, ConsoleStreamType type, String name)
at IronPython.Runtime.PythonContext.SetStandardIO()
at IronPython.Runtime.PythonContext.InitializeSystemState()
at IronPython.Runtime.PythonContext..ctor(ScriptDomainManager manager, IDictionary`2 options)
--- End of inner exception stack trace ---
at Microsoft.Scripting.Runtime.LanguageConfiguration.LoadLanguageContext(ScriptDomainManager domainManager, Boolean& alreadyLoaded)
at Microsoft.Scripting.Runtime.DlrConfiguration.LoadLanguageContext(ScriptDomainManager manager, LanguageConfiguration config)
at Microsoft.Scripting.Runtime.DlrConfiguration.TryLoadLanguage(ScriptDomainManager manager, AssemblyQualifiedTypeName providerName, LanguageContext& language)
at Microsoft.Scripting.Runtime.ScriptDomainManager.GetLanguageByTypeName(String providerAssemblyQualifiedTypeName)
at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngineByTypeName(String assemblyQualifiedTypeName)
--- End of inner exception stack trace ---
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Reflection.Assembly.CreateInstance(String typeName)
It's strange because when I am running a single unit test everything works perfectly.
I have IronPython 2.7.3 installed and have all the IronPython requested DLLs in my project.
In addition, I am also using Resharper for tests executing - When I ran a single test it's works and when i am trying to run a set of tests together it's crashes with same exception
Solve it :
var runtime = new ScriptRuntime(setup);
var ms = new MemoryStream();
runtime.IO.SetOutput(ms, new StreamWriter(ms));
runtime.IO.SetErrorOutput(ms, new StreamWriter(ms));
var engine = runtime.GetEngine("IronPython");
Apparently , i need to add the output streams.
Related
I am running website on kentico 11.
When i'm trying to host and run locally through iis am getting following error.
When am running website directly from visual studio to browser. Then i am not getting this issue.
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.IO.FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
Source Error:
Line 23:
Line 24: // Initialize CMS application. This method should not be called from custom code.
Line 25: InitApplication();
Line 26: }
Line 27:
Source File: \CMS\App_Code\Global.asax.cs Line: 25
Stack Trace:
[FileNotFoundException: Could not load file or assembly 'Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.]
CMS.Core.AssemblyDiscovery.IsAssemblyDiscoverable(String filePath) +0
CMS.Core.AssemblyDiscovery.AddOnlyDiscoverableAssembly(ICollection`1 assemblies, Dictionary`2 preloadedAssemblies, AssemblyName assemblyName, String filePath) +131
CMS.Core.AssemblyDiscovery.ExecuteGetAssemblies(Boolean onlyDiscoverable) +1192
CMS.Core.AssemblyDiscovery.get_DiscoverableAssemblies() +31
CMS.Core.TypeManager.PreInitializeTypes() +193
CMS.Core.ModuleEntryManager.PreInit() +19
CMS.Core.AppCore.PreInit() +146
CMS.DataEngine.CMSApplication.PreInit() +164
CMS.DataEngine.CMSHttpApplication.InitApplication() +24
Global..cctor() in \CMS\App_Code\Global.asax.cs:25
[TypeInitializationException: The type initializer for 'Global' threw an exception.]
Global..ctor() +0
ASP.global_asax..ctor() +48
[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +142
System.Activator.CreateInstance(Type type, Boolean nonPublic) +107
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) +1476
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +186
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[] args) +82
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +174
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +347
[HttpException (0x80004005): Exception has been thrown by the target of an invocation.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +552
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +122
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +737
any help is much appriciated
This package is added to the solution via nugets. It referenced in packages.config.
Clean and rebuild should help. Make sure the it exists in the /packages folder, if not restore nugets (or Update-Package ) for your solution and try to rebuild again. It must exists the /bin folder after the build.
I have some handlers running on the IIS server in Windows server 2019. All this handlers are working fine as expected for all the requests.
Suddenly from yesterday, weirdly server is responding failure for the all the request without any changes on the hosted application. Im not attaching to the debugger or any such debugging tools.
Here is the error:
[Exception: Debugger detected - this software cannot run with
Debugger.] AuthorizeService.RegistryProvider.BuildPartition() +68
.cctor() +8
[TypeInitializationException: The type initializer for ''
threw an exception.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached,
RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +119
System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly,
Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
+232 System.Activator.CreateInstance(Type type, Boolean nonPublic) +83 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes, StackCrawlMark& stackMark) +1088
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr,
Binder binder, Object[] args, CultureInfo culture, Object[]
activationAttributes) +124 System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binder binder, Object[] args,
CultureInfo culture) +20
System.Web.HttpRuntime.CreateNonPublicInstance(Type type, Object[]
args) +60
System.Web.HttpRuntime.CreateNonPublicInstanceByWebObjectActivator(Type
type) +59
System.Web.HttpApplication.BuildIntegratedModuleCollection(List`1
moduleList) +167
System.Web.HttpApplication.GetModuleCollection(IntPtr appContext)
+1068 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr
appContext, HttpContext context, MethodInfo[] handlers) +82
System.Web.HttpApplication.InitSpecial(HttpApplicationState state,
MethodInfo[] handlers, IntPtr appContext, HttpContext context) +173
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr
appContext, HttpContext context) +218
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr
appContext) +296
[HttpException (0x80004005): The type initializer for '' threw
an exception.] System.Web.HttpRuntime.FirstRequestInit(HttpContext
context) +10074716
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest
wr, HttpContext context) +254
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.7.3429.0
I'm suspecting there is some configuration issue on IIS that needs to be modified. On IIS Manager, [.Net Compilation] => [Debug] already set to [false]. Also, [Server side Debug mode] on ASP set to [False].
Did you insert any dl-ls into the References? They might be old and may not work which is causing the program to not work just go to the Debug of the program, %userprofile%\source\repos{NameOfProgram}{NameOfProgram}\Bin\Debug{ProgramFileName}, and it should start the program. Just don't debug it will give an error while inserting the code of the program.
%userprofile% represents current user
We are getting following error in event log because InternalOperationPlugin is trying to create 'Business Closure Calendar' in Calender entity almost every minute.
InternalOperationPlugin is a core system plugin which is registered on Stage 30 (non-customizable). Can anyone give an idea why core plugin is trying to create this record every minute.
We are on Roll up 8 and not in position to install latest.
Thanks in Advance
The Web Service plug-in failed in OrganizationId: 07ae1f6f-237f-e111-83c6-005056b41d30; SdkMessageProcessingStepId: 22ccbb1b-ea3e-db11-86a7-000a3a5473e8;
EntityName: calendar;
Stage: 30;
MessageName: RetrieveMultiple;
AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35;
ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin;
Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: System.ArgumentException: Item has already been added. Key in dictionary: '7fdf4980-237f-e111-83c6-005056b41d30' Key being added: '7fdf4980-237f-e111-83c6-005056b41d30'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at Microsoft.Crm.ObjectModel.CalendarService.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context)
** Error from Event Log **
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
at Pipeline.Execute(PipelineExecutionContext context)
at MessageProcessor.Execute(PipelineExecutionContext context)
at InternalMessageDispatcher.Execute(PipelineExecutionContext context)
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request)
at SandboxSdkListener.Execute(SandboxCallInfo callInfo, SandboxSdkContext requestContext, String operation, Byte[] serializedRequest)
at
at SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs)
at DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
at ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
at ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
at MessageRpc.Process(Boolean isOperationContextSet)
at ChannelHandler.DispatchAndReleasePump(RequestContext request, Boolean cleanThread, OperationContext currentOperationContext)
at ChannelHandler.HandleRequest(RequestContext request, OperationContext currentOperationContext)
at ChannelHandler.AsyncMessagePump(IAsyncResult result)
at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at AsyncResult.Complete(Boolean completedSynchronously)
at TryReceiveAsyncResult.OnReceive(IAsyncResult result)
at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at AsyncResult.Complete(Boolean completedSynchronously)
at ReceiveAsyncResult.OnReceiveComplete(Object state)
at SessionConnectionReader.OnAsyncReadComplete(Object state)
at AsyncThunk.UnhandledExceptionFrame(IAsyncResult result)
at LazyAsyncResult.Complete(IntPtr userToken)
at NegotiateStream.ProcessFrameBody(Int32 readBytes, Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
at NegotiateStream.ReadCallback(AsyncProtocolRequest asyncRequest)
at FixedSizeReader.CheckCompletionBeforeNextRead(Int32 bytes)
at FixedSizeReader.ReadCallback(IAsyncResult transportResult)
at AsyncResult.Complete(Boolean completedSynchronously)
at ReadAsyncResult.OnAsyncReadComplete(Object state)
at SocketConnection.AsyncReadCallback(Boolean haveResult, Int32 error, Int32 bytesRead)
at IOCompletionThunk.UnhandledExceptionFrame(UInt32 error, UInt32 bytesRead, NativeOverlapped* nativeOverlapped)
at _IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Web Service Plug-in failed in SdkMessageProcessingStepId: {22CCBB1B-EA3E-DB11-86A7-000A3A5473E8}; EntityName: calendar; Stage: 30; MessageName: RetrieveMultiple; AssemblyName: Microsoft.Crm.Extensibility.InternalOperationPlugin, Microsoft.Crm.ObjectModel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35; ClassName: Microsoft.Crm.Extensibility.InternalOperationPlugin; Exception: Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.Services.Protocols.LogicalMethodInfo.Invoke(Object target, Object[] values)
at Microsoft.Crm.Extensibility.InternalOperationPlugin.Execute(IServiceProvider serviceProvider)
at Microsoft.Crm.Extensibility.V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context)
at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
Inner Exception: System.ArgumentException: Item has already been added. Key in dictionary: '7fdf4980-237f-e111-83c6-005056b41d30' Key being added: '7fdf4980-237f-e111-83c6-005056b41d30'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at Microsoft.Crm.ObjectModel.CalendarService.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context)
.
UPDATE
I have already checked Calendar Entity. There is only one record with Id equals to '7fdf4980-237f-e111-83c6-005056b41d30'. Mpreover, I have searched whole database to find out if there is any other record using same Id.
Perhaps this is just a bug in MonoDevelop but I am trying to build an Orchard website using MonoDevelop on Windows7. I am using the latest MonoDevelp v 2.6b1 and when I try to run Orchard v 1.0 which can be downloaded directly from Codeplex I get the following error. Seems like a partial trust error but I don't get this error when using Visual Studio 2010. (I am trying to see how easily I can create an Orchard Website using only Open Source/Free tools).
Adding applications '/:.'...
Registering application:
Host: any
Port: any
Virtual path: /
Physical path: C:\dev\Orchard.Source.1.0.20\src\Orchard.Web\
Handling exception type SecurityException
Message is That assembly does not allow partially trusted callers.
IsTerminating is set to True
System.Security.SecurityException: That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstan
Unhandled Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers.
at System.Security.CodeAccessSecurityEngine.ThrowSecurityException(RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, IPermission permThatFailed)
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
at System.AppDomain.CreateInstanceAndUnwrap(String assemblyName, String typeName)
at Mono.WebServer.XSP.Server.RealMain(String[] args, Boolean root, IApplicationHost ext_apphost, Boolean quiet)
at Mono.WebServer.XSP.Server.Main(String[] args)
at Application.Xsp.Main(String[] args)
I do not think you are running on Mono, for one, as Mono does not implement this security system. Make sure you tell MD that you want to run on Mono if that's what you intend.
As for actually running it on Mono, you might want to look at this thread: http://orchard.codeplex.com/discussions/247340.
When trying to use SPWeb.GetSiteData(SPSiteDataQuery) (Trying to bind some data to SPGridView), it throws me an TargetInvocationException with a following stacktrace:
Exception
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance)
at System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments)
at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
at System.Web.UI.WebControls.GridView.DataBind()
at Balticovo.SharePoint.WebParts.CrossSiteDataQueryWebPart.OnLoad(EventArgs e)
The method that is being invocated is GetData. After investigating InnerException with message Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) it looks like SharePoint want to release resources somwhere:
at Microsoft.SharePoint.Library.SPRequest.ReleaseResources()
at Microsoft.SharePoint.SPRequestManager.Release(SPRequest request)
at Microsoft.SharePoint.SPWeb.Invalidate()
at Microsoft.SharePoint.SPWeb.Close()
at Microsoft.SharePoint.SPWeb.Dispose()
at Balticovo.SharePoint.Extensions.GetCrossSiteData(SPWebApplication webApp, SPCrossSiteDataQuery query)
at Balticovo.SharePoint.TasksTableAdapter.GetData(Guid queryId, Boolean dataForOutlook)
at Balticovo.SharePoint.TasksTableAdapter.GetData(Guid queryId)
But all those methods up to SPWeb.Dispose() I don't dispose anything before I call SPWeb.GetSiteData(SPSiteDataQuery) which then throws an exception.
My Code
Instance of SPWebApplication i get like this - Microsoft.SharePoint.WebControls.SPControl.GetContextWebApplication(HttpContext.Current);
Then i do some stuff like this in function GetCrossSiteData:
foreach (string siteUrl in query.QuerySites)
{
try
{
using (SPSite site = new SPSite(siteUrl))
using (SPWeb web = site.OpenWeb())
{
DataTable dt = web.GetSiteData(query.SiteDataQuery); //Hangs here
....
}
}
}
Any ideas? Thank you.
Turns out that the cause was that for some lists TemplateFeatureId property was set to a template that does not really exist or was changed in some way. As in my case i just recreated those lists and now queries are running fine.
Found this out by this article: http://blog.myitechnology.com/2009/06/fixing-feature-guid-for-list-template.html
Just DO NOT USE that tool to fix the problem - he say's he's modifying the content database (i suppose directly). That's a no-no-no. I just used it to see which lists have the problem.