I have a content type consiting out of two fields "First" and "Second". Then I said "Include in Index". After going to the settings and clicking "Rebuild Index" the following message occurs:
(I am using SQL Express with Orchard 1.8.1)
Oops. Something went wrong ... sorry
An unhandled exception has occurred and the request was terminated.
Please refresh the page. If the error persists, go back Access to the
path 'segments.gen' is denied. System.UnauthorizedAccessException:
Access to the path 'segments.gen' is denied. at
System.IO.Directory.DeleteHelper(String fullPath, String userPath,
Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound) at
System.IO.Directory.Delete(String fullPath, String userPath, Boolean
recursive, Boolean checkHost) at
Orchard.Indexing.Services.IndexingTaskExecutor.DeleteIndex(String
indexName) at
Orchard.Indexing.Services.IndexingTaskExecutor.RebuildIndex(String
indexName) at
Orchard.Indexing.Services.IndexingService.RebuildIndex(String
indexName) at
Orchard.Indexing.Controllers.AdminController.Rebuild(String id) at
lambda_method(Closure , ControllerBase , Object[] ) at
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext
controllerContext, IDictionary2 parameters) at
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext
controllerContext, ActionDescriptor actionDescriptor, IDictionary2
parameters) at
System.Web.Mvc.Async.AsyncControllerActionInvoker.b__39(IAsyncResult
asyncResult, ActionInvocation innerInvokeState) at
System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult
asyncResult) at
System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.b__3f()
at
System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.b__41()
at
System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.b__41()
at
System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass48.b__41()
The search settings page is empty now:
After changing the folder permissions for Orchard.Web\App_Data\Sites\Default\Indexes\Search and C:\inetpub\wwwroot\Orchard1\App_Data\Sites\Default it worked. I have to installations one on my development and the other on the test machine. So when I setup everything in Visual Studio somethimes folder permissions are not yet correct after publishing to the other system. I just changed IIS_IUSRS to have full access to these folders.
Related
Hello I have a silverlight project for WP8.1 that is a game. I use a backgroundTask to alert the user about when he last played, if he is too slow to comply I would like to make a call to the server from the bagroundTask to resign from the games.
The backgroundTask is made using stackoverflow and this blog, just basic implementations of the backgroundTask.
I then install the NuGet Package Microsoft.Azure.Mobile.Client and everything is fine, I then do a compile, everything succeeds.
The app installs and splashscreen appears, then I get an error in the main project at the initialization of MobileServiceClient in App.xaml.cs
public MobileServiceClient MobileService = new MobileServiceClient(
"https://xxxxx.azurewebsites.net"
);
The exception in the above line states:
An exception of type 'System.IO.FileNotFoundException' occurred in mscorlib.ni.dll but was not handled in user code
Additional information: Could not load file or assembly 'System.Runtime.InteropServices, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
The only change was the install of the NuGet package in the backgroundTask project. The stack trace output for the exception above.
at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
at System.Reflection.RuntimeAssembly.GetCustomAttributes(Type attributeType, Boolean inherit)
at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
at Microsoft.WindowsAzure.MobileServices.PlatformInformationExtensions.GetVersionFromAssemblyFileVersion(IPlatformInformation platformInformation)
at Microsoft.WindowsAzure.MobileServices.PlatformInformation.get_Version()
at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient.GetUserAgentHeader()
at Microsoft.WindowsAzure.MobileServices.MobileServiceHttpClient..ctor(IEnumerable`1 handlers, Uri applicationUri, String installationId)
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor(Uri mobileAppUri, HttpMessageHandler[] handlers)
at Microsoft.WindowsAzure.MobileServices.MobileServiceClient..ctor(String mobileAppUri, HttpMessageHandler[] handlers)
at BC_Menu.App..ctor()
I have not been able to solve this issue.
Extra
I am able to do normal http calls to the web by using the proposed code, replicated here:
BackgroundTaskDeferral _deferral;
public async void Run(IBackgroundTaskInstance taskInstance)
{
_deferral = taskInstance.GetDeferral();
// your async code
_deferral.Complete();
}
Update based on Adrian Halls Answer
The code works, my front application can communicate with the server and everything. The backgroundTask, can extract information from the device everything is fine, everything compiles and runs.
I then add the NuGet package to the backgroundTask and suddenly the above error appears, when I deploy this solution to the client.
I am running VS2015, Win10, and have v2.0.1 installed of Microsoft.Azure.Mobile.Client. I have seen some odd behaviours with silverlight projects on win10 before.
The error indicates a problem with your .NET setup - the error is in mscorlib (the basic library for .NET). Try to add a reference to the specific library that you need. Also, ensure that you have installed v2.0.1 (or later) or the Microsoft.Azure.Mobile.Client library.
I have imported UnityVS 2.1 in my Unity 5.1.1f1 Personal.. and as soon as I import I get the following error.
DirectoryNotFoundException: Could not find a part of the path
"C:\Users\Public\Documents\Unity Projects\Achievement
system\Library\UnityAssemblies\version.txt".
System.IO.FileStream..ctor (System.String path, FileMode mode,
FileAccess access, FileShare share, Int32 bufferSize, Boolean
anonymous, FileOptions options) (at
/Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/FileStream.cs:292)
System.IO.FileStream..ctor (System.String path, FileMode mode,
FileAccess access, FileShare share) (wrapper
remoting-invoke-with-check) System.IO.FileStream:.ctor
(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare)
System.IO.StreamWriter..ctor (System.String path, Boolean append,
System.Text.Encoding encoding, Int32 bufferSize) (at
/Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/StreamWriter.cs:124)
System.IO.StreamWriter..ctor (System.String path, Boolean append)
(wrapper remoting-invoke-with-check) System.IO.StreamWriter:.ctor
(string,bool) System.IO.File.CreateText (System.String path) (at
/Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.IO/File.cs:159)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.CreateVersionFile
(System.String[] assemblies)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.DeployUnityAssemblies
(SyntaxTree.VisualStudio.Unity.Bridge.ProjectSystem.UnitySolution
solution)
SyntaxTree.VisualStudio.Unity.Bridge.ProjectFilesGenerator.GenerateProject
()
SyntaxTree.VisualStudio.Unity.Bridge.Project+<>c__DisplayClass4.b__3
() UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at
C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:264)
Can anyone tell me what is the problem?
I am using VS2015 community edition.
Ok I have solved the problem... it seems like the UnityVS didnt create the folder structure as follows by itself
\Library\UnityAssemblies\version.txt
So I created it manually by creating the UnityAssemblies folder and a blank text file named version.txt inside it... and bam it worked perfectly..
Stupid UnityVS... had me worrying for 1 hour.
This happens when your project has no scripts and wasnt started at least 1 time, only then that folder and file is created
I am using Orchard 1.8 and I installed the "Vandelay Industries - Version: 1.8" module from the Gallery onto my development box (running an VS Orchard project) and enabled just the "Vandelay Meta" (it's all I need at the moment). I added the "Meta" part to the "Page" content type and all that worked fine. I as able to add both a "Description" and "Keywords" to pages.
When I did the module installation to my production server (our server) which is the same version of Orchard (it was set up from the dev copy a month or so ago), I am getting a message "Some features need to be upgraded: Vandelay.Industries" at the top of the Admin "Modules" - "Features" screen and there is a red box around the "Vandelay Meta" feature and there is also a "Upgrade" link next to the feature's "Disable" link. If I click it the page just refreshes and nothing changes.
The part is also not available for adding to the page content type.
The is also an error in the Orchard Log
2014-10-08 14:10:58,385 [13] Orchard.Exceptions.DefaultExceptionPolicy - Default - An unexpected exception was caught
...servername/Packaging/PackagingServices/InstallPackageDetails?packageId=Orchard.Module.Vandelay.Industries&version=1.8&sourceId=1&redirectUrl=%2FPackaging%2FGallery%2FModules
Orchard.OrchardCoreException: Unable to make room for file "C:\inetpub\A1_Website-OrchardCMS\App_Data\RecipeQueue\38a6aedb4c514ea1866be2138d14c99e\0" in "App_Data" folder ---> System.UnauthorizedAccessException: Access to the path 'C:\inetpub\A1_Website-OrchardCMS\App_Data\RecipeQueue\38a6aedb4c514ea1866be2138d14c99e\0' is denied.
The App_Data and it's child folders has Read Execute Write permission IIS 7 IIS_IUSRS account.
There are also some errors "CREATE TABLE permission denied in database " i.e.
2014-10-08 14:12:19,332 [7] Orchard.Data.Migration.DataMigrationManager - Default - Error while running migration version 0 for Vandelay.Industries
../Admin/Modules/Features
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.SqlClient.SqlException: CREATE TABLE permission denied in database 'Orchard_ProductionDB'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource1 completion, String methodName, Boolean sendToPipe, Int32 timeout, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.RunPendingStatements()
at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter.Visit(CreateTableCommand command)
at Orchard.Data.Migration.Interpreters.AbstractDataMigrationInterpreter.Visit(ISchemaBuilderCommand command)
at Orchard.Data.Migration.Schema.SchemaBuilder.CreateTable(String name, Action1 table)
at Vandelay.Industries.MetaMigrations.Create()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Orchard.Data.Migration.DataMigrationManager.Update(String feature)
And the "Vandelay_Industries_MetaRecord" "Vandelay_Industries_SettingsRecord" are not in the production database (they are in the dev DB)
I have tried reinstalling the module and it does not fix it.
Any way to fix this? If so how?
Thanks in advance,
K.E.
Ensure the migration module is enabled before installing Vandelay_Industries_*, I found that to a be a cause as well.
We are hosting our site on windows azure where site is running on multiple instances.Due to multiple instances we were using shared cache for storing session values. As Microsoft is going to stop shared cache and recommended to use redis cache to store session. I modified project to use redis cache and it worked for most of the pages. My problem is that, we have a very important page "search page" (we are using lucene.net for search functionality) in our site which stores a lot of data in session and this page is not working. After hitting search button, it shows connecting status in address bar for a long time and goes to oops page of website. We are recording error messages in DB so after looking at there we found following error message.
System.Runtime.Serialization.SerializationException: Type 'myWeb.clsSearchCriteria+ContentCriteria' in Assembly 'HelmBriscoeWeb, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at Microsoft.Web.Redis.RedisUtility.GetBytesFromObject(Object data)
at Microsoft.Web.Redis.RedisUtility.AppendUpdatedOrNewItemsInList(ChangeTrackingSessionStateItemCollection sessionItems, List`1 list)
at Microsoft.Web.Redis.RedisConnectionWrapper.TryUpdateIfLockIdMatchPrepare(Object lockId, ISessionStateItemCollection data, Int32 sessionTimeout, String[]& keyArgs, Object[]& valueArgs)
at Microsoft.Web.Redis.RedisConnectionWrapper.TryUpdateIfLockIdMatch(Object lockId, ISessionStateItemCollection data, Int32 sessionTimeout)
at Microsoft.Web.Redis.RedisSessionStateProvider.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
at System.Web.SessionState.SessionStateModule.OnEndRequest(Object source, EventArgs eventArgs)
at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
I am not sure if this is related to my problem but seems if this is fixed, page will work properly. Has anyone any idea why this error occurred and how can I fix it?
Thanks
I solved this problem myself by adding serialization attribute to class like below.
<Serializable()> _
Public Class clsSearchCriteria
Thanks
A project that is deployed in Azure recently started throwing two or three of these exceptions a day. My investigation shows that this is often caused by assemblies that have future timestamps on them, generally caused by deploying to machines in other timezones (this was a good resource). We have not had this problem before in the year+ that the app has been live, and it receives a lot more traffic than the handful of exceptions would suggest.
I redeployed with remote desktop enabled and checked the timestamps of our dlls and the contents of the \Windows\Microsoft.NET and \Windows\assembly directories, and did not find any "future" timestamps. At this point I'm stuck, and would be grateful for ideas.
Stack Trace:
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: utcDate
at System.Web.HttpCachePolicy.UtcSetLastModified(DateTime utcDate)
at System.Web.HttpCachePolicy.SetLastModified(DateTime date)
at System.Web.UI.Page.InitOutputCache(OutputCacheParameters cacheSettings)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.Mvc.OutputCacheAttribute.OnResultExecuting(ResultExecutingContext filterContext)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func1 continuation)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList1 filters, ActionResult actionResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass27.b__24(IAsyncResult asyncResult)
at System.Web.Mvc.AsyncController.<>c__DisplayClass19.b__14(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
at System.Web.Mvc.AsyncController.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
at System.Web.Mvc.MvcHandler.<>c__DisplayClass6.<>c__DisplayClassb.b__4(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass4.b__3(IAsyncResult ar)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Timezone issues are really a headache in Azure Environment so I suggest you to add a startup task and change Azure Environment's timezone. I'm not claiming this will resolve your problem but it doesn't hurt to try does it? To change Timezone of your Azure Environment:
1) Save tzutil /s "Pacific Standard Time" as .cmd and include the file to your project.
2) In properties screen of the file, choose "Copy Always" as your Copy to Output option and "None" as your Build Action.
3) Add the following to your ServiceDefinition file:
<Startup>
<Task commandLine="nameOfFileYouCreated.cmd" executionContext="elevated" />
</Startup>
4) And of course adapt your DateTime references in your project, you don't have to deal with conversions etc.