添加Telerik OpenAccess datacontext后,使用servicestack 4.0.5找不到虚拟文件

时间:2014-01-08 13:15:59

标签: servicestack telerik-open-access

我正在测试新的4.0.5服务堆栈(之前我使用的是版本3),重新启动我似乎无法在添加Telerik OpenAccess时启动我的服务。 我正在使用Telerik的OpenAccess再次与MSSQL数据库通信,使用版本3.x一切正常 - 只要我在Telerik域模型中添加“未找到虚拟文件”

  

未找到虚拟文件
  说明:在执行当前Web请求期间发生了未处理的异常。
请查看堆栈跟踪以获取有关错误及其在代码中的起源位置的更多信息。

     

异常详细信息:System.IO.FileNotFoundException:找不到虚拟文件
  来源错误:

     

第23行:' Fires when the application is started
  第24行:Dim apphost = New VPNTestAppHost()
  第25行:apphost.Init()
  第26行:End Sub

这是完整的IIS错误屏幕

  

源文件:c:\ users \ tw \ documents \ visual studio 2013 \ Projects \ VPN_ApiTest \ VPN_ApiTest \ Global.asax.vb Line:25

堆栈追踪:

[FileNotFoundException: Virtual file not found]
   ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualFile(String resourceName) +303
   System.Linq.WhereSelectListIterator`2.MoveNext() +108
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +216
   System.Linq.<GetEnumerator>d__0.MoveNext() +106
   System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection) +392
   System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection) +10
   ServiceStack.VirtualPath.ResourceVirtualDirectory.InitializeDirectoryStructure(IEnumerable`1 manifestResourceNames) +593
   ServiceStack.VirtualPath.ResourceVirtualDirectory..ctor(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm, String directoryName, IEnumerable`1 manifestResourceNames) +227
   ServiceStack.VirtualPath.ResourceVirtualDirectory..ctor(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm) +131
   ServiceStack.VirtualPath.ResourceVirtualPathProvider.Initialize() +141
   ServiceStack.VirtualPath.ResourceVirtualPathProvider..ctor(IAppHost appHost, Assembly backingAssembly) +138
   ServiceStack.ServiceStackHost.<Init>b__4(Assembly x) +58
   ServiceStack.EnumerableExtensions.Map(IEnumerable`1 items, Func`2 converter) +337
   ServiceStack.ServiceStackHost.Init() +778
   VPN_ApiTest.Global_asax.Application_Start(Object sender, EventArgs e) in c:\users\tw\documents\visual studio 2013\Projects\VPN_ApiTest\VPN_ApiTest\Global.asax.vb:25

[HttpException (0x80004005): Virtual file not found]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9935033
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Virtual file not found]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9913572
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

WEB.CONFIG

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
    <httpRuntime requestPathInvalidCharacters="" targetFramework="4.5" />
  </system.web>
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <handlers>
      <add path="*" name="ServiceStack.Factory" type="ServiceStack.HttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
    </handlers>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Headers" value="Content-Type, Accept" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
  <connectionStrings>
    <add name="XYZ" connectionString="data source=abc.xyz.com;initial catalog=xyz;persist security info=True;user id=sa;password=abc" providerName="System.Data.SqlClient" />
  </connectionStrings>
</configuration>

Global.asax中

Imports System.Web.SessionState
Imports ServiceStack
Imports ServiceStack.Auth

Public Class Global_asax
    Inherits System.Web.HttpApplication

    Public Class VPNTestAppHost
        Inherits AppHostBase

        Public Sub New()
            MyBase.New("VPN Test Web Services", GetType(LanguageLibrary).Assembly)
        End Sub

        Public Overrides Sub Configure(container As Funq.Container)
            SetConfig(New HostConfig With {.DebugMode = True})
            Plugins.Add(New AuthFeature(Function() New AuthUserSession(), New Auth.IAuthProvider() {New BasicAuthProvider()}))
        End Sub
    End Class

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the application is started
        Dim apphost = New VPNTestAppHost()
        apphost.Init()
    End Sub

有人能指出我正确的方向吗?

非常感谢

特里

0 个答案:

没有答案