Skip to content
This repository was archived by the owner on Feb 13, 2019. It is now read-only.

ASP.NET Web App Template with Authentication for Beta5 #191

Closed
rustd opened this issue Jun 18, 2015 · 7 comments
Closed

ASP.NET Web App Template with Authentication for Beta5 #191

rustd opened this issue Jun 18, 2015 · 7 comments

Comments

@rustd
Copy link

rustd commented Jun 18, 2015

https://onedrive.live.com/redir?resid=43459A6389A804D9!94678&authkey=!AJvRGFbf3ebk55I&ithint=file%2czip

@sayedihashimi
Copy link
Member

I tried the content that you provided, after removing browser link I am getting the following error.

ayeds-MacBook-Pro:WebApplication_IndividualAuth sayedhashimi$ dnx . kestrel
System.TypeInitializationException: An exception was thrown by the type initializer for HttpApi ---> System.DllNotFoundException: httpapi.dll
  at (wrapper managed-to-native) Microsoft.Net.Http.Server.UnsafeNclNativeMethods/HttpApi:HttpInitialize (Microsoft.Net.Http.Server.UnsafeNclNativeMethods/HttpApi/HTTPAPI_VERSION,uint,void*)
  at Microsoft.Net.Http.Server.UnsafeNclNativeMethods+HttpApi.InitHttpApi (UInt16 majorVersion, UInt16 minorVersion) [0x00000] in <filename unknown>:0
  at Microsoft.Net.Http.Server.UnsafeNclNativeMethods+HttpApi..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at Microsoft.Net.Http.Server.WebListener..ctor (ILoggerFactory factory) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Server.WebListener.ServerFactory.Initialize (IConfiguration configuration) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.BuildApplication () [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Internal.HostingEngine.Start () [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Hosting.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at Microsoft.Framework.ApplicationHost.Program.ExecuteMain (Microsoft.Framework.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0
  at Microsoft.Framework.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Framework.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at dnx.host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env) [0x00000] in <filename unknown>:0
System.DllNotFoundException: httpapi.dll
  at (wrapper managed-to-native) Microsoft.Net.Http.Server.UnsafeNclNativeMethods/HttpApi:HttpInitialize (Microsoft.Net.Http.Server.UnsafeNclNativeMethods/HttpApi/HTTPAPI_VERSION,uint,void*)
  at Microsoft.Net.Http.Server.UnsafeNclNativeMethods+HttpApi.InitHttpApi (UInt16 majorVersion, UInt16 minorVersion) [0x00000] in <filename unknown>:0
  at Microsoft.Net.Http.Server.UnsafeNclNativeMethods+HttpApi..cctor () [0x00000] in <filename unknown>:0

@rustd
Copy link
Author

rustd commented Jun 19, 2015

Here are the changes needed

  • project.json

Package name is Kestrel instead of Microsoft.AspNet.Server.Kestrel
"Kestrel": "1.0.0-beta5",

The commands section should have
"commands": {
"kestrel": "Microsoft.AspNet.Hosting --server Kestrel --config hosting.ini",
"web": "Microsoft.AspNet.Hosting --server Microsoft.AspNet.Server.WebListener --config hosting.ini"
},

  • hosting.ini

This file should only have the following content
server.urls=http://localhost:5000

  • Remove build numbers from packages. Packages should as follows 1.0.0-Beta5
    Set NuGet package source and DNX_FEED to https://www.myget.org/f/aspnetbeta5/api/v2
    Do not use the release/ dev feed
  • BrowserLink
    Remove BrowserLink package and the app.UseBrowerLink(). from Startup.cs

@sayedihashimi
Copy link
Member

Here is an updated zip file with @rustd's changes https://www.dropbox.com/s/lzblz1luwhmkcix/WebApplication_IndividualAuth.zip?dl=0.

After this dnu restore and dnu build work but when running kestrel I get the following error on Mac

ayeds-MacBook-Pro:WebApplication_IndividualAuth sayedhashimi$ dnx . kestrel
info    : [Microsoft.Framework.DependencyInjection.DataProtectionServices] User profile is available. Using '/Users/sayedhashimi/.local/share/ASP.NET/DataProtection-Keys' as key repository; keys will not be encrypted at rest.
System.Exception: Error -48 EADDRINUSE address already in use
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.Check (Int32 statusCode) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Networking.Libuv.listen (Microsoft.AspNet.Server.Kestrel.Networking.UvStreamHandle handle, Int32 backlog, Microsoft.AspNet.Server.Kestrel.Networking.uv_connection_cb cb) [0x00000] in <filename unknown>:0
  at Microsoft.AspNet.Server.Kestrel.Networking.UvStreamHandle.Listen (Int32 backlog, System.Action`4 callback, System.Object state) [0x00000] in <filename unknown>:0

cc @danroth27

@sayedihashimi
Copy link
Member

@rustd @danroth27 the comment above is not an issue with the template but instead something else related to killing kestrel. When I tested the web empty template when i ran dnx . kestrel it started correctly. I tried to close kestrel with q and CTRL+C but that didn't work as it used to. Then I tried CTRL+Z and it stopped kestrel. Then when I tested this I got the EADDRINUSE error which means that the port is already in use. What's the correct way to stop kestrel so that it releases the port?

cc @glennc

@peterblazejewicz
Copy link
Member

I've taken this one.
@sayedihashimi I'll upload changes via PR and in the case of problems with building (I assume I'll have the same problems as previously) you or someone else will have to verifty how it runs under beta5
Does it sounds OK?

@sayedihashimi
Copy link
Member

Yes, I'll verify it. Thanks a lot

peterblazejewicz added a commit to peterblazejewicz/generator-aspnet that referenced this issue Jun 21, 2015
This commit introduces following changes based on beta5 template:
- updated project template structure (no flattened content)
- the same structure and filenames for better code structure and code
clarity and maintenance
- updated syntax from fs-mem module for all I/O operations
- simplification project structure and logic by using if/fi syntax to generate
Gulp or Grunt related content within configuration files
- use simple copy operation whenever possible to avoid complexity in code
- all files are covered by Mocha unit tests
- updated README.md in project root - no html based readme
@sayedihashimi
Copy link
Member

Closed it, thanks @peterblazejewicz

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

No branches or pull requests

3 participants