【问题标题】:Unable to load entityframework in XBAP solution from internet. Works on LAN无法从 Internet 加载 XBAP 解决方案中的实体框架。在局域网上工作
【发布时间】:2014-08-19 02:53:27
【问题描述】:

XBAP:从 Internet 访问时无法加载程序集 EntityFramework。局域网工作

我找到了这些帖子(以及更多),但没有帮助:

我有一个在 vs2012 中开发的 XBAP 解决方案。该解决方案包括以下项目:

  • XBAP主项目(主项目)
  • WCF 服务(用于用户身份验证)
  • 从 sql/entity 框架获取数据的数据访问层项目

XBAP 以完全信任的方式发布。我创建了一个测试证书并将其安装在客户端计算机上以启用完全信任。该网站位于客户端计算机受信任的站点区域。
该解决方案有 1 个 SQL Express 数据库。我已经用 c# 编写了所有内容。我把这个项目写成数据库优先。

我使用的是 EF 6.1.1。是的,错误表明它正在尝试查找 EF 6.0.0.0,但我认为这没关系(??)。你确定吗?我使用了 NuGet 并卸载了 EF,重新安装了 EF,清理了解决方案,重新构建并发布。我希望这能解决 app 和 web.config 文件中的引用问题。它仍然在 .config 文件中保留 EF6.0.0.0 引用,并且我得到了汇编错误。

在 EF .dll 的属性中,我设置了 copy=true。因此,它应该将 entityframework.dll 复制到 bin 文件夹中。我看到的是一堆 xxxx.dll.deploy 文件。我相信,这符合操作系统 mime 类型是可以的。当用户访问该站点时,该应用程序将下载并自动将 .dll.deploy 转换为 .dll。

我使用加载到客户端 ie11 浏览器中的测试证书签署了我的解决方案。

我有 3 个环境:

  • 开发平台(带 vs 调试的笔记本电脑),
  • win 2003 登台服务器(最终也将是 2012 年),
  • 赢得 2012 年生产服务器。

该项目的工作方式如下:

  1. 用户输入网站的网址:
    http://www.xxxxxxxx.com/yyyyyyyyy.xbap
  2. 用户会看到一个登录页面。
  3. 用户输入凭据。 WCF 项目验证凭据 反对数据库。
  4. 现在向用户显示带有菜单的主屏幕
  5. 如果用户点击任何进入数据库的菜单,我会得到一个 错误“无法加载程序集实体框架”(更多详细信息 下面)。

该解决方案适用于调试环境。没有错误。 当我从 LAN 访问 xbap 应用程序时,该解决方案也适用于登台和生产环境。 当我尝试从 Internet 访问暂存或生产环境时,我收到以下错误:

---------------- IE 中的错误消息 --------------- ----------------------

Startup URI: http://www.xxxxxxxx.com/yyyyyyyyy.xbap
Application Identity: http://www.xxxxxxxx.com/yyyyyyyyy.xbap#yyyyyyyyy.xbap, Version=1.0.0.118, Culture=neutral, PublicKeyToken=ssssssssssssssssss, 
processorArchitecture=msil/yyyyyyyyy.exe, Version=1.0.0.118, Culture=neutral, PublicKeyToken=ssssssssssssssssss, processorArchitecture=msil, type=win32
System.Runtime.Serialization.SerializationException: Unable to find assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
   at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, 
Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, 
IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, 
IMethodCallMessage methodCallMessage)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
   at System.AppDomain.Deserialize(Byte[] blob)
   at System.AppDomain.UnmarshalObject(Byte[] blob)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.StartDispatcherInBrowser(Object unused)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
-----------------------
PresentationHost.exe v4.0.31106.0 built by: Main - C:\Windows\SysWOW64\PresentationHost.exe
ntdll.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\ntdll.dll
kernel32.dll v6.1.7601.18015 (win7sp1_gdr.121129-1432) - C:\Windows\syswow64\kernel32.dll
KERNELBASE.dll v6.1.7601.18015 (win7sp1_gdr.121129-1432) - C:\Windows\syswow64\KERNELBASE.dll
SYSFER.DLL v12.1.4013.4013 - C:\Windows\SysWOW64\SYSFER.DLL
ADVAPI32.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\ADVAPI32.dll
msvcrt.dll v7.0.7601.17744 (win7sp1_gdr.111215-1535) - C:\Windows\syswow64\msvcrt.dll
sechost.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\sechost.dll
RPCRT4.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\RPCRT4.dll
SspiCli.dll v6.1.7601.18496 (win7sp1_gdr.140605-0343) - C:\Windows\syswow64\SspiCli.dll
CRYPTBASE.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\CRYPTBASE.dll
USER32.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\syswow64\USER32.dll
GDI32.dll v6.1.7601.18275 (win7sp1_gdr.131002-1533) - C:\Windows\syswow64\GDI32.dll
LPK.dll v6.1.7601.18177 (win7sp1_gdr.130605-1534) - C:\Windows\syswow64\LPK.dll
USP10.dll v1.0626.7601.18454 (win7sp1_gdr.140424-1533) - C:\Windows\syswow64\USP10.dll
ole32.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\ole32.dll
OLEAUT32.dll v6.1.7601.17676 - C:\Windows\syswow64\OLEAUT32.dll
mscoree.dll v4.0.40305.0 (Main.040305-0000) - C:\Windows\SysWOW64\mscoree.dll
SHLWAPI.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\SHLWAPI.dll
WININET.dll v11.00.9600.16428 (winblue_gdr.131013-1700) - C:\Windows\syswow64\WININET.dll
api-ms-win-downlevel-user32-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\syswow64\api-ms-win-downlevel-user32-l1-1-0.dll
api-ms-win-downlevel-shlwapi-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\syswow64\api-ms-win-downlevel-shlwapi-l1-1-0.dll
api-ms-win-downlevel-version-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\syswow64\api-ms-win-downlevel-version-l1-1-0.dll
version.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\version.DLL
api-ms-win-downlevel-normaliz-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\syswow64\api-ms-win-downlevel-normaliz-l1-1-0.dll
normaliz.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\normaliz.DLL
iertutil.dll v11.00.9600.17207 (winblue_gdr_escrow.140618-1157) - C:\Windows\syswow64\iertutil.dll
api-ms-win-downlevel-advapi32-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\syswow64\api-ms-win-downlevel-advapi32-l1-1-0.dll
USERENV.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\USERENV.dll
profapi.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\profapi.dll
urlmon.dll v11.00.9600.17207 (winblue_gdr_escrow.140618-1157) - C:\Windows\syswow64\urlmon.dll
api-ms-win-downlevel-ole32-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\syswow64\api-ms-win-downlevel-ole32-l1-1-0.dll
SHELL32.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\syswow64\SHELL32.dll
IMM32.DLL v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\system32\IMM32.DLL
MSCTF.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\MSCTF.dll
PresentationHost_v0400.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationHost_v0400.dll
MSVCR110_CLR0400.dll v11.00.50938.18408 built by: FX451RTMGREL - C:\Windows\SysWOW64\MSVCR110_CLR0400.dll
PSAPI.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\PSAPI.DLL
CLBCatQ.DLL v2001.12.8530.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\CLBCatQ.DLL
CRYPTSP.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\CRYPTSP.dll
rsaenh.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\system32\rsaenh.dll
RpcRtRemote.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\RpcRtRemote.dll
ieproxy.dll v11.00.9600.17207 (winblue_gdr_escrow.140618-1157) - C:\Program Files (x86)\Internet Explorer\ieproxy.dll
api-ms-win-downlevel-shlwapi-l2-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\system32\api-ms-win-downlevel-shlwapi-l2-1-0.dll
Secur32.dll v6.1.7601.18496 (win7sp1_gdr.140605-0343) - C:\Windows\SysWOW64\Secur32.dll
api-ms-win-downlevel-advapi32-l2-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\SysWOW64\api-ms-win-downlevel-advapi32-l2-1-0.dll
WS2_32.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\WS2_32.dll
NSI.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\syswow64\NSI.dll
mswsock.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\system32\mswsock.dll
wship6.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\System32\wship6.dll
IPHLPAPI.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\IPHLPAPI.DLL
WINNSI.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\WINNSI.DLL
DNSAPI.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\DNSAPI.dll
dhcpcsvc6.DLL v6.1.7601.17970 (win7sp1_gdr.121009-0412) - C:\Windows\SysWOW64\dhcpcsvc6.DLL
dhcpcsvc.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\dhcpcsvc.DLL
wshtcpip.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\System32\wshtcpip.dll
netprofm.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\System32\netprofm.dll
nlaapi.dll v6.1.7601.17761 (win7sp1_gdr.120112-1636) - C:\Windows\System32\nlaapi.dll
rasadhlp.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\rasadhlp.dll
fwpuclnt.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\System32\fwpuclnt.dll
npmproxy.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\System32\npmproxy.dll
Comctl32.dll v6.10 (win7_rtm.090713-1255) - C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\Comctl32.dll
dfshim.dll v4.0.41209.0 (Main.041209-0000) - C:\Windows\SysWOW64\dfshim.dll
mscoreei.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
clr.dll v4.0.30319.18444 built by: FX451RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
msxml3.dll v8.110.7601.18431 - C:\Windows\System32\msxml3.dll
SXS.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\SXS.DLL
PresentationHostProxy.dll v4.0.40305.0 built by: Main - C:\Windows\SysWOW64\PresentationHostProxy.dll
mshtml.dll v11.00.9600.17207 (winblue_gdr_escrow.140618-1157) - C:\Windows\SysWOW64\mshtml.dll
UxTheme.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\UxTheme.dll
msimtf.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\system32\msimtf.dll
msls31.dll v3.10.349.0 - C:\Windows\SysWOW64\msls31.dll
d2d1.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\SysWOW64\d2d1.dll
DWrite.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\SysWOW64\DWrite.dll
dxgi.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\SysWOW64\dxgi.dll
dwmapi.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\dwmapi.dll
WINTRUST.dll v6.1.7601.18205 (win7sp1_gdr.130708-1532) - C:\Windows\syswow64\WINTRUST.dll
CRYPT32.dll v6.1.7601.18277 (win7sp1_gdr.131005-0934) - C:\Windows\syswow64\CRYPT32.dll
MSASN1.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\syswow64\MSASN1.dll
d3d11.dll v6.2.9200.16570 (win8_gdr.130327-1526) - C:\Windows\SysWOW64\d3d11.dll
IEFRAME.dll v11.00.9600.17207 (winblue_gdr_escrow.140618-1157) - C:\Windows\SysWOW64\IEFRAME.dll
api-ms-win-downlevel-shell32-l1-1-0.dll v6.2.9200.16492 (win8_gdr_oobssr.130113-0015) - C:\Windows\SysWOW64\api-ms-win-downlevel-shell32-l1-1-0.dll
uiautomationcore.dll v7.0.0.0 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\uiautomationcore.dll
OLEACC.dll v7.0.0.0 (win7sp1_gdr.110826-1504) - C:\Windows\SysWOW64\OLEACC.dll
jscript9.dll v11.00.9600.17207 (winblue_gdr_escrow.140618-1157) - C:\Windows\SysWOW64\jscript9.dll
windowscodecs.dll v6.2.9200.16809 (win8_gdr.140127-1505) - C:\Windows\system32\windowscodecs.dll
mlang.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\system32\mlang.dll
mscorlib.ni.dll v4.0.30319.18444 built by: FX451RTMGDR - C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\ce5f61c5754789df97be8dc991c47d07\mscorlib.ni.dll
nlssorting.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\nlssorting.dll
System.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System\ff26cc03e6d57d8abd13b990332e67c6\System.ni.dll
WindowsBase.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsBase\acf97bfe2a931d4a47253b26b7218991\WindowsBase.ni.dll
PresentationCore.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\PresentationCore
\a74542efbeb46445949a39026c501132\PresentationCore.ni.dll
PresentationFramework.ni.dll v4.0.30319.18408 - C:\Windows\assembly\NativeImages_v4.0.30319_32\Presentatio5ae0f00f#\a4b45c44490c75bc2fb22780e7ef087d
\PresentationFramework.ni.dll
wpfgfx_v0400.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\wpfgfx_v0400.dll
PresentationNative_v0400.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF\PresentationNative_v0400.dll
System.Xaml.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xaml\3fe705796c6a41d4889d9001d1c56af8\System.Xaml.ni.dll
clrjit.dll v4.0.30319.18444 built by: FX451RTMGDR - C:\Windows\Microsoft.NET\Framework\v4.0.30319\clrjit.dll
System.Xml.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml\bada32953bb6b16a53d653eae23d78dc\System.Xml.ni.dll
PresentationFramework.classic.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\Presentatiod51afaa5#
\edec2d7b3ecaabfc5c72d7615d884f79\PresentationFramework.classic.ni.dll
d3d9.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\d3d9.dll
d3d8thk.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\d3d8thk.dll
System.Configuration.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Configuration\bbc48ec4245e502ae19b0601d3799c9e
\System.Configuration.ni.dll
WtsApi32.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\WtsApi32.dll
WINSTA.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\WINSTA.dll
PresentationFramework-SystemXml.ni.dll v4.0.30319.18408 - C:\Windows\assembly\NativeImages_v4.0.30319_32\Presentatio49d6fefe#
\47e7fc401facd4a5d3f2237f16948f36\PresentationFramework-SystemXml.ni.dll
msctfui.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\system32\msctfui.dll
UIAutomationTypes.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\UIAutomationTypes
\75b6a68103e1b76063d9f69b8275ae61\UIAutomationTypes.ni.dll
WINMM.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\WINMM.dll
System.Core.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Core\dce99d8de14d8a015313db98c72552ee\System.Core.ni.dll
System.ServiceModel.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.ServiceModel
\24bf0c88c0465485f4b842df043b3f45\System.ServiceModel.ni.dll
SMDiagnostics.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\SMDiagnostics
\78652b7fa68ee058bff6a118c657f565\SMDiagnostics.ni.dll
System.Runtime.Serialization.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Runteb92aa12#
\f6d7bb59f318c130d68816a89335d05e\System.Runtime.Serialization.ni.dll
System.ServiceModel.Internals.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Servd1dec626#
\34b53ecafa1d7ccc7ca961d722b5d983\System.ServiceModel.Internals.ni.dll
System.Transactions.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Transactions
\2053b0e14f1e64a5c5d6d1c4d01485a2\System.Transactions.ni.dll
System.Transactions.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.Net\assembly\GAC_32\System.Transactions
\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll
System.IdentityModel.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.IdentityModel\1e5e19d119e04b93da3d45153abd60fd
\System.IdentityModel.ni.dll
rasapi32.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\rasapi32.dll
rasman.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\rasman.dll
rtutils.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\rtutils.dll
winhttp.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\winhttp.dll
webio.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\webio.dll
credssp.dll v6.1.7601.18489 (win7sp1_gdr.140529-2100) - C:\Windows\SysWOW64\credssp.dll
CFGMGR32.dll v6.1.7601.17621 (win7sp1_gdr.110523-2108) - C:\Windows\syswow64\CFGMGR32.dll
System.Net.Http.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Net.Http
\d7a1bbd56dc15a29c2450b177f9468d7\System.Net.Http.ni.dll
System.Data.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Data\6bbed231aec6fd82547e09474da0b2f9\System.Data.ni.dll
System.Data.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll
MMDevAPI.DLL v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\MMDevAPI.DLL
PROPSYS.dll v7.00.7600.16385 (win7_rtm.090713-1255) - C:\Windows\SysWOW64\PROPSYS.dll
actxprxy.dll v6.1.7601.17514 (win7sp1_rtm.101119-1850) - C:\Windows\SysWOW64\actxprxy.dll
UIAutomationProvider.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\UIAutomationProvider
\c94c36c9ae776de930f2aacb6dd51c38\UIAutomationProvider.ni.dll
System.Numerics.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Numerics
\4c8a153aa66fcd62db6fff269a2ef2b4\System.Numerics.ni.dll
System.Data.OracleClient.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Data86569bbf#
\42e4e0c2624e0f686d87fa4011455fac\System.Data.OracleClient.ni.dll
System.Data.OracleClient.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.Net\assembly\GAC_32\System.Data.OracleClient
\v4.0_4.0.0.0__b77a5c561934e089\System.Data.OracleClient.dll
WindowsFormsIntegration.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\WindowsForm0b574481#
\1ab52f8951c2ab97592ec25830dd5165\WindowsFormsIntegration.ni.dll
System.Xml.Linq.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Xml.Linq
\b6c7a1ca929c1b10f36b683c9f1a0517\System.Xml.Linq.ni.dll
System.EnterpriseServices.ni.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Ente96d83b35#
\ee550c3d485d44c7fbeeafe12a3e318b\System.EnterpriseServices.ni.dll
System.EnterpriseServices.Wrapper.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Ente96d83b35#
\ee550c3d485d44c7fbeeafe12a3e318b\System.EnterpriseServices.Wrapper.dll
System.EnterpriseServices.Wrapper.dll v4.0.30319.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices
\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll
security.dll v6.1.7600.16385 (win7_rtm.090713-1255) - C:\Windows\system32\security.dll
schannel.dll v6.1.7601.18489 (win7sp1_gdr.140529-2100) - C:\Windows\SysWOW64\schannel.dll
diasymreader.dll v11.0.50938.18408 built by: FX451RTMGREL - C:\Windows\Microsoft.NET\Framework\v4.0.30319\diasymreader.dll

*

感谢您对此的帮助。如果您需要更多信息,请告诉我。我希望其他人在 clickonce 部署或 xbap 中看到了这个问题

发展。

【问题讨论】:

  • Clickonce over internet only runs on internet zone trust。要运行实体框架,您需要 ADO.Net。 ADO.Net 不在 Internet 区域信任下运行。
  • 谢谢你,阿伦。我创建了一个测试证书并将其安装在受信任的发布者和受信任的根目录下的客户端 Internet Explorer 中。我在 IE/工具/Internet 选项/安全的受信任站点中也有该站点。你说这还不够吗?您能否详细说明“您需要 ADO.Net”的含义?我需要做什么才能将其添加到我的项目中。谢谢
  • 如果没有记错的话,XBAP 会在 IE 的沙箱中运行,并且可以访问一组受限的 .net 框架。您不能使用的组件之一是 ADO.Net,它是 Entity Framework 的先决条件。这是有道理的,因为 ADO.Net 存在于 .net 服务器端扩展中,而 XBAP 用于客户端应用程序。这强制要求您编写用于数据访问的服务器的最佳实践。
  • @Aron 我已经成功地在本地运行了我自己的 xbap 浏览器,但我现在在客户端上遇到了同样的错误。我怀疑是沙盒做的,因为即使在本地它也会在同一个沙盒中运行。我也遇到过信任问题,但实际上,就像 mtdscomm 一样,我用证书解决了这些问题。
  • 可能是您的 XBAP 清单中没有 EF。还要检查您的目标计算机是否安装了完整的 .net 框架,而不仅仅是“客户端配置文件”。

标签: clickonce entity-framework-6 publishing xbap


【解决方案1】:

这是一个迟到的答案,但在搁置了一段时间后,我发现了一种解决错误的方法(至少在我的情况下)。

最大的问题是错误信息与实际错误无关

由于错误消息让我在所有错误的地方追鬼,我花了很长时间才看到明显的:我使用了错误的连接字符串

是的,愚蠢的初学者错误,但在开发过程中,我的 xbap 引用了 localhost - 因为我的开发数据库驻留在我自己的机器上,所以效果很好。部署的版本在服务器上也能正常工作 - 再次,因为那里有一个 SQL 服务器实例。

但是,当任何客户端尝试运行 xbap 时,它当然会在本地运行,并且根本找不到数据库。

在一个美好的世界里,这会导致一条错误消息说“找不到数据库”或“无法连接到数据库”,对吧?这个世界没那么美好。

使用更改后的虚拟连接字符串在本地运行我的 xbap(它运行时没有问题)使我能够重现错误。

所以,答案似乎是:检查并仔细检查您的连接字符串

至于 cmets 中提到的一些关于 EF 不可能与 WPF 一起使用的观点 - 它确实有效。它工作得很好。

【讨论】:

  • 非常感谢。在遇到此问题之前,我对依赖项引用进行了三次检查。
【解决方案2】:

在我的情况下,启动 IE 所依据的域用户帐户在 DB 上没有适当的权限...

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多