Serialization Exception when I upload .appxupload instead of .appxbundle to HockeyApp - serialization

When I upload a .appxbundle of my UWP app to HockeyApp, everything works fine. When I instead upload a .appxupload file, I get a Serialization error when I run my app, and try to serialize classes with the [DataContract] attribute.
The Exception I get is the following (on some machines, not all):
Value cannot be null.
Parameter name: format
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.SR.Format(String resourceFormat, Object p1)
at System.Runtime.Serialization.DataContract.GetDataContractFromGeneratedAssembly(Type type)
at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.CreateDataContract(Int32 id, RuntimeTypeHandle typeHandle, Type type)
at System.Runtime.Serialization.DataContract.DataContractCriticalHelper.GetDataContractSkipValidation(Int32 id, RuntimeTypeHandle typeHandle, Type type)
at System.Runtime.Serialization.DataContract.GetDataContract(RuntimeTypeHandle typeHandle, Type type, SerializationMode mode)
at System.Runtime.Serialization.DataContractSerializer.get_RootContract()
at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions(XmlWriterDelegator writer, Object graph, DataContractResolver dataContractResolver)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(XmlDictionaryWriter writer, Object graph)
at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(Stream stream, Object graph)
at VungleSDK.DbTable_1`1.Serialize(T obj)
If I upload the .appxupload file to the Windows Store, I see no problems.
My question is, why is the happening? Is HockeyApp somehow modifying the .appx packages for .appxupload, but not for .appxbundle? Is something else going on?

Answering my own question:
Although HockeyApp will let you upload .appxupload files (like you can for the Windows Store), you should not. Instead, always upload the .appxbundle file.
I contacted support#hockeyapp.net, and quickly received the following response (thanks very much, HockeyApp support):
Hi Greg, thanks for getting in touch!
As the document How to sideload UWP applications indicates here it
seems we only support .appxbundle file, so please upload the
.appxbundle file instead of the .appxupload.

AppxUpload packages are meant only for the Store ingestion pipeline and I wouldn't expect them to work properly. I don't have the full rundown but they're the set of artifacts we need to properly do security patching of your application and aren't meant to be a container for execution.

Related

InDesign server COM error

I am using InDesign server on windows. And developing application using Microsoft .Net web platform (ASP.NET).
I am generating Indd file using ImportXML() method provided by InDesign. I am getting following error randomly (sometimes more often):
System.Runtime.InteropServices.COMException (0x0000FFFF): Exception from HRESULT: 0x0000FFFF
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at InDesignServer.Document.ImportXML(String From)
There is no more information provided by InDesign about where it fails so am blocked there.
Can anyone help here. Thanks.
I am not familiar with ASP.NET, but in ExtendScript it is importXML (starts with low case and case-sensitive)
Also, check the file path you are passing to the importXML.
Make sure the document is created and initialised before you import xml
After a long time. But, I became active again on 'Stack'.
This was the error due to in-appropriate permission in DCOM config.
See steps below to check:
1. From the Start menu, click Run and type Dcomcnfg.exe
2. Select 'Computers'
3. Select 'My Computers'
4. DCOM Config
5. Find InDesign COM component and select properties
6. In this set appropriate security and identity.
COM exceptions are always vague, hard to answer by anyone!

Unhandle exception issue

We have a large app built using VB.NET VS2012. Every now and then when closing the app an unhandled exception occurs. Very random, sometimes it does it sometimes it doesn't.
The error is below.
System.InvalidOperationException was unhandled
HResult=-2146233079
Message=Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
Source=System.Windows.Forms
StackTrace:
at System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous)
at System.Windows.Forms.Control.BeginInvoke(Delegate method, Object[] args)
at System.Windows.Forms.WindowsFormsSynchronizationContext.Post(SendOrPostCallback d, Object state)
at System.Windows.Forms.AxHost.ConnectionPointCookie.Finalize()
InnerException:
We produce a dump file to try and find where this is originating but have had no luck. The debugger just shows No source code available. We are using some third-party controls. At this point we just want to find what is trying to create the control. If its a problem with the third party control and if we don't have that code, we can't fix it but maybe we can work around it. But we can't find what is trying to create control (when shutting down).
We have reviewed many web posts describing how to utilize the crash dump files but have had no luck identifying the control (or even the control type) that is generating this.. Just knowing the type would help narrow it down.
Any ideas how we can at least get the type of control or the originating caller or?
If enough info isn't provided please let me know and I will post what I can.
Posting code is not an option because we have no idea where the message is coming from.
Thanks in advance!
I should have added that we do use try catch blocks for just about everything. We also do have a logging procedure but we arent seeing any of these exceptions in the log file.

Infinispan - How to know if a cache was defined in the config file (XML)?

I'm using an embedded cache architecture in Infinispan that allows dynamically create/remove caches.
If an user tries to get a no existent cache, it needs to get an exception, but the EmbeddedCacheManager API is not helping on this. This API offers two options
get(String name, true) - get and creates
get(String name, false) get but not creates
My approach? when the user simple gets a cache we use get(String name, false), and when the user creates a cache we use get(String name, true). So far, so good.
Now I have an issue: some of the caches are not created by the application, but defined in the XML. So, when a user gets one of these 'built-in' caches using get(String name, false) it do not get the cache.
We can solve these if we can identify the cache that were defined in the XML.
NOTE: For the moment, we are prefixing the name of the caches defined in the XML, but this is ugly for the code abstraction, and is getting very messy.

FileInfo..ctor(string fileName) throwing exception: bug in SL 4.0 or .NET 4.0?

The following test case passes in .NET 4.0:
var fiT = new FileInfo("myhappyfilename");
Assert.IsNotNull(fiT);
... but fails in Silverlight 4.0 with the following error:
System.ArgumentNullException: Value cannot be null.
Parameter name: format
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at System.Environment.GetResourceString(String key, Object[] values)
at System.IO.FileSecurityState.EnsureState()
at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
at System.IO.FileInfo..ctor(String fileName)
Either the failure is a bug in SL 4.0, or the non-failure is a bug in .NET 4.0. Anyone know which it is?
(For the record, I'm running SL 4.0 on VS 2010 RC, which may be contributing to the problem).
See the MSDN documentation for FileInfo for Siverlight 4:
When it is called by an elevated-trust
application, provides instance methods
for the creation, copying, deletion,
moving, and opening of files, and aids
in the creation of FileStream objects.
This class cannot be inherited.
Chances are your application isn't running with elevated trust. If you want to access those restricted methods, it'll need to be.
As to why it's returning a null - that may well be a bug, possibly an improperly propagated SecurityException. Then again, it may be as designed - the docs are also still pre-release. EDIT: gabe's answer is most likely correct on this point.
Since you generally can't access the filesystem from Silverlight (you need a fully-trusted OOB app), it looks like SL4 is trying to throw an exception, but is failing because the text for that exception isn't available in the SL4 beta. Presumably you would get the correct exception once SL4 is released.

Watin test hang application while uploading file

I have an issue with watin test that should browse for pdf and upload it to a web page. This test runs smoothly on my machine, always find pdf, click submit and wait 30 sec for upload completed.
But when I try to run this test on build machine (teamcity), happens that test hang at the point when it should wait for upload. The problem is that test don't timeout, even if I set timeout at nunit on 1 minute for whole test, or trying to reload page. The test just froze whole site at upload step.
Testing this functionality is really important, but since those tests with uploading hang whole build we have to do it manually and that isn't really out idea of test automation.
Does anyone have idea how to solve this upload problem? Or at least manage to timeout this test.
stack trace = at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData& msgData)
at mshtml.DispHTMLBaseElement.click()
at WatiN.Core.InternetExplorer.IEElement.ClickOnElement()
at WatiN.Core.Element.Click()
at WatiN.Core.FileUpload.Set(String fileName)
The issue was that WatiN used sendkeys to set the file(name) to upload. In WatiN 2.0 beta 1 this is changed to using some API calls. This solved the issue of hanging tests when automating a dialog which does require text input.
I think the problem here is that your unit test depends on too many external resources, such as your the file system of your development machine, the network, etc.
Ask yourself what the importance of the test is: is there any business logic involved you can put into a separate class? Then you can write tests for this class. What you basically need is to test all the logic of the upload process without actually uploading a file or going to the network.