Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception was thrown by the type initializer for HttpApi #107

Closed
lucasteles22 opened this issue Jul 30, 2014 · 4 comments
Closed

An exception was thrown by the type initializer for HttpApi #107

lucasteles22 opened this issue Jul 30, 2014 · 4 comments

Comments

@lucasteles22
Copy link

Hi guys,
I am trying build an environment on my mac osx to run the project VNext. However, I can't run the project Web (k web), but I can run the project console (k run).
When I run the project web, the terminal show me this message: "An exception was thrown by the type initializer for HttpApi - httpapi.dll".
I follow all steps to build the enviroment on my mac osx.
1)
I tried run the project VNext with KRE version "kvm install 0.1-alpha-build-0446", as show below:
screen shot 2014-07-30 at 9 45 59 am

My project.json to KRE version above
screen shot 2014-07-30 at 9 47 01 am

I still tried to make an update on my KRE version, as show below:
screen shot 2014-07-30 at 9 49 27 am

and my project.json...
screen shot 2014-07-30 at 9 51 06 am

To both KRE versions, the exception "An exception was thrown by the type initializer for HttpApi" is displayed.

Any suggestion to fix my wrong? Any idea?

@Praburaj
Copy link

To run an aspnetvnext web application on mac you need to use Kestrel (the cross platform server). WebListener is not expected to work on mac. Try installing alpha3 builds of all these packages and install Kestrel as well like this : https://github.com/aspnet/MusicStore/blob/dev/src/MusicStore/project.json#L8. Setup a command for Kestrel like this https://github.com/aspnet/MusicStore/blob/dev/src/MusicStore/project.json#L25 and to run the application.

@lucasteles22
Copy link
Author

THX. Now it's working for me
However, I don't understand which is difference between "k web" and "k Kestrel". On windows, "k web" works for me.

@desdesdes
Copy link

k web is using Microsoft.AspNet.Server.WebListener (see project.json) which uses httpapi.dll. This is only available on windows. Kestrel uses libuv which is a binary bundled with the package and is available on windows and osx. linux support is still missing there also, see aspnet/KestrelHttpServer#10. If you want to host on linux you could look at nowin, see https://github.com/Bobris/Nowin.

@monoman
Copy link

monoman commented Jul 31, 2014

You are choosing the "web server" to use. "k web" works in Windows because
it uses an web server that works in windows only (for now at least).

Rafael Teixeira
O..:.)oooo

On Thu, Jul 31, 2014 at 5:36 PM, Lucas da Veiga Teles <
notifications@github.com> wrote:

THX. Now it's working for me
However, I don't understand which is difference between "k web" and "k
Kestrel". On windows, "k web" works for me.


Reply to this email directly or view it on GitHub
#107 (comment).

jkotalik pushed a commit that referenced this issue Nov 1, 2018
Fix nuget output path

* Update theoutput path of nuget package
natemcmaster pushed a commit that referenced this issue Nov 9, 2018
ryanbrandenburg pushed a commit that referenced this issue Nov 16, 2018
Readme updates and deleted build.cmd, lkg.json, kvm.cmd
ryanbrandenburg pushed a commit that referenced this issue Nov 20, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
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

4 participants