Skip to content

Commit

Permalink
📝 add document to help users with .NET Native errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate McMaster committed Jan 28, 2016
1 parent 47d1cce commit 5ee91c3
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import sys
import os
import shlex
from datetime import date

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -50,7 +51,7 @@

# General information about the project.
project = 'Entity Framework'
copyright = '2015 Microsoft'
copyright = '%d Microsoft' % (date.today().year)
author = 'Microsoft'

# The version info for the project you're documenting, acts as replacement for
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ Available Tutorials

full-dotnet/index
aspnet5/index
uwp
uwp/index
osx
linux
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Create a new project
* Open **Properties/Default.rd.xml**
* Add the highlighted line shown below

.. literalinclude:: uwp/sample/EFGetStarted.UWP/Properties/Default.rd.xml
.. literalinclude:: sample/EFGetStarted.UWP/Properties/Default.rd.xml
:language: c#
:lines: 27-28
:emphasize-lines: 2
Expand Down Expand Up @@ -88,7 +88,7 @@ Now it's time to define a context and entity classes that make up your model.
.. note::
Notice the ``OnConfiguring`` method (new in EF7) that is used to specify the provider to use and, optionally, other configuration too.

.. literalinclude:: uwp/sample/EFGetStarted.UWP/Model.cs
.. literalinclude:: sample/EFGetStarted.UWP/Model.cs
:language: c#
:linenos:

Expand All @@ -113,15 +113,15 @@ Since we want the database to be created on the device that the app runs on, we
* Right-click on **App.xaml** in **Solution Explorer** and select **View Code**
* Add the highlighted using to the start of the file

.. literalinclude:: uwp/sample/EFGetStarted.UWP/App.xaml.cs
.. literalinclude:: sample/EFGetStarted.UWP/App.xaml.cs
:language: c#
:linenos:
:lines: 1-6
:emphasize-lines: 2

* Add the highlighted code to apply any pending migrations

.. literalinclude:: uwp/sample/EFGetStarted.UWP/App.xaml.cs
.. literalinclude:: sample/EFGetStarted.UWP/App.xaml.cs
:language: c#
:linenos:
:lines: 30-42
Expand All @@ -141,7 +141,7 @@ You can now use your model to perform data access.
* Open *MainPage.xaml*
* Add the page load handler and UI content highlighted below

.. literalinclude:: uwp/sample/EFGetStarted.UWP/MainPage.xaml
.. literalinclude:: sample/EFGetStarted.UWP/MainPage.xaml
:language: c#
:linenos:
:emphasize-lines: 9,12-22
Expand All @@ -151,7 +151,7 @@ Now we'll add code to wire up the UI with the database
* Right-click **MainPage.xaml** in **Solution Explorer** and select **View Code**
* Add the highlighted code from the following listing

.. literalinclude:: uwp/sample/EFGetStarted.UWP/MainPage.xaml.cs
.. literalinclude:: sample/EFGetStarted.UWP/MainPage.xaml.cs
:language: c#
:linenos:
:lines: 23-49
Expand All @@ -163,6 +163,6 @@ You can now run the application to see it in action.
* The application will build and launch
* Enter a URL and click the **Add** button

.. image:: uwp/_static/create.png
.. image:: _static/create.png

.. image:: uwp/_static/list.png
.. image:: _static/list.png
11 changes: 11 additions & 0 deletions docs/getting-started/uwp/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Universal Windows Platform
==========================

These articles provide documentation for using EF on Universal Windows Platform.

.. toctree::
:titlesonly:
:caption: The following articles are available

getting-started
netnative
28 changes: 28 additions & 0 deletions docs/getting-started/uwp/netnative.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.NET Native
===========

Fixing Reflection Errors
------------------------

Applications using EF on Universal Windows Platform may encounter errors due to current limitations in .NET Native.
These errors usually appear as ``MissingRuntimeArtifactException`` or ``MissingMetadataException``, which are casued by incomplete reflection support in .NET Native. In most cases,
these errors can be resolved by adding the proper `Runtime Directive <https://msdn.microsoft.com/en-us/library/dn600639(v=vs.110).aspx>`_.

.. note::
The following blog post includes more detail about how to correctly fix reflection errors on .NET Native:

`.NET Native Deep Dive: Help! I Hit a MissingMetadataException! <http://blogs.msdn.com/b/dotnet/archive/2014/05/21/net-native-deep-dive-help-i-hit-a-missingmetadataexception.aspx>`_

.. tip::
This troubleshooter will help generate the appropriate entry for your runtime directives file:

`MissingMetadataException troubleshooter <http://dotnet.github.io/native/troubleshooter/type.html>`_


Additional Reading
------------------
For more information, the following articles may be helpful.

- `.NET Native – What it means for Universal Windows Platform (UWP) developers <https://blogs.windows.com/buildingapps/2015/08/20/net-native-what-it-means-for-universal-windows-platform-uwp-developers/>`_
- `Reflection and .NET Native <https://msdn.microsoft.com/en-us/library/dn600640(v=vs.110).aspx>`_
- `Compiling Apps with .NET Native <https://msdn.microsoft.com/en-us/library/dn584397(v=vs.110).aspx>`_

0 comments on commit 5ee91c3

Please sign in to comment.