Reputation: 1081
So my iPhone MonoTouch app throws the following error when i try to build for deployment to the physical device.
Error MT2002: Could not resolve: System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (MT2002) (IcondySingleView)
It works perfectly in the simulator.
The reference to system.configuration is in a dll.
I also have this warning during compilation, the MYModel.dll contains dependencies on system.configuration.
Warning MT0011: MYModel.dll was built against a more recent runtime (NET_4_0) than MonoTouch supports. (MT0011) (IcondySingleView)
Why would it build and run in the simulator but not in the deployment to device. Can i make the settings the same somewhere.
Upvotes: 2
Views: 490
Reputation: 43553
Could not resolve: System.Configuration
MonoTouch provide a profile that is based on the Silverlight (2.1) profile along with many additions. This profile does not include System.Configuration
- which does not make much sense for devices anyway.
Warning MT0011: MYModel.dll was built against a more recent runtime (NET_4_0)
Also MonoTouch does not, right now (planned for spring 2013), support the .NET 4.0 profile. Some things may work but in general you'll find missing members that won't allow you to build your applications.
Why would it build and run in the simulator but not in the deployment to device.
Why it may works on the simulator ? That's because it uses the JIT. Just-in-time compilation means the error will occurs at runtime (if the code path that uses missing types/members is hit).
Why it will fails for devices ? That's because JIT is not allowed and we use the AOT compiler. That means everything is compiled ahead of time so anything that's missing will cause errors.
Can i make the settings the same somewhere.
Yes, you need to rebuilt all your assemblies against the SDK assemblies shipped with MonoTouch. This will ensure only the types/members that are available will be referenced in your assemblies. In turn this means everything is guaranteed to be available at build/runtime.
Upvotes: 3