如何在Django中使用iframe进行制作?

时间:2017-06-13 00:30:19

标签: python django iframe

我自2005年以来一直在使用WordPress,现在正将我的所有网站切换到Django Projects。这是我的第一个Django项目,它将拥有多个网络应用程序。

我正在使用Visual Studio Preview 2017来创建我的Django项目。 在我的项目中,我设置了一个主Web应用程序,其中包含项目urls.py,view.py,model.py和模板文件夹,其中包含主要的html页面。此主Web应用程序将连接到项目中的其他Web应用程序。

我知道网络应用开发的目标是让一个人留在网络应用上。据说我需要在我的项目中添加博客和联盟网页。我知道如何做到这一点的唯一方法是iframe。

我在这个网站上找到了一个选项但除了添加|之外没有任何意义对网址安全。 [1]:generate iframe from django tag

如果我需要在我的项目Web应用程序的代码中使用序列化程序,我查看了上面的链接以及我的问题?

我的代码是:

Affi网络应用

web_host_python.html

     <html>
<head><title>Web Host Python Hosting</title></head>

<body>

{{ whpaff.html | safe }}

</body>
</html>

whpaff.html

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <iframe src=" https://www.webhostpython.com/billing/aff.php?aff=69" 
                  style="border:0px #ffffff none;" name="web_host_python" 
                  scrolling="no" frameborder="1" marginheight="0px" 
                  marginwidth="0px" 
                  height="100%" width="100%" allowfullscreen></iframe>
</body>
</html>

urls_affi.py

from django.conf.urls import url
from . import views

urlpattens = [
    url(r'^$', views.home),
    ]

view_affi.py

from django.shortcuts import render, HttpResponse

# Create your views here.
def web_host_python(request):
    return render(request, 'affi/web_host_python.html')

Project Main App

url.py

   """
Definition of urls for affiliate_sites.
"""

from datetime import datetime
from django.conf.urls import url
import django.contrib.auth.views

import app.forms
import app.views

# Uncomment the next lines to enable the admin:
# from django.conf.urls import include
# from django.contrib import admin
# admin.autodiscover()

urlpatterns = [
    # Examples:
    url(r'^affi$', views_affi.web_host_python, name='web_host_python),
    url(r'^$', app.views.home, name='home'),
    url(r'^contact$', app.views.contact, name='contact'),
    url(r'^about', app.views.about, name='about'),
    url(r'^login/$',
        django.contrib.auth.views.login,
        {
            'template_name': 'app/login.html',
            'authentication_form': app.forms.BootstrapAuthenticationForm,
            'extra_context':
            {
                'title': 'Log in',
                'year': datetime.now().year,
            }
        },
        name='login'),
    url(r'^logout$',
        django.contrib.auth.views.logout,
        {
            'next_page': '/',
        },
        name='logout'),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),

view.py

   """
Definition of views.
"""

from django.shortcuts import render
from django.http import HttpRequest
from django.template import RequestContext
from datetime import datetime

def web_host_python(request):
    """Renders the home page."""
    assert isinstance(request, HttpRequest)
    return render(
        request,
        'affi/web_host_python.html'
        {
            'title':'affi/web_host_python.html',
            'year':datetime.now().year,
        }
    )

def home(request):
    """Renders the home page."""
    assert isinstance(request, HttpRequest)
    return render(
        request,
        'app/index.html',
        {
            'title':'Home Page',
            'year':datetime.now().year,
        }
    )

def contact(request):
    """Renders the contact page."""
    assert isinstance(request, HttpRequest)
    return render(
        request,
        'app/contact.html',
        {
            'title':'Contact',
            'message':'Your contact page.',
            'year':datetime.now().year,
        }
    )

def about(request):
    """Renders the about page."""
    assert isinstance(request, HttpRequest)
    return render(
        request,
        'app/about.html',
        {
            'title':'About',
            'message':'Your application description page.',
            'year':datetime.now().year,
        }
    )

这是否正确我做了什么?

或者是否有另一种更简单的方法在Django中做iframe?

感谢您的所有建议。

马库斯

2 个答案:

答案 0 :(得分:1)

我认为你的代码没有按照你的想法行事。 {{ whpaff.html | safe }}将在调用whpaff函数时查找要传递给模板的名为render()的参数,然后从该参数中嵌入html属性的值进入生成的输出。您正在将其他参数(例如titlemessageyear)传递给某些render()函数,但我没有看到您传递的{{1}参数。我认为你打算神奇地加载文件“whpaff.html”并将该文件的内容嵌入到你的输出中,但这不是whpaff块在Django模板中的工作方式。

另一方面,{{ }}是一个HTML标记,可让您显示网页中其他网址的内容。 Django与<iframe>没有直接关系。您可以在Django模板中包含<iframe>标记,就像任何其他HTML标记一样,或者您可以使用<iframe>标记引用由Django生成的URL,但Django不会知道或关心关于<iframe>的任何一种情况。

答案 1 :(得分:0)

您可以尝试将iframe标记添加到您的html中,而不是加载iframe的html内容。例如:

Application: RPFabric.Service.Tenant.exe
Framework Version: v4.0.30319
Description: The application requested process termination through System.Environment.FailFast(string message).
Message: Lsn obtained through replication is 634711 and metadata present in deleted state is Name: urn:<StateName>, StateProviderId: 131414644208509332, CreateLSN: 634679, DeleteLSN: 634695 MetadataMode: DelayDelete TransactionId: 0
Stack:
   at System.Environment.FailFast(System.String)
   at Microsoft.ServiceFabric.Replicator.Utility.Assert(Boolean, System.String, ...)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<ApplyOnRecoveryAsync>d__89.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.ServiceFabric.Replicator.DynamicStateManager+<ApplyOnRecoveryAsync>d__89, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ApplyOnRecoveryAsync>d__89 ByRef)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager.ApplyOnRecoveryAsync(Int64, Microsoft.ServiceFabric.Replicator.TransactionBase, Microsoft.ServiceFabric.Replicator.ReplicationMetadata)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyOnLocalStateAsync>d__f6.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyOnLocalStateAsync>d__f6, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<OnApplyOnLocalStateAsync>d__f6 ByRef)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager.OnApplyOnLocalStateAsync(Int64, Microsoft.ServiceFabric.Replicator.TransactionBase, System.Fabric.OperationData, System.Fabric.OperationData, Microsoft.ServiceFabric.Replicator.ApplyContext)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyAsync>d__4c.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyAsync>d__4c, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<OnApplyAsync>d__4c ByRef)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager.OnApplyAsync(Int64, Microsoft.ServiceFabric.Replicator.TransactionBase, System.Fabric.OperationData, System.Fabric.OperationData, Microsoft.ServiceFabric.Replicator.ApplyContext, Int64)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyAsync>d__47.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyAsync>d__47, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<OnApplyAsync>d__47 ByRef)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager.OnApplyAsync(Int64, Microsoft.ServiceFabric.Replicator.TransactionBase, System.Fabric.OperationData, System.Fabric.OperationData, Microsoft.ServiceFabric.Replicator.ApplyContext)
   at Microsoft.ServiceFabric.Replicator.LoggingReplicator+<ApplyCallback>d__ce.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.ServiceFabric.Replicator.LoggingReplicator+<ApplyCallback>d__ce, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ApplyCallback>d__ce ByRef)
   at Microsoft.ServiceFabric.Replicator.LoggingReplicator.ApplyCallback(Microsoft.ServiceFabric.Replicator.LogRecord)
   at Microsoft.ServiceFabric.Replicator.LoggingReplicator+<Microsoft.ServiceFabric.Replicator.ILogRecordsProcessor.ProcessLoggedRecordAsync>d__ab.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.ServiceFabric.Replicator.LoggingReplicator+<Microsoft.ServiceFabric.Replicator.ILogRecordsProcessor.ProcessLoggedRecordAsync>d__ab, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<Microsoft.ServiceFabric.Replicator.ILogRecordsProcessor.ProcessLoggedRecordAsync>d__ab ByRef)
   at Microsoft.ServiceFabric.Replicator.LoggingReplicator.Microsoft.ServiceFabric.Replicator.ILogRecordsProcessor.ProcessLoggedRecordAsync(Microsoft.ServiceFabric.Replicator.LogRecord)
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<ProcessTransaction>d__1f.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<ProcessTransaction>d__1f, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<ProcessTransaction>d__1f ByRef)
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher.ProcessTransaction(System.Collections.Generic.List`1<Microsoft.ServiceFabric.Replicator.TransactionLogRecord>)
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<SeparateTransactions>d__24.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Start[[Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<SeparateTransactions>d__24, Microsoft.ServiceFabric.Data.Impl, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]](<SeparateTransactions>d__24 ByRef)
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher.SeparateTransactions()
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<ProcessLoggedRecords>d__a.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(Int32)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(Int32)
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<SeparateTransactions>d__24.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
   at Microsoft.ServiceFabric.Replicator.LogRecordsDispatcher+<ProcessTransaction>d__1f.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
   at Microsoft.ServiceFabric.Replicator.LoggingReplicator+<Microsoft.ServiceFabric.Replicator.ILogRecordsProcessor.ProcessLoggedRecordAsync>d__ab.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetResult()
   at Microsoft.ServiceFabric.Replicator.LoggingReplicator+<ApplyCallback>d__ce.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.__Canon)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.__Canon)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyAsync>d__47.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.__Canon)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.__Canon)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyAsync>d__4c.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.__Canon)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.__Canon)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<OnApplyOnLocalStateAsync>d__f6.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.__Canon)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.__Canon)
   at Microsoft.ServiceFabric.Replicator.DynamicStateManager+<ApplyOnRecoveryAsync>d__89.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
   at System.Fabric.Store.TStore`5+<Microsoft.ServiceFabric.Replicator.IStateProvider2.RecoverCheckpointAsync>d__f3[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
   at System.Fabric.Store.MetadataManager+<WriteAsync>d__24.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].TrySetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.VoidTaskResult)
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[[System.Threading.Tasks.VoidTaskResult, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].SetResult(System.Threading.Tasks.Task`1<System.Threading.Tasks.VoidTaskResult>)
   at System.Fabric.Store.MetadataManager+<WriteAsync>d__2c.MoveNext()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()
   at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action, Boolean, System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.FinishContinuations()
   at System.Threading.Tasks.Task.Finish(Boolean)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

除非我误解你的部分问题?