Virtual file not found using servicestack 4.0.5 after adding Telerik OpenAccess datacontext

白昼怎懂夜的黑 提交于 2019-12-11 00:58:34

问题


I'm testing out the new 4.0.5 Service stack (previously I was using version 3), and starting afresh I just can't seem to get my service to start when I add Telerik OpenAccess. I'm using Telerik's OpenAccess to talk to a MSSQL database again, which all works fine using version 3.x - As soon as I add in the Telerik Domain model I get a "Virtual File Not Found"

Virtual file not found
Description: An unhandled exception occurred during the execution of the current web request.
Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Virtual file not found
Source Error:

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

Here is the full IIS error screen

Source File: c:\users\tw\documents\visual studio 2013\Projects\VPN_ApiTest\VPN_ApiTest\Global.asax.vb Line: 25

Stack Trace:

[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

Can anybody point me in the right direction?

Many thanks

Terry

来源:https://stackoverflow.com/questions/20996763/virtual-file-not-found-using-servicestack-4-0-5-after-adding-telerik-openaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!