IronPython Microsoft.Scripting Exception - exception

I am trying to run IronPython code with c#.
I created a simple console application (.net 4) and added IronPython.dll , IronPython.Modules.dll and Microsoft.Scripting and wrote the next code -
using Microsoft.Scripting.Hosting;
namespace app
{
class Program
{
static void Main(string[] args)
{
ScriptRuntime runtime = IronPython.Hosting.Python.CreateRuntime();
ScriptEngine engine = runtime.GetEngine("py");
engine.Execute("print 'hello!'");
}
}
}
While trying to run this , I get an exception -
Unhandled Exception:
System.Reflection.TargetInvocationException:
Exception has been thrown by the
target of an invocation. --->
System.IO.FileNotFoundException :
Could not load file or assembly
'Microsoft.Scripting, Version=1.0.0.0,
Culture
=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies. The syste m
cannot find the file specified. at
Core.LanguageProvider.Python..ctor(Stream
stream) --- End of inner exception
stack trace --- at
System.RuntimeMethodHandle._InvokeConstructor(IRuntimeMethodInfo
method, O bject[] args,
SignatureStruct& signature,
RuntimeType declaringType) at
System.RuntimeMethodHandle.InvokeConstructor(IRuntimeMethodInfo
method, Ob ject[] args,
SignatureStruct signature, RuntimeType
declaringType) at
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags
invokeAttr, B inder binder, Object[]
parameters, CultureInfo culture) at
System.RuntimeType.CreateInstanceImpl(BindingFlags
bindingAttr, Binder bin der, Object[]
args, CultureInfo culture, Object[]
activationAttributes) at
System.Activator.CreateInstance(Type
type, BindingFlags bindingAttr, Binde
r binder, Object[] args, CultureInfo
culture, Object[]
activationAttributes) at
System.Activator.CreateInstance(Type
type, Object[] args) at
Core.LanguageRuntime.RegisterLanguageProvider(Type
providerType) in D:\cod
e\CodeRunner\Core\LanguageRuntime.cs:line
30 at Test.Program.Main(String[]
args) in
D:\code\CodeRunner\Test\Program.cs:lin
e 19 Press any key to continue . . .
I really , dont know what to do , searched at google and dont find a solution.
I will be glad to get help.

Whic version of iron python are you using ? The syntax you show seems belong to an older version, now you should have something like:
var ipy = Python.CreateRuntime();
anyway this blog post seems to be really accurate on pointing the correct reference to use. Anyway, ensure you have the latest IronPython version.

Related

autofac Exception type: DependencyResolutionException

For some reason, I get exception during instantiation of the home controller. I am very puzzled by it. I am thinking that may be it is caused by the different life time scope of the different dependencies - InstancePerDependency and SingleInstance.
using: Autofac.4.0.0
In my Register(). I have:
builder.Register(x => new DepositEligibilityService()).As<IDepositEligibilityService>().InstancePerDependency();
builder.Register(x => new SemanticExceptionManager()).As<IExceptionManager>().SingleInstance();
builder.Register(x => new SemanticLoggingManager()).As<ILoggingManager>().SingleInstance();
and
public class HomeController : BaseController
{
private readonly IAuthenticationManager _authenticationManager;
LoginInfo _loginInfo;
public HomeController(IDepositEligibilityService depositEligibilityService, IExceptionManager exceptionManager, ILoggingManager loggingManager):base(depositEligibilityService, exceptionManager, loggingManager)
{
// ...
}
}
I sometimes get an exception like the following:
Exception information:
Exception type: DependencyResolutionException
Exception message: An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = HomeController (ReflectionActivator), Services = [DepositEligibility.Web.Controllers.HomeController], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope ---> An exception was thrown while invoking the constructor 'Void .ctor(DepositEligibility.Web.Services.IDepositEligibilityService, Gdot.Services.SemanticLogging.Interfaces.IExceptionManager, Gdot.Services.SemanticLogging.Interfaces.ILoggingManager)' on type 'HomeController'. ---> Object reference not set to an instance of an object. (See inner exception for details.) (See inner exception for details.)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
at Autofac.ResolutionExtensions.ResolveOptionalService(IComponentContext context, Service service, IEnumerable`1 parameters)
at System.Web.Mvc.DefaultControllerFactory.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType)
An exception was thrown while invoking the constructor 'Void .ctor(DepositEligibility.Web.Services.IDepositEligibilityService, Gdot.Services.SemanticLogging.Interfaces.IExceptionManager, Gdot.Services.SemanticLogging.Interfaces.ILoggingManager)' on type 'HomeController'. ---> Object reference not set to an instance of an object. (See inner exception for details.)
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
Object reference not set to an instance of an object.
at DepositEligibility.Web.Controllers.BaseController..ctor(IDepositEligibilityService depositEligibilityService, IExceptionManager exceptionManager, ILoggingManager loggingManage)
at DepositEligibility.Web.Controllers.HomeController..ctor(IDepositEligibilityService depositEligibilityService, IExceptionManager exceptionManager, ILoggingManager loggingManager)
at lambda_method(Closure , Object[] )
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()

Operation not permitted on IsolatedStorageFileStream

I'm building this WP7 app that uses a video game API to get the statistics of someone's character (just to help learn silverlight). It grabs the players details from the web service and stores them on isolated storage on the phone to relieve strain from the server.
Originally I had a class which had both the cache writing and reading function, but now i've had to seperate it out into two seperate classes. The cache writing class doesn't matter at the moment, just the cache reading class.
On line 7, it throws an exception saying "Operation not permitted on IsolatedStorageFileStream.", but only during the second time it instantiates the class. I've done some checking with debug and it says the file definately exists, but it stops after the second using clause.
Can anyone help me with this please? I feel like I'm missing something really obvious.
public class CacheReader
{
public PlayerData GetPlayerData(string gamertagIn)
{
using (IsolatedStorageFile CachedReachData = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream stream = CachedReachData.OpenFile(gamertagIn + ".xml", FileMode.Open))
{
Debug.WriteLine("Data Retrieved from cache");
XmlSerializer serializer = new XmlSerializer(typeof(PlayerData));
PlayerData loadedPlayer = (PlayerData)serializer.Deserialize(stream);
return loadedPlayer;
}
}
}
}
[EDIT 1]
This is the stack trace i get:
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor(String path, FileMode mode, FileAccess access, IsolatedStorageFile isf)
at System.IO.IsolatedStorage.IsolatedStorageFile.OpenFile(String path, FileMode mode, FileAccess access)
at ReachPhoneApp.CacheReader.GetPlayerFromCache(String gamertagIn)
at ReachPhoneApp.Page2.GetPlayerData()
at ReachPhoneApp.Page2.cacheWriter_UpdateComplete()
at ReachPhoneApp.CacheWriter.WritePlayerDataToCache(String fileNameIn, Object objectIn)
at ReachPhoneApp.CacheWriter.client_GetGameHistoryCompleted(Object sender, GetGameHistoryCompletedEventArgs e)
at ReachPhoneApp.ReachAPI.ReachApiSoapClient.OnGetGameHistoryCompleted(Object state)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(RuntimeMethodInfo rtmi, Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeMethodInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at System.Delegate.DynamicInvokeOne(Object[] args)
at System.MulticastDelegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.Dispatch(DispatcherPriority priority)
at System.Windows.Threading.Dispatcher.OnInvoke(Object context)
at System.Windows.Hosting.CallbackCookie.Invoke(Object[] args)
at System.Windows.Hosting.DelegateWrapper.InternalInvoke(Object[] args)
at System.Windows.RuntimeHost.ManagedHost.InvokeDelegate(IntPtr pHandle, Int32 nParamCount, ScriptParam[] pParams, ScriptParam& pResult)
Check that you don't somehow have two threads accessing IsolatedStorage at the same time (ie. in VS Debug.View.Threads and verify that at the time of the exception you don't have multiple paths through the same IsoStore code).
This happened in my WP7 code once every few days and was tricky to find, as it seemed to occur only when not connectected to the debugger.
You need to call:
stream.Close();
before
return loadedPlayer;
I think the problem is that you didn't specify that multiple threads could read/write at the same time by specifying a System.IO.FileShare.ReadWrite or whatever access you need as the last parameter of OpenFile.
See the discussion here on the Microsoft Forums.
I ran into this issue as well, but for completely different reasons as mentioned above. I hadn't created the directory that I was saving into.
private void SaveStringDataToStorage(string sDirectory, string sFileName, string sFileContent)
{
string sPath;
//
using (IsolatedStorageFile oFile = solatedStorageFile.GetUserStoreForApplication())
{
if (!oFile.DirectoryExists(sDirectory))
oFile.CreateDirectory(sDirectory);
//
sPath = Path.Combine(sDirectory, sFileName);
//
using (var oWriter = new StreamWriter(new IsolatedStorageFileStream(sPath, FileMode.Create, oFile)))
oWriter.Write(sFileContent);
}
}
Using this code will work if you had the same problem as me, plus it's pretty simple so you can adapt it to whatever you need. I was using this code before I had issues, but I'd forgotten the ! so the directory was never created haha. Just typical. Hope this helps :)
EDIT
Looking closer at the original question, it may be that the file didn't exist. I think it's always best to do IsolatedStorageFile.DirectoryExists() and IsolatedStorageFile.FileExists() before trying to access either location, whether you are reading or writing.
By default when you use IsolatedStorageFile.OpenFile("filename", FileMode.Open) your file gets locked by this thread and no other thread would be able to access this file until 1st thread close it. But if you like to share your file in multiple threads for read purpose only then I would recommend you to use following override
IsolatedStorageFile.OpenFile("filename", FileMode.Open, FileAccess.Read, FileShare.Read)
see details here

Security Exception using MySQL and Entity Framework on godaddy

We are getting a SecurityException when using Entity framework on godaddy. The entity has been configured against a MySQL store. (v. 6.1.2) A bit of weirdness with the exception though... Looking at the exception stack it seems to imply that if we open up a connection to MySQL anywhere in the site, then we should get the same exception; however, opening up a MySQL connection directly seems to be working in another part of the site...
Here's the verification:
using (MySqlConnection connection = new MySqlConnection(ConnectionString))
{
connection.Open();
...
}
Anyone run across a similar issue?
The complete error stack trace is as follows:
[SecurityException: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
System.Reflection.MethodBase.PerformSecurityCheck(Object obj, RuntimeMethodHandle method, IntPtr parent, UInt32 invocationFlags) +0
System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +470
System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051
System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111
System.Resources.ResourceManager.CreateResourceSet(Stream store, Assembly assembly) +357
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +471
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +583
System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents) +583
System.Resources.ResourceManager.GetString(String name, CultureInfo culture) +74
MySql.Data.MySqlClient.Resources.get_PerfMonCategoryName() +40
MySql.Data.MySqlClient.PerformanceMonitor..ctor(MySqlConnection connection) +43
MySql.Data.MySqlClient.MySqlConnection.Open() +434
System.Data.EntityClient.EntityConnection.OpenStoreConnectionIf(Boolean openCondition, DbConnection storeConnectionToOpen, DbConnection originalConnection, String exceptionCode, String attemptedOperation, Boolean& closeStoreConnectionOnFailure) +173
System.Data.EntityClient.EntityConnection.Open() +96
System.Data.Objects.ObjectContext.EnsureConnection() +81
System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) +46
System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator() +44
jet.Controllers.WorkOrder.WorkOrderView..ctor() +219
jet.Controllers.WorkOrder.WorkOrderView.get_Instance() +29
jet.Controllers.WorkItemController.Index() +11
lambda_method(ExecutionScope , ControllerBase , Object[] ) +39
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +17
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +178
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +24
System.Web.Mvc.<>c__DisplayClassa.<InvokeActionMethodWithFilters>b__7() +53
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +258
System.Web.Mvc.<>c__DisplayClassc.<InvokeActionMethodWithFilters>b__9() +20
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +193
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +382
System.Web.Mvc.Controller.ExecuteCore() +123
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +23
System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +7
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +144
System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +54
System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +7
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
Weird one. GoDaddy shared-hosting ASP.NET apps execute under Medium Trust, and perf counter creation probably requires full trust, but perf counter creation is not what's failing here. (and if it failed, it wouldn't propagate out since perf coutner creation exceptions are swallowed by mySQL client code).
Instead, it's failing trying to access a string resource, before perf counter creation. The failure is with this line of code in Resources.Designer.cs of the MySQL client:
return ResourceManager.GetString("PerfMonCategoryName", resourceCulture)
A few things to try, in increasing order of difficulty:
ensure you have the MySQL client DLLs in your app's BIN directory and you're not trying to load the client DLL out of GoDaddy's GAC. Never depend on GoDaddy-supplied binaries if you can avoid it!
switch to EN-US culture so the client doesn't have to go hunting for another resource DLL, and see if the problem goes away.
Build the .NET client from source code, instead of copying DLLs from a binary distribution into your app's BIN directory. This will make problems like this easier to debug since the mySQL code won't be a black box. And, in a pinch, will let you change the problematic resource-fetching calls (or hard-code the locale)! :-)
BTW, in case you're tempted to set "Use Performance Monitor=false" in your connection string to try to evade the problem, don't bother. The problematic code gets executed regardless of that setting:
public PerformanceMonitor(MySqlConnection connection)
{
this.connection = connection;
//// this line is where it bombs
string categoryName = Resources.PerfMonCategoryName;
//// this line is affected by connection string setting
if (connection.Settings.UsePerformanceMonitor && procedureHardQueries == null)
{
try
{
procedureHardQueries = new PerformanceCounter(categoryName,
"HardProcedureQueries", false);
procedureSoftQueries = new PerformanceCounter(categoryName,
"SoftProcedureQueries", false);
}
catch (Exception ex)
{
Logger.LogException(ex);
}
}
}
Justin was spot on. Problem was godaddy has an older version of the MySql dll in their gac and the entity framework was picking it up!
Here's the fix. (Apply this to web.config)
<configuration>
...
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d"/>
<bindingRedirect oldVersion="5.0.7.0" newVersion="6.1.2.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
...
</configuration>
I simply added trust level="Full" to my Web config file, and it worked

Com SSIS Err on Schdeule ON 64 Bit Server

I am using this in Script Component In SSIS-->
Microsoft.Office.Interop.Excel.Application objXL = new Microsoft.Office.Interop.Excel.Application();
objXL.DisplayAlerts = false;
objXL.Visible = false;
Workbook objWorkbook = objXL.Workbooks.Open(strFileNameWithFolderName, false, true, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
Worksheet objSheet;
//Get SheetName of the Workbook which contains exact the same columns
for (int i = 1; i <= objWorkbook.Worksheets.Count && strMatchedorNot==false; i++)
{
& so on
when i execute this directly, it runs without problem, but when i try to schedule this it shows this errr
escription: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A03EC): Microsoft Office Excel cannot access the file '\10.177.189.12\C$\inetpub\WWW_TEST\Abc\Mapping Rules Upload\1000000023_elizafox_Jan-05-2010_113731.xlsx'. There are several possible reasons: ? The file name or path does not exist. ? The file is being used by another program. ? The workbook you are trying to save has the same name as a currently open workbook. at Microsoft.Office.Interop.Excel.Workbooks.Open(String Filename, Object UpdateLinks, Object ReadOnly, Object Format, Object Password, Object WriteResPassword, Object IgnoreReadOnlyRecommended, Object Origin, Object Delimiter, Object Editable, Object Notify, Object Converter, Object AddToMru, Object Local, Object CorruptLoad) at ST_a8f4e90e3d884d578f79a2269c50080c.csproj.ScriptMain.Main() --- End of inner exception stack trace --- 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.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript() End Error Warning: 2010-01-07 08:47:22.58 Code: 0x80019002 Source: LOOP Through Each Input File(Request Not Completed) Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. End Warning Warning: 2010-01-07 08:47:22.58 Code: 0x80019002 Source: SABRE_SVR Description: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors. End Warning DTExec: The package execution returned
when i disable this step and schdeules this,Pkg run successfully.
i am running it thru 64-bit server.
Please help me.
Regards,
Manish
I suspect this is an security issue since you try to access the admin share c$.
Did you already try to schedule under a different account?

Getting an exception when site is pushed to production

This is probably a shot in the dark but here goes nothing...
I have a Sitecore 6 site that I am developing locallty. When I pushed it to the production server, I now get an exception when trying to access the site. I had done an upgrade of the Sitecore version, and added the Forms module, among some other minor edits. So I moved everything to production, changed the connection strings, and changed the directory references in the web.config, but I still get this error.
My local machine still works fine, and even my staging server (hooked up via SVN and Cruise Control) works fine, but I can't fix this error on production.
At the bottom of the stack trace (below), it looks like it is trying to instantiate the search manager. Maybe that has something to do with it?
Or maybe I missed a setting when I moved everything? What settings need to be changed when the environment changes?
Here is what I've tried so far:
Re-copied all of the files and databases.
Gave full control permissions to the worker process, ASPNET, and Network Service users.
Double checked the directory paths in the web.config that needed to be configured.
Double checked the connection string in the connectionstring.config.
Recycled the App Pool
Stopped and started the site
Cleared my local browser cache (as they instruct you to do in the upgrade docs)
This is the exception that is being thrown when I try and access any page:
Thread information:
Thread ID: 1
Thread account name: 180716WEB1\testcom_web
Is impersonating: False
Stack trace: 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.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)
at Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, PropertyInfo property, Object value)
at Sitecore.Reflection.ReflectionUtil.SetProperty(Object obj, String name, Object value)
at Sitecore.Configuration.Factory.AssignProperties(Object obj, Object[] properties)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
at Sitecore.Configuration.Factory.CreateObject(String configPath, Boolean assert)
at Sitecore.Search.SearchManager..cctor()
Custom event details:
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
It seems that there's something wrong with rights.
Make sure that you run the right identity(NETWORK SERVICES) in your AppPool and that you follow the Sitecore Installation instructions which can be found on SDN:
Kind regards,
Alex de Groot
Sitecore Solution Architect
It turned out to be that when I restored the database to production, it didn't re-associate the database user with it!!! Stupid me! For whatever reason, that causes this error to occur. I'm guessing that the SearchManager is setup as some sort of external service or something, to abstract things.
I got this error after moving a site between environments. The cause was the path for the sc.variable named dataFolder was incorrect. The value was a full file path and the site was in a different location on the new server.
<sc.variable name="dataFolder" value="c:\www\website\data\" />
Updating the web.config with the correct path fixed the problem.