Moving file error during build phase in Unity - firebase

I get this when building .apk in Unity. I've tried to restart the PC, run Unity with Administrator privileges but it doesn't work. I'm lost.
Console output:
IOException: Failed to Move File / Directory from 'Temp/StagingArea\android-libraries\firebase-core-11.2.0\classes.jar' to 'Temp/StagingArea\android-libraries\firebase-core-11.2.0\libs\classes.jar'.
UnityEditor.Android.PostProcessor.Tasks.ProcessAAR.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (BuildPostProcessArgs args)
UnityEditor.PostprocessBuildPlayer.Postprocess (BuildTargetGroup targetGroup, BuildTarget target, System.String installPath, System.String companyName, System.String productName, Int32 width, Int32 height, System.String downloadWebplayerUrl, System.String manualDownloadWebplayerUrl, BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.BuildReporting.BuildReport report) (at C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:186)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
Any help appreciated!

I've had this on occasion. My fix is to either change the version of the app in peeferences or to erase the app from my device.
Sometimes, it is as simple as restarting Unity.

Related

Upgrade to Prism 8 is causing navigation errors

Environment
Xamarin Forms: 5.0.0.1709-pre4 (but also fails with 4.8.0.1687)
VS2019 16.8.3
XCode: 12.2
Prism NuGets
Prism.DryIoc.Extensions 8.0.48
Prism.Forms 8.0.0.1909
Prism.PluginPopups 8.0.31-beta
Shiny.Prism 8.0.48
Inner Exception from INavigationResult: DryIoc.ContainerException -> InvalidOperationException
code: Error.UnableToResolveFromRegisteredServices;
message: Unable to resolve Resolution root IRMobile.PageModels.LandingPageModel with passed arguments
[Constant(Prism.Navigation.ErrorReportingNavigationService,
typeof(Prism.Navigation.ErrorReportingNavigationService))]
from container with scope {Name=null}
with Rules with {TrackingDisposableTransients, UseDynamicRegistrationsAsFallbackOnly,
FuncAndLazyWithoutRegistration, SelectLastRegisteredFactory} and without
{ThrowOnRegisteringDisposableTransient, UseFastExpressionCompilerIfPlatformSupported}
with FactorySelector=SelectLastRegisteredFactory
with Made={FactoryMethod=ConstructorWithResolvableArguments}
with normal and dynamic registrations:
(DefaultDynamicKey(0), {FactoryID=317, ImplType=IRMobile.PageModels.LandingPageModel,
Reuse=TransientReuse, HasCondition})
Stack Trace from InnerException:
at DryIoc.Container.TryThrowUnableToResolve (DryIoc.Request request) [0x00058] in /_/src/DryIoc/Container.cs:1077
at DryIoc.Container.DryIoc.IContainer.ResolveFactory (DryIoc.Request request) [0x00072] in /_/src/DryIoc/Container.cs:1059
at DryIoc.Container.ResolveAndCacheKeyed (System.Int32 serviceTypeHash, System.Type serviceType, System.Object serviceKey, DryIoc.IfUnresolved ifUnresolved, System.Object scopeName, System.Type requiredServiceType, DryIoc.Request preResolveParent, System.Object[] args) [0x000c5] in /_/src/DryIoc/Container.cs:471
at DryIoc.Container.DryIoc.IResolver.Resolve (System.Type serviceType, System.Object serviceKey, DryIoc.IfUnresolved ifUnresolved, System.Type requiredServiceType, DryIoc.Request preResolveParent, System.Object[] args) [0x00042] in /_/src/DryIoc/Container.cs:430
at DryIoc.Resolver.Resolve (DryIoc.IResolver resolver, System.Type serviceType, System.Object[] args, DryIoc.IfUnresolved ifUnresolved, System.Type requiredServiceType, System.Object serviceKey) [0x00000] in /_/src/DryIoc/Container.cs:7809
at Prism.DryIoc.DryIocContainerExtension.Resolve (System.Type type, System.ValueTuple`2[System.Type,System.Object][] parameters) [0x0001c] in /_/external/Prism/src/Containers/Prism.DryIoc.Shared/DryIocContainerExtension.cs:294
App.xaml.cs
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
// for RgPopups
containerRegistry.RegisterPopupNavigationService();
containerRegistry.RegisterPopupDialogService();
// Essentials
containerRegistry.Register<ISecureStorage, SecureStorageImplementation>();
containerRegistry.RegisterSingleton<IAppInfo, AppInfoImplementation>();
// page stuff
containerRegistry.RegisterForNavigation<NavigationPage>();
containerRegistry.RegisterForNavigation<IconNavigationPage>();
containerRegistry.RegisterSingleton<IPageBehaviorFactory, CustomPageBehaviorFactory>();
...
// Page and model registrations
containerRegistry.RegisterForNavigation<LoginPage, LoginPageModel>();
containerRegistry.RegisterForNavigation<LandingPage, LandingPageModel>();
}
I get this exeption when trying to navigate to a root master/detail page from a LoginPage
await NavigationService.NavigateAsync("/MainPage/NavigationPage/LandingPage")
and the constructor for the LandingPage is
public LandingPageModel(INavigationService navigationService, IMapper mapper, IDialogs dialogs, IPushManager pushManager) : base(navigationService, mapper)
I am fairly new to Prism so I'm sure I am missing something, a registration or maybe a NuGet package, but I'm not sure what it would be. I commented out the Registrations for Popup as I was getting the same error, but referring to Prism.Plugin.Popups.PopupPageNavigationService
As always, thanks for any help!
It looks like you are attempting to navigate to a page called LandingPage, but you haven't told the container what LandingPage is.
Every time you want to create a new view and navigate to it, you need to register it for Navigation inside your App.Xaml.cs file;
containerRegistry.RegisterForNavigation<LandingPage, LandingPageViewModel>();
This line registers the view and its corresponding ViewModel inside the container. Once the container knows about the view, the NavigationService can resolve the view you wish to navigate to using the literal name of the view LandingPage.
Now you can call
await NavigationService.NavigateAsync("LandingPage");
//or
await NavigationService.NavigateAsync("/MainPage/NavigationPage/LandingPage")
NOTE
Prism navigation has a couple of neat tricks built into it. It is Uri based, so every time you navigate to another view, passing the name of the view in the NavigateAsync method will stack the view on top of the others. This means that if you start at the URI NavigationPage/PageA, if you then say NavigateAsync("PageB") you will end up at NavigationPage/PageA/PageB.
Additionally, including the / character at the very beginning of the NavigateAsync argument completely resets the stack. So if you navigate to /PageC from NavigationPage/PageA/PageB, this resets the stack to just PageC

ReSharper 2018.1.2 NUnit TestCaseSource (.NET Core / VS2017)

I have seen all of the following questions:
NUnit .NET Core running through Resharper
Running NUnit Tests in .NET Core with ReSharper
NUnit TestCaseSource
Despite following all of their advice and having the following lines in all of my
test projects:
<PackageReference Include="NUnit" Version="3.10.1" />
<PackageReference Include="NUnit3TestAdapter" Version="3.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
I am still getting the following errors in the Unit Test Explorer window of ReSharper (version 2018.1.2):
2018.06.23 11:22:21.292 ERROR Transition failed: Transition from state <HandShake> on event <remote::.ProtocolVersion>. Cause: System.InvalidOperationException: Test-cases are missing for the selected tests. Rebuild the project and try again. at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.SendGetProcessStartInfo() at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument) at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
--- EXCEPTION #1/1 [LoggerException]
Message = “
Transition failed: Transition from state <HandShake> on event <remote::.ProtocolVersion>.
Cause: System.InvalidOperationException: Test-cases are missing for the selected tests. Rebuild the project and try again.
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.SendGetProcessStartInfo()
at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument)
at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestProtocol.<.ctor>b__22_14(Object sender, TransitionExceptionEventArgs`2 args)
at Appccelerate.StateMachine.Machine.StateMachine`2.RaiseEvent[T](EventHandler`1 eventHandler, T arguments, ITransitionContext`2 context, Boolean raiseEventOnException)
at Appccelerate.StateMachine.Machine.StateMachine`2.OnExceptionThrown(ITransitionContext`2 context, Exception exception)
at Appccelerate.StateMachine.Machine.Contexts.TransitionContext`2.OnExceptionThrown(Exception exception)
at Appccelerate.StateMachine.Machine.States.State`2.HandleException(Exception exception, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.HandleEntryActionException(ITransitionContext`2 context, Exception exception)
at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryActions(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.Entry(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.EnterShallow(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.EnterHistoryNone(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.EnterByHistory(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.Transitions.Transition`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.States.State`2.Fire(ITransitionContext`2 context)
at Appccelerate.StateMachine.Machine.StateMachine`2.Fire(TEvent eventId, Object eventArgument)
at Appccelerate.StateMachine.ActiveStateMachine`2.ProcessEventQueue(CancellationToken cancellationToken)
at Appccelerate.StateMachine.ActiveStateMachine`2.<Start>b__32_0()
at System.Threading.Tasks.Task.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(Object obj)
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart(Object obj)
”
2018.06.23 11:22:21.315 ERROR System.InvalidOperationException: Test-cases are missing for the selected tests. Rebuild the project and try again.
at JetBrains.ReSharper.UnitTestFramework.DotNetCore.DotNetVsTest.DotNetVsTestExecution.SendGetProcessStartInfo()
at Appccelerate.StateMachine.Machine.ActionHolders.ArgumentLessActionHolder.Execute(Object argument)
at Appccelerate.StateMachine.Machine.States.State`2.ExecuteEntryAction(IActionHolder actionHolder, ITransitionContext`2 context)
2018.06.23 11:22:21.316 WARN Element UnitTests.Tests.RegressionTests was left pending after its run completion.
2018.06.23 11:22:21.316 WARN Element UnitTests.Tests.RegressionTests.TestAllRegressions was left pending after its run completion.
These are the newest versions of each of these packages, but I have also tried matching NUnit's version to the TestAdapter's version (3.10.0). The most baffling part of this is that Visual Studio's Test Explorer has no problem running the tests! I would very much like to use ReSharper's explorer to easily run their profiling and coverage tools on my tests.
Moreover, at some point in time ReSharper's test explorer used to work, but I'm not aware of the particular version combination that led to it. This setup still works for basic [Test] style tests and only fails for [TestCaseSource] tests.
ETA: ReSharper is also not running namespace-level setup and tear-down fixtures. Maybe this is part of the problem?
How do I fix this?
This was a bug. JetBrains fixed it in ReSharper 2018.2 EAP 5. It's still finicky, but when it works, it works.

ASP.NET UnauthorizedAccessException when accessing item from cache

We have some code that occasionally flushed out certain keys in the ASP.NET cache in order to make sure that we are getting up to date data from our Dynamics CRM system. It seems to work fine most of the time, however we are getting intermittent exceptions on page reloads that I suspect is related to this forced cache flushing.
Here is the error in the UnauthorizedAccessException:
Access to the path 'appDomain=/LM/W3SVC/1/ROOT-1-129326029589946795:key=Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider:Crm:Query=953227368' is denied.
In case it is helpful, here is how I am flushing the cache items:
private void Flush()
{
IDictionaryEnumerator cacheEnum = this.HttpContext.Cache.GetEnumerator();
while (cacheEnum.MoveNext())
{
var key = cacheEnum.Key.ToString();
if (key.StartsWith("Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider:Crm:Query"))
System.Web.HttpContext.Current.Cache.Remove(key);
}
}
My questions:
Is there some level of permission required to access or remove cache items? I googled this but did not find anything specific (even in MSDN).
Have you seen this error before? How did you resolve it?
UPDATE: here is the stacktrace.
Stacktrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.Threading.Mutex.MutexTryCodeHelper.MutexTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew, MutexSecurity mutexSecurity)
at System.Threading.Mutex..ctor(Boolean initiallyOwned, String name, Boolean& createdNew)
at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute[TRequest,TResponse,TResult](TRequest request, Func`2 execute, Func`2 selector, String selectorCacheKey)
at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](MetadataServiceRequest request, Func`5 execute, Func`2 selector, String selectorCacheKey)
at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](MetadataServiceRequest request, Func`2 selector, String selectorCacheKey)
at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute(Object request)
at Microsoft.Xrm.Client.Services.IOrganizationServiceExtensions.RetrieveAllEntities(IOrganizationService service, MetadataItems metadataItems, Boolean retrieveAsIfPublished)
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.GetId(DynamicEntity entity)
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.<GetDependencies>d__48.MoveNext()
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.<GetDependencies>d__41.MoveNext()
at System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.<GetDependencies>d__2b.MoveNext()
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.<GetDependencies>d__13.MoveNext()
at System.Linq.Enumerable.<DistinctIterator>d__81`1.MoveNext()
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.GetCachePolicy(Object query, Object result)
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.Insert(String key, Object query, Object result)
at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass5`1.<Get>b__4(String k)
at Microsoft.Xrm.Client.Threading.MutexExtensions.<>c__DisplayClass2`1.<Get>b__0(Mutex _)
at Microsoft.Xrm.Client.Threading.MutexExtensions.Lock(String key, Int32 millisecondsTimeout, Action`1 action)
at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Int32 millisecondsTimeout, Func`2 loadFromCache, Func`2 loadFromService)
at Microsoft.Xrm.Client.Threading.MutexExtensions.Get[T](String key, Func`2 loadFromCache, Func`2 loadFromService, Action`2 addToCache)
at Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider.InnerExecute[TRequest,TResponse,TResult](TRequest request, Func`2 execute, Func`2 selector, String selectorCacheKey)
at Microsoft.Xrm.Client.Services.CachedOrganizationService.Execute[T](Request request, Func`2 selector, String selectorCacheKey)
at Microsoft.Xrm.Client.Services.CachedOrganizationService.RetrieveMultiple(QueryBase query)
at Microsoft.Xrm.Client.Services.IOrganizationServiceExtensions.Using[T](Func`1 create, Func`2 action)
at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute[TElement](QueryExpression qe, LambdaExpression projection, Delegate postMethodCall, LambdaExpression filter, Type entityType)
at Microsoft.Xrm.Client.Linq.CrmQueryProvider.Execute[TElement](Expression expression)
at Microsoft.Xrm.Client.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
at System.Linq.Queryable.Single[TSource](IQueryable`1 source)
at FrontOfficeApp.Controllers.BillingController.GetBillingInstitutions(Requisition req)
at FrontOfficeApp.Controllers.BillingController.InstitutionalBillPartial(Int32 requisitionId)
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.<>c__DisplayClassd.<InvokeActionMethodWithFilters>b__a()
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName)
at System.Web.Mvc.Controller.ExecuteCore()
at System.Web.Mvc.MvcHandler.<>c__DisplayClass8.<BeginProcessRequest>b__4()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass1.<MakeVoidDelegate>b__0()
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Message=Access to the path 'appDomain=/LM/W3SVC/1/ROOT-1-119328537521157948:key=Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider:Crm:Query=913126368' is denied.
Data=System.Collections.ListDictionaryInternal
UPDATE2:
We just updated to the 4.0.13 version of the SDK in order to turn off caching (actually I could only get it to work by setting the duration to 1 second, see below). This allows us to get around the issue of CRM needing to be flushed, but we are still getting the caching errors in our environment, although they look a little different now:
Message=Access to the path 'appDomain=/LM/W3SVC/1/ROOT-1-129341239247458264:key=Microsoft.Xrm.Client.Services.InMemoryCrmCacheProvider:Crm:User=00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000000:Query=923237368' is denied.
Data=System.Collections.ListDictionaryInternal
For what is is worth, the context configuration I am using is below. I am adding a bounty to this question as a last ditch attempt.
<microsoft.xrm.client>
<contexts default="Crm">
<add name="Crm" type="CRM.XrmDataContext" serviceName="Default" />
</contexts>
<services default="Default">
<add name="Default" cacheProviderName="Default" />
</services>
<cache defaultProvider="Default">
<providers>
<add name="Default"
type="Microsoft.Xrm.Client.Caching.InMemoryCacheProvider, Microsoft.Xrm.Client" duration="00:00:01" />
</providers>
</cache>
</microsoft.xrm.client>
We finally figured out the answer to this issue. The problem was related to impersonation (we had it turned on in the web.config) and the fact that we were accessing XRM using a singleton. Apparently, when multiple users tried to run simultaneous CRM queries through our software, the singleton would make the connection to CRM under their user context. Apparently while this is happening, the cache for the query results are "owned" by that user context. When another user tried to run a query at the same time, they would receive a 401 status code.
The fix ended up being to turn of impersonation and do some minor refactoring so that we did not need it anymore. I imagine we could instead have allowed multiple CRM instances--though we intentionally don't do that for performance reasons.
I hope this helps anyone else who might be seeing these funky errors.
I can't imagine that the exception is actually tied to the Cache.Remove call.
Just a guess, but is it possible that the exception is related to the CacheItemRemovedCallback and not the actual removal step (not sure if the call-back is executed synchronously on the same thread)?
Can you post the full stack trace for the exception?

ASP.NET 2.0 Application with a Sqlite Backend on Mono

I have an extensive ASP.NET Sqlite driven application that will run through Apache with the help of Mono. For testing purposes, I created an application that has two textboxes and a button. When the textboxes are filled with text and the button is executed, a Sqlite table will receive the text within the textboxes. This test application works in Visual Studio.
I published the test application and placed it on the apache server. The Sqlite .db file sits in the bin folder, and my connection string points directly to this folder. When I run the application, the textboxes and button show up, but when I press the button I receive the following error:
Server Error in '/' Application
System.Data.SQLite.DLL
Description: HTTP 500. Error processing request.
Stack Trace:
System.DllNotFoundException: System.Data.SQLite.DLL at (wrapper managed-to-native) System.Data.SQLite.UnsafeNativeMethods:sqlite3_open_interop (byte[],int,intptr&) at System.Data.SQLite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum flags, Int32 maxPoolSize, Boolean usePool) [0x00000]
at System.Data.SQLite.SQLiteConnection.Open () [0x00000] at WebApplication1._Default.ExecuteQuery (System.String txtQuery) [0x00000] at WebApplication1._Default.Button1_Click (System.Object sender, System.EventArgs e) [0x00000]
at System.Web.UI.WebControls.Button.OnClick (System.EventArgs e) [0x00000] at System.Web.UI.WebControls.Button.RaisePostBackEvent (System.String eventArgument) [0x00000] at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (System.String eventArgument) [0x00000]
at System.Web.UI.Page.RaisePostBackEvent (IPostBackEventHandler sourceControl, System.String eventArgument) [0x00000] at System.Web.UI.Page.RaisePostBackEvents () [0x00000] at System.Web.UI.Page.ProcessRaiseEvents () [0x00000]
at System.Web.UI.Page.InternalProcessRequest () [0x00000] at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000]
The system.data.sqlite.dll file is actually in the bin with the sqlite .db file. Does anyone know how to resolve this error?
Thank you,
DFM
This managed version of the ADO.NET provider for SQLite requires the native
sqlite3.dll or Linux shared library from http://www.sqlite.org It looks like the dll is missing: "DllNotFoundException"

ScriptManager causes server error

I'm playing around with MonoDev on my mac and wanting to see how well it can run basic ASP.NET applications which I've worked on.
I chose a very basic site, it's got a handful of ASP.NET pages, all of which inherit nested master pages and some ASP.NET AJAX stuff. The project is .NET 2.0 and I have the web.config set appropriately for ASP.NET AJAX 1.0.
Under windows this runs without any dramas and because it's so simple I expected it to "just work" in MonoDev too. The problem is that when I run using the built-in web server for MonoDev I get the following exception:
Server Error in '/' Application
Object reference not set to an instance of an object
Description: HTTP 500. Error processing request.
Stack Trace:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Web.Handlers.ScriptResourceHandler.EncryptString (System.String s) [0x00000] in :0
at System.Web.Handlers.ScriptResourceHandler+RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl (System.Reflection.Assembly assembly, System.String resourceName, System.Globalization.CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) [0x00000] in :0
at System.Web.Handlers.ScriptResourceHandler.GetScriptResourceUrl (System.Reflection.Assembly assembly, System.String resourceName, System.Globalization.CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) [0x00000] in :0
at System.Web.UI.ScriptReference.GetUrlFromName (System.Web.UI.ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) [0x00000] in :0
at System.Web.UI.ScriptReference.GetUrl (System.Web.UI.ScriptManager scriptManager, IControl scriptManagerControl, Boolean zip) [0x00000] in :0
at System.Web.UI.ScriptManager.RegisterScripts () [0x00000] in :0
at System.Web.UI.ScriptManager.OnPagePreRenderComplete (System.Object sender, System.EventArgs e) [0x00000] in :0
at System.Web.UI.Page.OnPreRenderComplete (System.EventArgs e) [0x0002a] in /private/tmp/monobuild/build/BUILD/mono-2.6.1/mcs/class/System.Web/System.Web.UI/Page.cs:2157
at System.Web.UI.Page.ProcessLoadComplete () [0x000bf] in /private/tmp/monobuild/build/BUILD/mono-2.6.1/mcs/class/System.Web/System.Web.UI/Page.cs:1654
at System.Web.UI.Page.InternalProcessRequest () [0x001cb] in /private/tmp/monobuild/build/BUILD/mono-2.6.1/mcs/class/System.Web/System.Web.UI/Page.cs:1536
at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x0005b] in /private/tmp/monobuild/build/BUILD/mono-2.6.1/mcs/class/System.Web/System.Web.UI/Page.cs:1353
Version information: Mono Runtime Version: 2.6.1 (tarball Thu Dec 17 10:19:23 MST 2009); ASP.NET Version: 2.0.50727.1433
It seems though that when I remove my ScriptManager from my root master page everything runs fine (well except for the JavaScript which expects it to be there).
Being completely new to Mono & MonoDev I don't really know where to start with debugging other than getting to the point I'm currently at.
I had the same problem when doing some Mono testing and the problem was the scriptmanager was not inside the form runat="server" id="form1" /form tags. Once that was added the NULL exception went away.

Resources