I'm working on an app that uses MonoTouch, MonoDroid, and MvvmCross. My app has a screen that has tabs. I need that screen to work on both Android and iOS devices. In looking at the tutorials, it seems that tabs were recently "modernized". This has lead me to two questions:
I noticed the use of a new MvxTabsFragmentActivity (here). My question is, where can I get the binaries that have this class? I can't find it in the binaries I've downloaded. I'm currently using the 3.0 binaries.
Does the Tab Fragment approach also work on iOS? The tutorial only has an Android sample. I'm concerned that if I build my view models to work with the fragmented approach that they will not work on iOS. I'm concerned I'm starting down an Android specific path.
Thank you for any insights.
I can't find it in the binaries I've downloaded
All the MvvmCross binaries are released via https://github.com/slodge/MvvmCross-Binaries/ - or you can hopefully find them via nuget
To find out which ones are used take a look at the csproj file for the sample - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Fragments/FragmentSample.UI.Droid/FragmentSample.UI.Droid.csproj#L49
<Reference Include="Cirrious.CrossCore, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Portable\Cirrious.CrossCore.dll</HintPath>
</Reference>
<Reference Include="Cirrious.CrossCore.Droid, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Droid\Cirrious.CrossCore.Droid.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Portable\Cirrious.MvvmCross.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Binding, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Portable\Cirrious.MvvmCross.Binding.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Binding.Droid, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Droid\Cirrious.MvvmCross.Binding.Droid.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Droid, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Droid\Cirrious.MvvmCross.Droid.dll</HintPath>
</Reference>
<Reference Include="Cirrious.MvvmCross.Droid.Fragging, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Mvx\Droid\Cirrious.MvvmCross.Droid.Fragging.dll</HintPath>
</Reference>
Hint: The last one is about fragments
Does the Tab Fragment approach also work on iOS?
There are a couple of samples around that show tabs on iOS:
the old tutorial - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Sample%20-%20Tutorial/OldTutorial/Tutorial.UI.Touch/Views/Lessons/CompositeView.cs
the conference sample - https://github.com/slodge/MvvmCross-Tutorials/blob/master/Sample%20-%20CirriousConference/Cirrious.Conference.UI.Touch/Views/TabBarController.cs
The conference sample shows tabs quite in-depth - including nested UINavigationControllers using a custom presenter:
Related
I recently implemented some logging with NLog which I installed through NuGet. This works fine on my local machine during debugging.
Now when I (or anyone else) attempts to install our add-in, the add-in is not present in Excel. There is no error messages, no log file evidence, but the add-in is present in the Control Panel.
The add-in also does not appear in the File > Options > AddIns > COM panel of excel.
Edit: Found a log file in %TEMP%.
Exception Source: MyPlugin
Exception Type: System.IO.FileLoadException
Exception Message: Could not load file or assembly 'NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
Exception Target Site: .cctor
So how do I tell addin-express to use the nlog file from nuget?
Turned out that the Addin-Express install was faulty. We had to uninstall and reistall it then the dependencies were properly bundled with the plugin install.
When I run "Inspect > Code Issues in Solution", R# tells me "Cannot resolve assembly System.Drawing" and points to this line of xml in a *.resx file:
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
I looked at my System.Drawing assembly in my project's list of References. It is version 3.5.0.0, not 2.0.0.0, so I changed the version number in the xaml in the .resx file from 2.0 to 3.5. That still elicited the same warning from R#, though.
So then I thought maybe it was the PublicKeyToken that was the culprit; so I changed that value from "b03f5f7f11d50a3a" to "969db8053d3322ac" (as found here); but then the project wouldn't even build; I got:
Invalid Resx file. The located assembly's manifest definition does not match the assembly reference.
Although these "issues" exist, the app seems to be working okay - the image that follows the assembly alias:
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
blee blah bloo
</value>
</data>
...displays fine.
Still, when R# raises its finger, it makes me nervous; how can I rectify this flubup?
NOTE: This is a Visual Studio 2008 Windows CE/Compact Framework app.
I had a similar problem in the resx file in one of my C# projects:
Once I installed the relevant reference (System.Windows.Forms etc) - for that project - that particular resharper issue went away:
I have issues that I am dealing with where certain nuget installed package added via VS2012 have the copylocal value set to true where as others don't have any value set.
How does nuget know when to add copylocal and not to?
Is there some setting that I am missing in the nupkg file that I am missing?
I had a look at the source code for nuget (briefly) and it the copylocal value exists then it should be set to true.
e.g.
Install-Package System.Web.Mvc
resolves to
<Reference Include="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.AspNet.Mvc.4.0.30506.0\lib\net40\System.Web.Mvc.dll</HintPath>
</Reference>
However
Install-Package Newtonsoft.Json
Resolves to
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
I kind of figured this out.
The answer lies partly here:
http://msdn.microsoft.com/en-us/library/vslangproj.reference.copylocal
Although "Newtonsoft.Json" doesn't have the copylocal=true explicitly set in the csproj file, it seems the visual studio evaluates automatically when copylocal=true is set or not.
It seems nuget relies on the DTE integration to help it determine the value for copylocal.
I tested this out by running msbuild out of VS2012, removing System.Web.MVC from the GAC and it is copied to the bin dir.
I guess this only becomes an issue when one wants to open a compiled website the dll doesn't exist in the bin e.g. System.Web.MVC.
VS in this case does not know it should look in the GAC.
In my one of the MSI Installer I am updating the assembly and project reference relative path pro-grammatically.My all reference assemblies inside my application folder.
I try to implement both the path relative and absolute path. Both are working fine.
Relative Path
<Reference Include="log4net">
<HintPath>..\..\..\..\log4net.dll</HintPath>
</Reference>
Absolute path
<Reference Include="log4net">
<HintPath>C:\Program files\Myapplication\log4net.dll</HintPath>
</Reference>
I have only seen absolute path reference when I take the reference of assembly from the Reference Assemblies Path or GAC files.
C:\Program Files (x86)\Reference Assemblies
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files (x86)\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll</HintPath>
</Reference>
Which one is correct approach for updating path into .Csproj file?
As you stated: Both work fine.
There are corner cases, where it in fact does matter if you're using relative or absolute paths in your .csproj file:
When you plan to move your .csproj file. Will the referenced assemblies move also, then go for relative paths, otherwise take absolute paths.
When you have extreme nesting in your folder structure, then a relative path might exceed the 260 characters path name limit. This is since the full path is built internally by simply concatenating the project directory path and the relative path (including all the ..\). The concatenated path then might exceed the characters-in-path-name-limit mentioned above whereas the absolute path does not.
I'm having difficulty implementing EFCodeFirst.CreateTablesOnly (changed to DontDropDbJustCreateTablesIfModelChangedStart).
I have successfully pulled in the package using NUGET. Now there is a mention of
in packages.config
and a DontDropDbJustCreateTablesIfModelChangedStart.cs
I've added Devtalk.EF.CodeFirst to references
in my app_start directory.
But I still can't make use of the DontDropDbJustCreateTablesIfModelChangedStart class. When I do, the app dies with msg
Could not load file or assembly 'EntityFramework, Version=4.1.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its
dependencies. The located assembly's manifest definition does not
match the assembly reference. (Exception from HRESULT: 0x80131040)
When I check definition of DontDropDbJustCreateTablesIfModelChangedStart, I find it only has a signature and not a definition.
What did I do wrong? Or what step did I leave out? Am I supposed to Implement the Class/Method?
The problem is that library was probably compiled with EntityFramework.dll version 4.1.0.0 and author didn't update it for version 4.2.0.0 and 4.3.0.0. Try to redirect version 4.1.0.0 to version 4.3.0.0 in your web.config file.
Don't Use it use EF's Migrations:
http://blogs.msdn.com/b/adonet/archive/2012/02/09/ef-4-3-released.aspx