Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Error appears in debug build, but in release works ok.
[ERROR] FATAL UNHANDLED EXCEPTION: System.MissingMethodException: Default constructor not found for type fh.backend.transactions.FHOpSettingsDownloadResponse.
at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00095] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:329
at System.Activator.CreateInstance (System.Type type) [0x00000] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System/Activator.cs:224
at fh.backend.gw.FHGatewayBase.buildResponse (System.Type responseType) [0x00000] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.backend/gw/FHGatewayBase.cs:280
at fh.backend.gw.FHGatewayBase.process (fh.backend.transactions.IFHGWOpRequest op, fh.backend.transactions.IFHGWOpResponse& response) [0x00017] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.backend/gw/FHGatewayBase.cs:394
at fh.backend.gw.FHGateway.SettingsDownload (System.String workstation, System.String settingsName, System.String& fname) [0x000a0] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.backend/gw/FHGateway.cs:842
at fh.engines.SyncEngine.refreshServerHash (System.Boolean& isChanged, System.String& serverHash) [0x00022] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.engines/SyncEngine.cs:129
at fh.engines.SyncEngine.Sync () [0x0000d] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.engines/SyncEngine.cs:221
at fh.engines.FHCloudEngine.performFullSync (fh.engines.SyncEngineRequest item) [0x000ae] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.engines/FHCloudEngine.cs:104
at fh.engines.FHCloudEngine.processWorkItem (fh.engines.SyncEngineRequest item) [0x0002e] in /Users/quickwebwork/Desktop/Work/SVN/modules-ios/FileHopperSVN/fh.ios/fh.ios/library/fh.engines/FHCloudEngine.cs:47
at fh.core.threading.ThreadEx`1[fh.engines.SyncEngineRequest].runner () [0x00000] in <filename unknown>:0
at System.Threading.Thread.StartInternal () [0x0001d] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Threading/Thread.cs:697
Do you have a test case we can use to reproduce this?
Thank you for rapid response.
Here is the line that crashes the application in debug mode (the one with Activator.Create....):
private IFHGWOpResponse buildResponse (Type responseType)
object rawRespInst = Activator.CreateInstance(responseType);
IFHGWOpResponse iresp = rawRespInst as IFHGWOpResponse;
throw new Exception("Invalid response type");
The responseType is random (there are several object types that generate the error) - one of them is:
public class FHOpSettingsDownloadResponse:IFHGWOpResponse
public enum Status
OK = 1,
ERROR = 0x10
public Status opStatus;
public FileDownloadParam content;
public override bool process (ref byte rawResponseContent)
public abstract class IFHGWOpResponse
public FHGWOpResponseStatus status;
public virtual bool process(ref byte rawResponseContent)
public virtual bool processStream(IFHGWOpRequest req,object stream, string fsTarget)
Compare your Debug and Release settings. They likely have different "Link behavior" specified.
If your project (e.g. Debug) uses "Link all" then the linker will remove unused code from your application (to save space and minimize deployment time). That means unused default constructor will also be removed. Since this is static analysis the use of reflection (e.g. Activator) won't be seen as a need to keep them.
You can either switch to "Link SDK" or add [Preserve] attributes on members (like your default .ctor) that your application needs to have at runtime.
Thank you Sebastien.
It works with the same settings.
We'll need more details to help, starting with:
* You linker settings: "Link all" or "Link SDK"
E.g. You can also have "#if DEBUG" region in your source code that could bring more code into Debug than inside Release. That can influence how reflection will be able to use them at runtime.
* Do you see the same results on the iOS simulator and on devices ? (for both Debug and Release configuration).
Also attach (you can mark them private) the full build logs (from MD "Build Output" in the "Error List" pad) for both Debug and Release builds.
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?
If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.
Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.