2

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

Scott
  • 21,211
  • 8
  • 65
  • 72
Terry Wells
  • 73
  • 1
  • 5
  • Did you look at [this recent question](http://stackoverflow.com/q/20926645/795339)? Looks very similar. – Mike Mertsock Jan 08 '14 at 14:17
  • Indeed I did, but as Scott comments - That poster didn't provide all the information - the guy with the issue, just rolled back to version 3. Which I know works, but would like to progress using version 4 - hence I hopefully provided a little more info. – Terry Wells Jan 08 '14 at 18:26
  • @TerryWells How do you include the Telerik OpenAccess ORM data context? – Scott Jan 09 '14 at 10:22
  • @TerryWells I raised your issue with the ServiceStack team and they have [created a commit](https://github.com/ServiceStack/ServiceStack/commit/da61a80a31fcb033b276ff1a1ae2d8f366a3573e) so the warning will be logged, instead of throwing an exception, it should output the problem filepath, and still allow the application to continue. So it should be possible to diagnose the issue better. But you'll have to wait for the next release of ServiceStack to see this fix. – Scott Jan 09 '14 at 10:51
  • Thanks Scott - I just add the domain context via the Telerik Menu within Visual Studio, I have tried using Entity Framework to try and rule out Telerik, and the same error occurs with EF. I'll await the release. Thanks again. Terry – Terry Wells Jan 09 '14 at 13:38
  • @TerryWells Just to let you know the ServiceStack 4.06 has been released today. So you should get a warning now instead of an exception and it should log the path it's trying to load. If you could report back that would be great. Cheers. – Scott Jan 13 '14 at 18:45
  • Thanks Scott - Interestingly I did upload the 4.06 version, and everything is working fine no-warnings that I can see! – Terry Wells Jan 14 '14 at 17:23
  • @TerryWells I have posted that this was resolved by upgrading to 4.06. I am trying to close off open questions. If you could accept the answer, that would be great. – Scott May 10 '14 at 09:43

0 Answers0