Skip to content
This repository was archived by the owner on Dec 8, 2018. It is now read-only.

IApplicationBuilder claims it is defined in 'Microsoft.AspNet.Http' #138

Closed
rkeithhill opened this issue May 29, 2015 · 8 comments
Closed

Comments

@rkeithhill
Copy link

I have been working on porting an ASP.NET MVC 4 site to ASP.NET 5. I first got it working on dnx451 and then today on dnxcore50 (1.0.0-beta4). Yay! However when I set the project properties to target 1.0.0-beta5-11911 and run the web site I get an ArgumentNullException:

>   Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.FileFormatException.WithLineInfo(Microsoft.Framework.Runtime.Json.JsonValue value)  Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DependencyManagement.LockFileReader.ReadString(Microsoft.Framework.Runtime.Json.JsonValue json) Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DependencyManagement.LockFileReader.ReadLibrary(string property, Microsoft.Framework.Runtime.Json.JsonValue json)   Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DependencyManagement.LockFileReader.ReadObject<Microsoft.Framework.Runtime.DependencyManagement.LockFileLibrary>(Microsoft.Framework.Runtime.Json.JsonObject json, System.Func<string, Microsoft.Framework.Runtime.Json.JsonValue, Microsoft.Framework.Runtime.DependencyManagement.LockFileLibrary> readItem)  Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DependencyManagement.LockFileReader.ReadLockFile(Microsoft.Framework.Runtime.Json.JsonObject cursor)    Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DependencyManagement.LockFileReader.Read(System.IO.Stream stream)   Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DependencyManagement.LockFileReader.Read(string filePath)   Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.ApplicationHostContext.ApplicationHostContext(System.IServiceProvider serviceProvider, string projectDirectory, string packagesDirectory, string configuration, System.Runtime.Versioning.FrameworkName targetFramework, Microsoft.Framework.Runtime.Caching.ICache cache, Microsoft.Framework.Runtime.Caching.ICacheContextAccessor cacheContextAccessor, Microsoft.Framework.Runtime.Caching.INamedCacheDependencyProvider namedCacheDependencyProvider, Microsoft.Framework.Runtime.IAssemblyLoadContextFactory loadContextFactory, bool skipLockFileValidation) Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DefaultHost.Initialize(Microsoft.Framework.Runtime.DefaultHostOptions options, System.IServiceProvider hostServices)    Unknown
    Microsoft.Framework.Runtime.dll!Microsoft.Framework.Runtime.DefaultHost.DefaultHost(Microsoft.Framework.Runtime.DefaultHostOptions options, System.IServiceProvider hostServices)   Unknown
    Microsoft.Framework.ApplicationHost.dll!Microsoft.Framework.ApplicationHost.Program.Main(string[] args) Unknown
    [Native to Managed Transition]  
    [Managed to Native Transition]  
    dnx.host.dll!Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute(System.Reflection.Assembly assembly, string[] args, System.IServiceProvider serviceProvider) Unknown
    dnx.host.dll!dnx.host.Bootstrapper.RunAsync(System.Collections.Generic.List<string> args, Microsoft.Framework.Runtime.IRuntimeEnvironment env)  Unknown
    dnx.host.dll!dnx.host.RuntimeBootstrapper.ExecuteAsync(string[] args)   Unknown
    dnx.host.dll!dnx.host.RuntimeBootstrapper.Execute(string[] args)    Unknown
    dnx.coreclr.managed.dll!DomainManager.Execute(int argc, char** argv)    Unknown

So I figure perhaps I need to ensure that I'm getting newer assemblies. So in my project.json file I changed the dependencies package versions from x.0.0-beta4 to x.0.0-*. That gave me a few compile errors (Session state API change SetInt to SetInt32) which I fixed but I'm stuck on this cryptic error:

Severity    Code    Description Project File    Line
Error   CS7069  Reference to type 'IApplicationBuilder' claims it is defined in 'Microsoft.AspNet.Http', but it could not be found  WebSiteDnxcore.DNX Core 5.0 C:\Tfs\Cdf\Branches\Feature\LxiWebSiteOnAspNet5\Samples\Source\WebSiteDnxcore\src\WebSiteDnxcore\Startup.cs 64

Is this a bug or am I doing something wrong?

@rkeithhill
Copy link
Author

Oops. Just realized I was in Diagnostics when I thought I was in Aspnet\Home. Sorry about that.

@davidfowl
Copy link
Member

@rkeithhill First thing, when you run into issues like these, plese file them on aspnet/Home. This repository has nothing to do with the errors you're running into.

Second thing, if you're going to use -*, then you should keep watching the https://github.com/aspnet/Announcements/issues for updates on breaking changes and how to fix them in your applicaiton.

@rkeithhill
Copy link
Author

@davidfowl Yeah, sorry about the wrong location and thanks for the pointer to the announcements.

Is there a better way to specify package versions? My ultimate goal is to get the site running on Ubuntu but there is no dnx-coreclr-linux-x64-1.0.0-beta4 package AFAICT. So I'm riding the bleeding edge of dev builds to see if I can get this demo going before a big internal review of our future development processes i.e. do we continue to use ASP.NET or move to PHP as we migrate to Linux for our embedded devices.

@davidfowl
Copy link
Member

coreclr on linux is currently broken but we're working on fixing it.

@davidfowl
Copy link
Member

@rkeithhill
Copy link
Author

@davidfowl Heheh, I was just looking at #14. Thanks for the pointer to #11 and also for the heads up on the state of coreclr on Linux. Been banging my head on this most of the day. I guess this is as good an excuse as any to call it a day. Thanks again.

@rkeithhill
Copy link
Author

BTW in my case, commenting out app.UseBrowserLink(); eliminated the build errors but that gets me back to the ArgumentNullException at startup (apparently while reading the lock file).

@davidfowl
Copy link
Member

@rkeithhill it might be more efficient to come to https://jabbr.net/#/rooms/AspNetvNext

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants