2

I have an old ASP.NET project, which I just upgraded from .NET 3.5 and ServiceStack to .NET 4.0 and ServiceStack 4.0.5.

However, I get a strange error while starting. This exception is not the first one in ServiceStack, there is an null pointer exception earlier that is caught. Any ideas?

The only previous question I see about is this, which talks about F#. I have an F# dll, but that one is not used in the startup.

Server Error in '/' Application.

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 107:     // Log.log(">>> Application_Start");
Line 108:
Line 109:     new SssAppHost().Init();
Line 110:            
Line 111:     // 20090928: This is to force static code in JobScheduler to run

Source File:  c:\data3\ssc\ssc\sss4\sss3\Global.asax.cs    Line:  109 

Stack Trace:    
[FileNotFoundException: Virtual file not found]
   ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualFile(String resourceName) +185
   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
   ServiceStack.VirtualPath.ResourceVirtualDirectory.InitializeDirectoryStructure(IEnumerable`1 manifestResourceNames) +432
   ServiceStack.VirtualPath.ResourceVirtualDirectory..ctor(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm, String directoryName, IEnumerable`1 manifestResourceNames) +88
   ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualDirectory(IGrouping`2 subResources) +134
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
   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
   ServiceStack.VirtualPath.ResourceVirtualDirectory.InitializeDirectoryStructure(IEnumerable`1 manifestResourceNames) +704
   ServiceStack.VirtualPath.ResourceVirtualDirectory..ctor(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm, String directoryName, IEnumerable`1 manifestResourceNames) +88
   ServiceStack.VirtualPath.ResourceVirtualDirectory.CreateVirtualDirectory(IGrouping`2 subResources) +134
   System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
   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
   ServiceStack.VirtualPath.ResourceVirtualDirectory.InitializeDirectoryStructure(IEnumerable`1 manifestResourceNames) +704
   ServiceStack.VirtualPath.ResourceVirtualDirectory..ctor(IVirtualPathProvider owningProvider, IVirtualDirectory parentDir, Assembly backingAsm, String directoryName, IEnumerable`1 manifestResourceNames) +88
   ServiceStack.VirtualPath.ResourceVirtualPathProvider.Initialize() +88
   ServiceStack.VirtualPath.ResourceVirtualPathProvider..ctor(IAppHost appHost, Assembly backingAssembly) +47
   ServiceStack.ServiceStackHost.<Init>b__4(Assembly x) +29
   ServiceStack.EnumerableExtensions.Map(IEnumerable`1 items, Func`2 converter) +229
   ServiceStack.ServiceStackHost.Init() +339
   sss2.Global.Application_Start(Object sender, EventArgs e) in c:\data3\ssc\ssc\sss4\sss3\Global.asax.cs:109

[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

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
Community
  • 1
  • 1
mattias
  • 870
  • 5
  • 18
  • It does look like an issue with the new Virtual File System. You said there was another exception thrown before this one, a `NullPointerException` ... Is it from ServiceStack? If so it would be handy to see it, it may be related. Can you also post your AppHost so we can see how you are configuring the host? – Scott Jan 04 '14 at 21:14
  • Yes, it was a null-pointer from ServiceStack, but it was catched. When I used 3.9, I used to have the ServiceStack source projects as part of my larger application, and then stuff like this was easy to debug and fix. However, this was messy to maintain and update when new SS updates appeared in the GitHub. Any pointers on how to easily set this up? – mattias Jan 05 '14 at 08:16
  • You can ignore this problem for now. I have decided to continue to use .NET 3.5. The project contains a lot of old ASP.NET pages, many from 2003, and there are many incompabilities. I will redo the upgrade to 4.0, once those pages are replaced by more modern ones, most likely ServiceStack + AngularJS. – mattias Jan 05 '14 at 09:43
  • My advise is to read the [Release Notes](https://github.com/ServiceStack/ServiceStack/wiki/Release-Notes) a number of times very carefully. As recommended use a tool like Resharper. Don't catch exceptions and assume because the service continues on it's OK. The exception you caught could be important, but we don't know. You should post your AppHost config as I suggested, it's the only way to know what ServiceStack is trying to do when it loads your service. – Scott Jan 05 '14 at 09:44
  • Yes I think doing the upgrade of technology in stages is a smarter approach you are trying to do a lot. I.e. going from 3.5 to 4 and change to ServiceStack 4 on a large project isn't without difficulties. I would recommend you **delete this question**, and re-ask it if you find you have difficulties after you sort your ASP.NET pages out. – Scott Jan 05 '14 at 09:46
  • Do not really understand why I should delete it, maybe someone else will get the problem. Or should I make is bug report in SS GitHub? Getting an exception without any useful information can always be improved. The bug has nothing to do with the .NET 4.0, since all the remaining code works - except for known strangeness in ASP.NET 4.0 - when I disable the Init-call. – mattias Jan 05 '14 at 14:33
  • Regarding the catched null-pointer, this is catched inside SS, so maybe not a bug at all. That is why I asked about tips on using the source instead. – mattias Jan 05 '14 at 14:35
  • 1
    It's up to you. I recommended you delete it because you said `ignore this problem for now`, because you were going to try to resolve the issue by ultimately taking another path. If somebody else has the same issue, they will come to your question find the same exception, and see it is still an open and unanswered question, and that you had given up - and continued using .NET 3.5. Ultimately not relevant to them. Had you posted the AppHost configuration and more relevant information it may have been possible to answer the question. – Scott Jan 05 '14 at 14:53
  • Thank you Scott for you help. I really appreciate it. – mattias Jan 06 '14 at 13:45
  • No problem, I hope you get it working. – Scott Jan 06 '14 at 13:46
  • Mattias, I have tried to raise you issue with the ServiceStack team, as another person is experiencing a similar issue. We are trying to establish if your issues are related to resolve the problem. Do you use Telerik Open Access ORM? Can you please post your AppHost config. – Scott Jan 09 '14 at 10:20
  • If you could provide your config [like the answer here](http://stackoverflow.com/questions/20996763/virtual-file-not-found-using-servicestack-4-0-5-after-adding-telerik-openaccess) has done that would be great. – Scott Jan 09 '14 at 10:26
  • Mattias, The ServiceStack team 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:52
  • Thank you. I will try later again. The AppHost is really minimum, the 3.9 version is like this: public class SssAppHost : AppHostBase { public SssAppHost() : base("SSS3", typeof(Atom10).Assembly) {} public override void Configure(Funq.Container container) { ServiceStack.Text.JsConfig.DateHandler = ServiceStack.Text.JsonDateHandler.ISO8601; Plugins.Add(new ValidationFeature()); container.RegisterValidators(typeof(DeleteInstance).Assembly); } } – mattias Jan 12 '14 at 17:52

0 Answers0