-
Notifications
You must be signed in to change notification settings - Fork 926
Problem with initialization on azure web app #240
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
Comments
Interesting, not sure why adding the React.NET/src/React.Web/WebInitializer.cs Line 31 in cbc2f18
|
You can get it working on azure if the package is in the application when you first release it to azure. This error occurs when you add it afterwards. As far as I can tell the reason is that dynamically registering the module will only happen on IIS start. When you deploy new code to an azure app the IIS will not restart and thus the module will not be registered. Modules in the web.config will be registered on application start which will happen when you release new code. |
How do you deploy to Azure? Is there an option to recycle the app pool on deploy? That might solve the issue too. |
Not that I know of. I do continues integration from git and have also tried a publish profile from VS. Also when I recreated this locally restarting the app pool didn't help. I needed to restart the entire IIS. |
@tanorion I am facing the same issue, can you please share where to put
|
@attiqeurrehman I added mine to the initialization of the CMS used in the web app but I think that you should be able to add it to Global.asax Application_Start() method. Let me know it this works for you or not. |
@tanorion giving error on AsPerRequestSingleton parameter. |
@attiqeurrehman What kind of error? I should mention that I had to create my own AsPerRequestSingleton class to get this to work. Here is the code. public static TinyIoCContainer.RegisterOptions AsPerRequestSingleton(TinyIoCContainer.RegisterOptions registerOptions)
{
return TinyIoCContainer.RegisterOptions.ToCustomLifetimeManager(
registerOptions,
new HttpContextLifetimeProvider(),
"per request singleton"
);
} |
Still same error: |
@attiqeurrehman Do you have a stacktrace of the actual error? |
This is the link for detail On Mon, Aug 29, 2016 at 5:13 PM, Niklas Wanngren [email protected]
Attiqe Ur Rehman |
@attiqeurrehman I cant see anything related from that post. Your first image tells me there is a internal server error and that the module is React.Web.WebInitializer but it doesn't really say whats wrong. In my case there was a explicit error message saying that React was not initialized and that there was no IOC container registered. You should be able to get a more detailed error message otherwise it is hard to help. Aslo from the url of the error message it looks like this error occurs on your local machine which has never been a problem in this Issue. If this is your local machine it should be solved by removing all extra code and doing a IIS reset. If the error still persists it is probably not related to this and should perhaps be put in its own post. |
@tanorion Hello, I tried your solution and it doesn't work because of this: I checked and WebInitializer is not accessible because it's internal: I also couldn't use but <system.webServer> instead. So what should I do now to work around this issue? |
Closing issues older than a year, please re-open if you think this is still relevant. |
I have a problem with getting react.net to initialize on an azure web app. The problem occurs if I add the react nuget package after I have deployed the site the first time. I think this has to do with how azure web apps restart and store temporary files. I manage to recreate this locally and the solution then was to do an IIS reset and remove temporary asp.net files which I have not been able to do in azure. I have tried every hack for this I could find but no luck. In the end I solved this by adding the HTTPmodule in the web.config
And initializing the react ioc container and config in one of my other initializers.
If you have better solution it would be greatly appreciated. Otherwise might I suggest to make WebInitializer public and let override it properly if needed?
This is probably related to #191 but that issue was closed so I made new one. I did try to add owin publish, no luck and the remove owin and republish, still not working.
The text was updated successfully, but these errors were encountered: