Opening the 'Insert image' modal in Umbraco 6.1.3 causes NullReferenceException - umbraco

When I hit the 'Insert image' button in the rich text editor bar, the modal opens but then an error page appears:
Details of exception: System.NullReferenceException: Object reference not set to an instance of an object
Stacktrace:
[NullReferenceException: De objectverwijzing is niet op een exemplaar van een object ingesteld.]
umbraco.controls.Images.ImageViewer.OnPreRender(EventArgs e) +70
System.Web.UI.Control.PreRenderRecursiveInternal() +83
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Control.PreRenderRecursiveInternal() +168
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
Versiondata: Microsoft .NET Framework Versie:4.0.30319; ASP.NET Versie:4.0.30319.17929
Running Umbraco 6.1.3 on localhost and on server, both give the error.
I have already tried to replace the umbraco.dll and umbraco.editorControls.dll with fresh ones, but to no avail.
I also checked all my datatypes, but none are corrupt (as per Rich Text Editor and Inserting Images getting error and http://our.umbraco.org/forum/using/ui-questions/39103-Problem-with-Rich-Text-Editor-and-Inserting-Images).
I am using uComponents, but I have the most recent version (5.5.0)

If this is an update from a previous version, check that the configuration settings are all present, especially any specific to the media folder. It sounds like a setting just isn't present.
Also, often I forget to "include" all the files in my visual studio project too, so when I do a publish, any new files don't get included.

I got this error when I upgraded an install from v6.1.1 to v6.1.6. Although the offcial instructions state that only the bin folder needs to be updated this is far from being the case. You also need to ensure you use the latest files under /Umbraco and also /Umbraco_client. If you check the namespaces in /Umbraco/Controls/Images, for example you'll see it now lives in a different namespace
'<%# Control Language="C#" AutoEventWireup="True" CodeBehind="ImageViewer.ascx.cs" Inherits="Umbraco.Web.UI.Umbraco.Controls.Images ... %>
to the original:
'<%# Control Language="C#" AutoEventWireup="true" CodeBehind="ImageViewer.ascx.cs" Inherits="umbraco.controls.Images.ImageViewer" %>'
I've been working with Umbraco for just over six months and in that time I've yet to see a document from them that is accurate or complete. FFS.

Related

Umbraco uSync - importing does not show element causing issue

uSync import error - Object reference not set to an instance of an object
Extending Umbraco And Using The API
Umbraco 7
We are currently using uSync but now have an environment where we get this below error in the logs when attempting an import
My question is - how can I trace WHICH element is causing this issue during the import? The debugging does not show which element is being processed when the error occurs
Many thanks
2019-03-04 11:09:34,497 [P1716/D7/T160] ERROR
Jumoo.uSync.BackOffice.Controllers.uSyncApiController - Unhandled
controller exception occurred System.NullReferenceException: Object
reference not set to an instance of an object. at
Jumoo.uSync.Core.Serializers.ContentTypeBaseSerializer1.DeserializeBase(IContentTypeBase
item, XElement info) at
Jumoo.uSync.Core.Serializers.ContentTypeSerializer.DeserializeCore(XElement
node) at
Jumoo.uSync.Core.Serializers.SyncBaseSerializer1.DeSerialize(XElement
node, Boolean forceUpdate) at
Jumoo.uSync.BackOffice.Handlers.ContentTypeHandler.Import(String
filePath, Boolean force) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportFolder(String
folder, Boolean force, Dictionary2 updates) at
Jumoo.uSync.BackOffice.Handlers.uSyncBaseHandler1.ImportAll(String
folder, Boolean force) at
Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(IEnumerable1
syncHandlers, String folder, Boolean checkConfig, Boolean force,
String groupName) at
Jumoo.uSync.BackOffice.uSyncBackOfficeContext.Import(String groupName,
String folder, Boolean force) at
Jumoo.uSync.BackOffice.uSyncBackOfficeContext.ImportAll(String folder,
Boolean force) at
Jumoo.uSync.BackOffice.Controllers.uSyncApiController.Import(Boolean
force)
I'm not sure Kev who maintains uSync is on here much. I'd raise an issue on the Github repo for uSync here: https://github.com/KevinJump/uSync/issues and Kev will usually get back to you pretty quickly.
It's possibly something to do with a missing DataType or something though.
You can try setting the logger to log more detailed information for uSync which might give you more information to go on. To do this, add the following:
<logger name="Jumoo.uSync"><level value="Debug" /></logger>
to the config/log4net.config file on your site. this should cause uSync to log more information to the /App_Data/umbracoTraceLog.txt file which might give you more useful information!
Hope that helps!

Xamarin Error XA0009 - Format of Executable or Library is invalid

I am struggling to make an Android App, but it always seems to end in this particular failure:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets: Error: Exception while loading assemblies: Java.Interop.Tools.Diagnostics.XamarinAndroidException: error XA0009: Error while loading assembly: bin/Debug/(projectname).dll ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.
at Mono.Cecil.PE.ImageReader.ReadImage () [0x0002d] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
at Mono.Cecil.PE.ImageReader.ReadImage (Mono.Disposable1[T] stream, System.String file_name) [0x0000a] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
at Mono.Cecil.ModuleDefinition.ReadModule (Mono.Disposable1[T] stream, System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00007] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
at Mono.Cecil.ModuleDefinition.ReadModule (System.String fileName, Mono.Cecil.ReaderParameters parameters) [0x00073] in <1b827dd2cbec4ef6829dffcefdcd3b01>:0
--- End of inner exception stack trace ---
at Java.Interop.Tools.Diagnostics.Diagnostic.Error (System.Int32 code, System.Exception innerException, System.String message, System.Object[] args) [0x0000a] in :0
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Load (System.String fileName) [0x00045] in <9ca47d05131d4b8c85910dacd818f0c6>:0
at Xamarin.Android.Tasks.ResolveAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver resolver) [0x00123] in <3f37ea95794e430e91f10accab4cf241>:0 ((projectname))
I am wondering what on earth might be causing the error, as I have tried multiple solutions to avoid the error and it often turns up in such random ways.
Last time I got the error it occurred as follows:
I had a project with only two Activity-files and two Layout files.
I created a gridview in the other layout and tested it on the Android emulator -> all was working well.
I resized the gridview and tested the app with the emulator -> error mentioned above occurred.
I deleted the solution, restored a manual backup saved in an other location, and tested it -> it was working.
I repeated the procedure with the gridview -> error occurred.
Now, as I deleted the project and tried to restore the backup again, even the backup did not work anymore. I tried to build it, then clean it and build but every attempt to build it resulted now as an error.
I seem to get mystic errors from time to time ( like Emulator image stopped working after all I did was just add a button with the designer) but every time troubleshooting eventually comes down to this error and I have to scrap the project. I have been working with Xamarin now 18 hours this weekend and 4 hours have been coding and the rest trying to fix the never-ending errors.
I am using MacBook Pro and have tried running the solution from the default directory and external drive.
So in a nutshell: What causes the error mentioned above and can it be fixed or at least avoided?
I tried to google ( long and hard) but could not find a solution that would be of any help.
Ps. Sorry if the post was not correct, it is my first. Would not have posted in the first place but I am desperate.
Thank you for your patience to read all the way to here.

Cannot Insert image through Umbraco RichText editor

The problem regarding richtext editor in Umbraco 4.
I am not able to add images through the RichText editor. When i click on the add image icon on the rich text editor, the popup panel displays an error (find in resource number 2).
The RichText editor datatype is using Tinymce3 as its type.
The resources ihave used and did not solve the problem.
1) http://our.umbraco.org/forum/using/ui-questions/39103-Problem-with-Rich-Text-Editor-and-Inserting-Images
2) Rich Text Editor and Inserting Images getting error
What i have done(they did not work):
a) resaved the RichText editor datatype with different Type,
b) deleted the RichText editor(bad mistake) and recreated it,
c) copied the code of insertimage.aspx from different projects wherever the RichText editor is working,
Kindly, have a look at the error image i have attached with this question.
Any suggestion would be helpful.
Error
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Source Error:
[No relevant source lines]
Source File: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_uploadmediaimage.ascx.c3c18f9f.5y91thdt.0.cs Line: 0
Stack Trace:
[NullReferenceException: Object reference not set to an instance of an object.]
umbraco.cms.businesslogic.datatype.DataTypeDefinition.b__0(DataTypeDefinition x) +235
System.Linq.WhereArrayIterator`1.MoveNext() +42
umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetByDataTypeId(Guid DataTypeId) +311
umbraco.controls.Images.UploadMediaImage..ctor() +88
ASP.umbraco_controls_images_uploadmediaimage_ascx..ctor() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_uploadmediaimage.ascx.c3c18f9f.5y91thdt.0.cs:0
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlMediaUploader() in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:187
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlpane_upload() in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:186
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlForm1() in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:150
ASP.umbraco_plugins_tinymce3_insertimage_aspx.__BuildControlTree(umbraco_plugins_tinymce3_insertimage_aspx __ctrl) in c:\work\IU\trunk\src\International.Web.UI\umbraco\plugins\tinymce3\insertImage.aspx:1
ASP.umbraco_plugins_tinymce3_insertimage_aspx.FrameworkInitialize() in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_insertimage.aspx.43b758d9.qhb5uafm.0.cs:0
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +67
System.Web.UI.Page.ProcessRequest() +118
System.Web.UI.Page.ProcessRequest(HttpContext context) +98
ASP.umbraco_plugins_tinymce3_insertimage_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\1096afd0\6b67abfd\App_Web_insertimage.aspx.43b758d9.qhb5uafm.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +912
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +164
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18033
Two things that spring to mind:
Permissions
I would do the usual housekeeping check first. Ensure that the following accounts have modify permission on all of the site's folders:
NETWORK SERVICE
IUSR
IIS_IUSRS
Corrupted install
A final resort would be a re-install. Copy over all the files from your version of Umbraco. If this still doesn't work, point it at a new database and try re-installing a basic Umbraco website.
The idea here is to determine if it is a corrupted database record, or a missing/corrupted file.
Is the site a new one? Have you always stuck with the same version or recently upgraded?
Let us know if you have your own answer too please. Best of luck!

Why is EF4 trying to re-create my database even though the model hasn't changed?

I have an ASP.NET MVC 3 Beta website using SQL Server CE 4.0. With both ScottGu's NerdDinner example and my own code, I will sometimes get the following exception as soon as I try to access the database:
File already exists. Try using a different database name.
[ File name = D:\Sourcecode\NerdDinner\NerdDinner\App_Data\NerdDinners.sdf ]
Line 17: public ActionResult Index()
Line 18: {
Line 19: var dinners = from d in nerdDinners.Dinners
Line 20: where d.EventDate > DateTime.Now
Line 21: select d;
[SqlCeException (0x80004005): File already exists. Try using a different database name. [ File name = D:\Sourcecode\NerdDinner\NerdDinner\App_Data\NerdDinners.sdf ]]
System.Data.SqlServerCe.SqlCeEngine.ProcessResults(IntPtr pError, Int32 hr) +92
System.Data.SqlServerCe.SqlCeEngine.CreateDatabase() +1584
System.Data.SqlServerCe.SqlCeProviderServices.DbCreateDatabase(DbConnection connection, Nullable`1 timeOut, StoreItemCollection storeItemCollection) +287
System.Data.Objects.ObjectContext.CreateDatabase() +84
System.Data.Entity.Internal.DatabaseOperations.Create(ObjectContext objectContext) +35
System.Data.Entity.Infrastructure.Database.Create() +70
System.Data.Entity.Infrastructure.CreateDatabaseOnlyIfNotExists`1.InitializeDatabase(TContext context) +360
System.Data.Entity.Infrastructure.Database.Initialize() +272
System.Data.Entity.Internal.InternalContext.Initialize() +90
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +34
System.Data.Entity.Internal.Linq.EfInternalQuery`1.Initialize() +140
System.Data.Entity.Internal.Linq.EfInternalQuery`1.get_Provider() +29
System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() +34
System.Linq.Queryable.Where(IQueryable`1 source, Expression`1 predicate) +63
NerdDinner.Controllers.HomeController.Index() in D:\Sourcecode\NerdDinner\NerdDinner\Controllers\HomeController.cs:19
I cannot figure out why this works sometimes with an existing .dbf file and other times it complains. I have even tried explicitly setting the default behaviour with
Database.SetInitializer(new CreateDatabaseOnlyIfNotExists<...>());
Has anyone else experienced this?
Restarting Cassini doesn't seem to make a difference.
Hitting refresh in IE after receiving this error will make the exact same page load properly.
Sorry to resurrect such an old question, but I was experiencing this today and have found a workaround which does not involve installing an older version of the CTP.
From The correct url for the blogpost is http://www.hanselman.com/blog/PDC10BuildingABlogWithMicrosoftUnnamedPackageOfWebLove.aspx (about half-way through the blog post)
*Go into your AppStart_SQLCEEntityFramework.cs file and the DefaultConnectionFactory line to this:*
Database.DefaultConnectionFactory = new SqlCeConnectionFactory(
"System.Data.SqlServerCe.4.0",
HostingEnvironment.MapPath("~/App_Data/"),"");
My particular database is placed in the App_Data folder but I'm assuming that if yours is not you should be able to change the path to suit and it will work.
Hope this helps!
It looks like this is a recently discovered bug.
MSDN Forum
The workaround is to re-install SQL Server CE 4.0 CTP 1 download
Install and use SQL Server CE CTP1, which is still downloadable on Microsoft sites. This solved my problem with that.
I had the same problem today with released MVC3 and SQL Server CE 4.0 downloaded with NuGet and it was resolved by uncommenting the line:
DbDatabase.SetInitializer(new CreateCeDatabaseIfNotExists<MyContext>());
And replacing MyContext with the context class that was inheriting from DBContext in the models folder.
The final SQL Compact Edition 4.0 is out and after installing it the issue is not happening anymore. Here is the announcement from the team blog:
Microsoft SQL Server Compact 4.0 is available for download

SharePoint error: "File Not Found"

I have an ASP.NET 2.0 web project that lives within SharePoint 2007. A couple of days ago, I made two changes to several pages, the first change was to adding a script reference to a jQuery file inside of my script folder that I lives with in my web project.
The second change was where I replace all of my DatePicker controls from SharePoint's DateTime control and I had to add a <% Register....SharePoint.WebControls reference at the top of this one page.
After I have compiled the solution in release mode and deployed out to my production environment, I started to get a "File Not Found" error when I try to access the page from SharePoint. I have no idea what's going on. We have recycle the app pool and even the stack trace doesn't tell use that much. Below is a view of the stack trace that I received when accessing the page. Please help, I've been looking at this issue for days now.
File Not Found. at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle)
at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Signature..ctor(RuntimeFieldHandle fieldHandle, RuntimeTypeHandle declaringTypeHandle)
at System.Reflection.RtFieldInfo.get_FieldType()
at System.Web.UI.Util.GetNonPrivateFieldType(Type classType, String fieldName)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildFieldDeclaration(ControlBuilder builder)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse)
at System.Web.Compilation.BaseTemplateCodeDomTreeGenerator.BuildSourceDataTreeFromBuilder(ControlBuilder builder, Boolean fInTemplate, Boolean topLevelControlInTemplate, PropertyEntry pse)
at System.Web.Compilation.TemplateControlCodeDomTreeGenerator.BuildMiscClassMembers()
at System.Web.Compilation.PageCodeDomTreeGenerator.BuildMiscClassMembers()
at System.Web.Compilation.BaseCodeDomTreeGenerator.BuildSourceDataTree()
at System.Web.Compilation.BaseTemplateBuildProvider.GenerateCode(AssemblyBuilder assemblyBuilder)
at System.Web.Compilation.AssemblyBuilder.AddBuildProvider(BuildProvider buildProvider)
That's a familiar one. It's related to the version of System.Web.Extensions that's requested by the SharePoint DateTime control. It seems that it is using Ajax and you aren't referencing the right Ajax platform version.
Steps similar to the ones described here solved my problem:
http://paulsiu.wordpress.com/2009/03/04/file-not-found-error-when-you-select-new-webpart-after-installing-smartpart-13/

Resources