-
Notifications
You must be signed in to change notification settings - Fork 521
Can not run on Local IIS with ASPNETCORE_ENVIRONMENT set to Development #883
Comments
It works fine on my machine if I first "publish" the application (In Visual Studio 2017 select Build then Publish). See: Publishing and Running ASP.NET Core Applications with IIS
|
That is corect in that it still runs, but not in Development mode. It is is Production mode. I need to set the ASPNETCORE_Environment variable to Development so that it runs correctly on dev server. Any info would be great. |
@martinfletcher Have you got repro steps that work on a clean machine? i.e., how exactly did you set up IIS to serve your application? It sounds like the IIS process is running with the wrong working directory, or something like that, which means it doesn't see your |
@SteveSandersonMS Thanks, I had already done that, but still did not work. I discovered (from the source code) that http binding is required for aspnet-webpack (hard coded localhost on http). I take it this will now break if i have require https filters in place? Is there specific urls that i can exclude from this, or ideally a better way of not having to have http binding for my app? |
Apologies, this is the correct issue, not #227 |
Are you saying that adding an http binding fixes it? What part of the source code are you referring to? If adding an http binding in your IIS config fixes it, I'm surprised by that, since the only thing that HMR is doing with this is telling a local instance of Webpack dev middleware to listen for requests on |
Sorry, red herring..... I still had ASPNETCORE_ENVIRONMENT=Production What I am trying to achieve is to deploy my web app to Local IIS so that it can be targeted by another app without having to un 2 instances of visual studio and reference localhost:xxxxx etc Basically here is what I have to achieve this: Web app created using dotnet new angular (Spa Templates) I am getting the following error when ASPNETCORE_ENVIRONMENT=Development: System.AggregateException: One or more errors occurred. (Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack' |
Noob-alert! :) |
patrickgomes1968 Can you re-install the templates (just run |
@ADefWebserver : Thanks. Re-installed them. Created a new proj. But still getting the same exception(s). |
@patrickgomes1968 : I do not think running your old project made a difference. The only other thing I can suggest is un-installing and re-installing Node. |
@patrickgomes1968 It sounds like your Node.js setup is pretty messed up. If I was in your situation, I'd purge every trace of Node (including Both the @patrickgomes1968 and @martinfletcher reports appear to be due to problematic Node installations, which is outside the scope of this repo, so I'll close this. Hope that's OK! |
@patrickgomes1968 you can not run procution publish with environment variable indicating development for angular project |
I have a new Angular app creates with the spa templates which I need to run on Local IIS on developer machines, with the ASPNETCORE_Environment variable set to Development.
With this set, i get the following error:
Exception: Call to Node module failed with error: Webpack dev middleware failed because of an error while loading 'aspnet-webpack'. Error was: Error: Cannot find module 'aspnet-webpack'
Is there any solution to this?
The text was updated successfully, but these errors were encountered: