Import/Export Recipe in Orchard CMS - orchardcms

I have been facing many issues whenever I try to import the changes.
We have three orchard instances for different environments. Changes made in one should be migrated to remaining two instances. For this, I am using import/export module in orchard CMS(v 1.6.0.0).
The export file contains only the changes I made in CMS1 => CMS1.xml and those which are already there are deleted from the file. If I update Resource text ie., "Export Untouched" to "Export Modified" and save changes to the XML file, then when I import this file to CMS2 and CMS3 instances, those imports are not working.
NOTE: I did not change the Key, I just updated the value.
Exception:
thread:[11] ERROR - NullReferenceException thrown from <>f__AnonymousType4`2 by <>f__AnonymousType4`2
[[Orchard.ContentManagement.ContentPart, Orchard.Framework, Version=1.6.0.0, Culture=neutral, PublicKeyToken=null],
[Orchard.ContentPicker.Fields.ContentPickerField, Orchard.ContentPicker, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]
server: XXX.YYY.com operation : /XXXCMS/Admin/ImportExport/Export exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Orchard.ContentManagement.DefaultContentManager.GetItemMetadata(IContent content) in d:\Builds\29\XXX\MP_2_0_XXXCMS_Support\Sources\XXX\Main\Source\Webs\Webx\XXXX_YYYYY2.0\Orchard\ContentManagement\DefaultContentManager.cs:line 513 at Orchard.ContentPicker.Drivers.ContentPickerFieldDriver.<Exporting>b__13(ContentItem x) at System.Linq.Enumerable.
<>c__DisplayClass7_0`3.<CombineSelectors>b__0(TSource x) at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext() at System.Linq.Buffer`1.
.ctor(IEnumerable`1 source) at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) at Orchard.ContentPicker.Drivers.ContentPickerFieldDriver.Exporting(ContentPart part, ContentPickerField field, ExportContentContext context) at Orchard.ContentManagement.Drivers.ContentFieldDriver`1.<>c__DisplayClass1c.<Orchard.ContentManagement.Drivers.IContentFieldDriver.Exporting>b__1b(ContentPart part, TField field)
in d:\Builds\29\XXX\MP_2_0_XXXCMS_Support\Sources\XXX\Main\Source\Webs\Webx\XXX2.0\Orchard\ContentManagement\Drivers\ContentFieldDriver.cs:line 67 at
Orchard.ContentManagement.Drivers.ContentFieldDriver`1.<>c__DisplayClass25.<Process>b__23(<>f__AnonymousType4`2 pf) in
d:\Builds\29\XXX\MP_2_0_XXXCMS_Support\Sources\XXX\Main\Source\Webs\Webx\XXXX_YYYY2.0\Orchard\ContentManagement\Drivers\ContentFieldDriver.cs:line 80 at
Orchard.InvokeExtensions.Invoke[TEvents](IEnumerable`1 events, Action`1 dispatch, ILogger logger) in d:\Builds\29\XXX\MP_2_0_XXXX_Support\Sources\XXX\Main\Source\Webs\Webx\Project 2.0\Orchard\InvokeExtensions.cs:line 17

Related

.net maui publishing android app fails due to issue during linking

I have an .net maui application using .net 7 preview 2 that I want to publish for Android.
My publish command: dotnet publish ${{env.UI_PROJECT_PATH}} -f net7.0-android -c Release
This gives me this error:
C:\Program Files\dotnet\sdk\7.0.100-rc.2.22477.23\Sdks\Microsoft.NET.ILLink.Tasks\build\Microsoft.NET.ILLink.targets(86,5): error NETSDK1144: Optimizing assemblies for size failed. Optimization can be disabled by setting the PublishTrimmed property to false. [D:\a\MoneyFox\MoneyFox\src\MoneyFox.Ui\MoneyFox.Ui.csproj::TargetFramework=net7.0-android]
ILLink : error IL1011: Failed to write 'obj\Release\net7.0-android\android-x64\linked\SkiaSharp.Views.Android.dll'. [D:\a\MoneyFox\MoneyFox\src\MoneyFox.Ui\MoneyFox.Ui.csproj::TargetFramework=net7.0-android]
Fatal error in IL Linker
Unhandled exception. Mono.Linker.LinkerFatalErrorException: ILLink: error IL1011: Failed to write 'obj\Release\net7.0-android\android-x64\linked\SkiaSharp.Views.Android.dll'.
---> System.ArgumentException: Member 'System.Int32 SKCanvasView_ignorePixelScaling' is declared in another module and needs to be imported
at Mono.Cecil.MetadataBuilder.LookupToken(IMetadataTokenProvider provider)
at Mono.Cecil.Cil.CodeWriter.WriteOperand(Instruction instruction)
at Mono.Cecil.Cil.CodeWriter.WriteInstructions()
at Mono.Cecil.Cil.CodeWriter.WriteResolvedMethodBody(MethodDefinition method)
at Mono.Cecil.Cil.CodeWriter.WriteMethodBody(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethod(MethodDefinition method)
at Mono.Cecil.MetadataBuilder.AddMethods(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddType(TypeDefinition type)
at Mono.Cecil.MetadataBuilder.AddTypes()
at Mono.Cecil.MetadataBuilder.BuildTypes()
at Mono.Cecil.MetadataBuilder.BuildModule()
at Mono.Cecil.MetadataBuilder.BuildMetadata()
at Mono.Cecil.ModuleWriter.<>c.<BuildMetadata>b__2_0(MetadataBuilder builder, MetadataReader _)
at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 read)
at Mono.Cecil.ModuleWriter.BuildMetadata(ModuleDefinition module, MetadataBuilder metadata)
at Mono.Cecil.ModuleWriter.Write(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleWriter.WriteModule(ModuleDefinition module, Disposable`1 stream, WriterParameters parameters)
at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Cecil.AssemblyDefinition.Write(String fileName, WriterParameters parameters)
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters)
--- End of inner exception stack trace ---
at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters)
at Mono.Linker.Steps.OutputStep.OutputAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.BaseStep.Process(LinkContext context)
at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
at Mono.Linker.Pipeline.Process(LinkContext context)
at Mono.Linker.Driver.Run(ILogger customLogger)
at Mono.Linker.Driver.Main(String[] args)
I tried to include the SkiaSharp.Views.Android Dll so that is not trimmed with this:
<PropertyGroup>
<EnableTrimAnalyzer>true</EnableTrimAnalyzer>
<PublishTrimmed>true</PublishTrimmed>
<TrimMode>partial</TrimMode>
</PropertyGroup>
<ItemGroup>
<TrimmerRootAssembly Include="LiveChartsCore.SkiaSharpView.Maui" />
</ItemGroup>
But it seems that didn't work.
I could disable trimming, but then I would have to disable AOT as well which I want to avoid.
Is there another way to circumvent this issue?
I'm not expert enough to explain the intricacies of the situation but here is a quick workaround (see comments to question above for more details).
Right click the project and select "Properties"
Find "Enable trimming" and uncheck it.
Then find AOT and uncheck it too
To be clear, this may not be the best way to resolve it permanently since the app will be less optimized.

Create a P6 XML file using MPXJ java library

I have a json having all the information of my project, its activities, dependencies / relationships and the calendar. Using the MPXJ java library am trying to generate a corresponding Primevera P6 XML file that can be imported in Oracle primevera. I have been successful in creating an xml but when I import it in P6 it is giving me the below error.
*Microsoft.Practices.Prism.Modularity.ModuleInitializeException: An exception occurred while initializing module 'CommandLineModule'.
The exception message was: Object reference not set to an instance of an object.
The Assembly that the module was trying to be loaded from was:
Primavera.Mercury.CommandLineModule, Version=15.2.0.15383, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.
---> System.NullReferenceException: Object reference not set to an instance of an object.
at Primavera.Mercury.Importer.ImportCleaner.CleanupActivities(EntityContext sourceContext)
at Primavera.Mercury.Importer.ImportCleaner.CleanSourceContext(EntityContext sourceContext, IVenusDataServiceContext targetContext, ILoggerFacade logger, ImportProjectSettings importProjectSettings, Dictionary`2 initialKeyDictionary)
at Primavera.Mercury.CommandLineModule.ExecuteImportExport.DoImport()
at Microsoft.Practices.Prism.Modularity.ModuleInitializer.Initialize(ModuleInfo moduleInfo)
--- End of inner exception stack trace ---
Failed to load type for module CommandLineModule.
Error was: An exception occurred while initializing module 'CommandLineModule'.
- The exception message was: Object reference not set to an instance of an object.
- The Assembly that the module was trying to be loaded from was:Primavera.Mercury.CommandLineModule, Version=15.2.0.15383, Culture=neutral, PublicKeyToken=null
Check the InnerException property of the exception for more information. If the exception occurred while creating an object in a DI container, you can exception.GetRootException() to help locate the root cause of the problem.*

System.IO.FileNotFoundException in SimpleData

I am using Simple Data (1.0.0-rc0) like Simple.DataDatabase.Default.Licenses.All().ToList<License>() to get a list of licenses. It works fine and all in my productions environment (VS2010, IIS7.5) but once deployed to live server it throws :
`System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
at System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
at System.ComponentModel.Composition.Hosting.AggregateCatalog.GetExports(ImportDefinition definition)
at System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable1& exports)
at System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
at System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore[T](String contractName)
at Simple.Data.MefHelper.Compose[T](String contractName)
at Simple.Data.AdapterFactory.DoCreate(String adapterName, IEnumerable1 settings)
at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func2 valueFactory)
at Simple.Data.CachingAdapterFactory.Create(String adapterName, IEnumerable1 settings)
at Simple.Data.DatabaseOpener.OpenDefaultMethod()
at Simple.Data.DatabaseOpener.OpenDefault()`
`System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.Shell, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'`
The server is running a freshly installed Windows Server 2008 R2.I have been going at this for the last two days without any progress at all. Did I perhaps miss something crucial during server setup?
This is an issue with MEF. One of the assemblies in your bin folder has a reference to Microsoft.VisualStudio.Shell, and when MEF tries to do its thing and it can't follow all the references, it throws that error.
This has been the cause of several bug reports recently, and the next release will have a change to the MEF code which will stop it from happening.
As a workaround in the meantime, you can either track down the assembly with the reference and remove it, or put that assembly in the bin folder. I'd recommend the former, since adding that assembly might be the start of a whole chain of adding more and more.

"System.Workflow.Runtime.Hosting.PersistenceException" Custom SharePoint Sequential workflow

I am getting following error in sharepoint Logs for my SharePoint Visual Studio Sequential workflow having a custom activity.
The custom activity is created through Component Class.
I am not sure why this error is coming? Please help!!!
System.Workflow.Runtime.Hosting.PersistenceException: Type 'System.ComponentModel.Container' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. ---> System.Runtime.Serialization.SerializationException: Type 'System.ComponentModel.Container' in Assembly 'System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' 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.WriteObjectInf... 3d93366f-a701-476c-91c9-d2153911486b
03/22/2012 12:38:36.31* w3wp.exe (0x049C) 0x1620 SharePoint Foundation Workflow Infrastructure 98d4 Unexpected ...o.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter) 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 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) at System.Workflow.ComponentModel.Activity.Save(Stream stream, IFormatter formatter) at System.Workflow.Runtime.Hosting.WorkflowPersistenceService.GetDefaultSerializedForm(Ac... 3d93366f-a701-476c-91c9-d2153911486b
03/22/2012 12:38:36.31* w3wp.exe (0x049C) 0x1620 SharePoint Foundation Workflow Infrastructure 98d4 Unexpected ...tivity activity) at Microsoft.SharePoint.Workflow.SPWinOePersistenceService.SaveWorkflowInstanceState(Activity instanceState, Boolean unlock) at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) --- End of inner exception stack trace --- at System.Workflow.Runtime.WorkflowExecutor.Persist(Activity dynamicActivity, Boolean unlock, Boolean needsCompensation) at System.Workflow.Runtime.WorkflowExecutor.ProtectedPersist(Boolean unlock) 3d93366f-a701-476c-91c9-d2153911486b
Thanks!
The Issue was because when i changed the Component class to Sequential Activity I had Activity properties e.g. 'A' & 'B'. Then i added this activity to VS toolbox. At this stage it was working fine.
Now when I changed the activity code to change its property to 'A' & 'C' and i also removed a Constructor having parameter as 'Container' object.
When i re-compiled this Activity and refresh its DLL. In workflow designer the Activity was not getting refreshed i.e. its toolbox was still pointing to old dll.
To Resolve for this i closes and opened the VS again, VOILA the designer is now getting updated Activity with new properties.
This was i think was limitation of VS toolbox that it is not getting refreshed in-spite of dll for that activity is updated.
Thanks!
Can you access the source XAML for the workflow? See if a "Container" object is being included, and if it's necessary to have it there. If you can remove it and still have the workflow run properly, this may fix the issue.

Weird Silverlight Designer Error

I get the following exception loading any Xaml in my project:
'/Microsoft.VisualStudio.Xaml;Component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.Constants.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified. Error at object 'ResourceDictionary_2' in markup file 'Microsoft.VisualStudio.Xaml;component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.xaml'.
at System.Windows.Markup.XamlParseException.ThrowException(String message, Exception innerException, Int32 lineNumber, Int32 linePosition, Uri baseUri, XamlObjectIds currentXamlObjectIds, XamlObjectIds contextXamlObjectIds, Type objectType)
at System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext, Int32 lineNumber, Int32 linePosition, String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ThrowExceptionWithLine(String message, Exception innerException)
at System.Windows.Markup.BamlRecordReader.ReadPropertyRecordBase(String attribValue, Int16 attributeId, Int16 converterTypeId)
at System.Windows.Markup.BamlRecordReader.ReadPropertyConverterRecord(BamlPropertyWithConverterRecord bamlPropertyRecord)
at System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord)
at System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord)
at System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse()
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream, ParserContext pc)
at System.Windows.Application.LoadComponent(Uri resourceLocator, Boolean bSkipJournaledProperties)
at System.Windows.Application.LoadComponent(Uri resourceLocator)
at MS.Internal.Designer.PropertyEditing.Resources.PropertyInspectorResources.GetResources()
at MS.Internal.Designer.PropertyEditing.PropertyInspectorHost.get_Host()
at MS.Internal.Designer.VSDesigner.VSDesignerClientImpl.get_PropertyWindow()
at MS.Internal.Designer.VSDesignerClient.get_PropertyWindow()
at MS.Internal.Designer.DesignerPane.LoadDesignerView()
This occurs even when I generate a new SilverLight project inside my solution, but not in a brand new solution. I've found that I am not the only person with this issue, and was wondering if you had any ideas for me.
Here is a post of someone with the same error, from Google Cache.
The stack trace is indicating you don't have a reference to the specified log4net assembly in your project. The solution would be to add a reference to it, although unless you get a log4net assembly that has been compiled against the Silverlight agCLR runtime you won't be able to.
The alternative if you are not trying to use log4net in your Silverlight app is to remove the sections of code attempting to use it. Again from the stack trace it looks like you are setting up some kind of resource that initialises log4net. Try opening your Windox.xaml and take a look in the reources section. If you see any signs of log4net there remove them and see if it helps.
I also am getting this error. I have gone through the application and made sure I am referencing the correct version. There is no use of log4net in the silverlight application, only in the web project containing a wcf service that the app uses. It looks like log4net has to be replaced with something safer. The log4net dll is also causing mstest projects to stop working.
'/Microsoft.VisualStudio.Xaml;Component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.Constants.xaml' value cannot be assigned to property 'Source' of object 'System.Windows.ResourceDictionary'. Could not load file or assembly 'log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821' or one of its dependencies. The system cannot find the file specified. Error at object 'ResourceDictionary_2' in markup file 'Microsoft.VisualStudio.Xaml;component/MS/Internal/Designer/PropertyEditing/Resources/StylesCore.xaml'.
I have no idea what the couse of the problem is. If anyone knows I would be interested find out!
I have a workaround though which solved it for me:
Remove the reference from the Silverlight project to whatever is using log4net
Remove that project using log4net from the solution.
Reload the XAML-pages and save the solution.
Finally add the project using log4net and the reference again.
Henrik

Resources