ReactJS.net on Azure - asp.net-mvc

I'm hoping I'm able to get some help out there with people with more experience on ReactJS than me. I'm using MVC 5 with ReactJS (using ReactJS.net to take care of the translation from JSX to js) and I was able to some stuff done that works pretty well. Testing the my code on my local pc works fine for debugging, but once I publish it to Azure for testing I get this error:
GET http://mywebsite.azurewebsites.net/Scripts/jsx/FriendSelect.jsx?_=1429662139230 404 (Not Found)
This is usually the error I get when the jsx file doesn't get converted to js successfully. Does anyone know the steps I need to take to get ReactJS.net to work properly on Azure?

I don't understand why you need to use anything react.net etc...? React comes with a JSXTransformer file which transforms your JSX to JS while you're in the process of developing your site. Compiled and minified JS code should be used in production once you no longer need JSX. Tools like Gulp can assist with automatically minifying your code for you.
Whether the site is Azure, Linux Ubuntu or anything else it shouldn't matter.

Related

Using pub serve with ASP.NET Core backend

I'm using Dart to build JS applications that are loaded on web pages hosted from an ASP.NET Core application, and I'm trying to establish a development workflow with either pub serve or potentially pub build that allows for debugging. I've seen some related posts, but I'm still stuck. This is what I've tried:
I used pub build with dart2js and the --mode=debug flag set to generate dart sources and a sourceMap, and then used Chrome to load and debug the web pages. The problem here, apart from long compile times, is the sourceMaps don't seem to work well for the debugging. Lines in the .dart files are often unavailable for debugging, and stepping over function calls doesn't work well, instead diving into framework code. I'm also unable to see values reported reliably.
I used pub get with the --packages-dir flag to copy in dependencies and then loaded the web pages with Dartium hosted by the IIS Express server. This loads pages fine and lets me develop, but I was unable to get breakpoints working at all in Dartium unless I used the debugger() statement directly in my code. I'm also concerned about this approach in general because Dartium is no longer being updated and the Dart team's plan is to move away from it.
As an offshoot of #2, I also tried simply changing my script tag URLs in my ASP.NET pages to point to the resources on the pub serve dev server. This is blocked because pub serve apparently only serves on http, and the ASP.NET application is hosted via HTTPS locally. I tried to change the backend to load on HTTP, but now I'm running into issues with authentication/authorization not working in my .NET app. Also, I had hoped to be able to use dartdevc with this approach, but that gave me 404 errors with requirejs, I think because it was trying to load it from the IIS Express server instead of pub serve (I'm really not sure about that).
I've found some mentions in other StackOverflow posts of setting up some sort of proxying behavior in order to have a backend server request resources from pub serve, but I have no idea how this might be done or if it applies to this situation. I can't find any information.
What strategies are people using for this, and is there a best-practice in mind going forward with Dart 2.0 and dartdevc?

Swashbuckle won't load resources

I have a .NET MVC application that includes a web service.
I have added Swashbuckle to the web service project and on my local machine everything works fine.
When I move the code to our TEST environment I begin to get 404 errors randomly for the various javascript and CSS libraries.
Sometimes the swagger/ui/index page itself throws a 404. Sometimes everything loads.
I've thought about downloading all of these files and placing them in my project for Swagger to use, but based on what I've read, and the way my local environment works, it doesn't seem like that's the way swashbuckle is designed to work, so I'm at a loss.
I have very limited access to the TEST environment so any server configuration will be an issue. My hope is that swagger.config file can be updated to make everything play nice.
I discovered that my TFS build server was NOT overwriting the previous build which led to differences between my load balanced servers and files that were not being updated with changes as I tried to get Swashbuckle to work.

Razor views not generating html after deploying Umbraco 7.2 in IIS 7

I am new to Umbraco, so I started creating a site to play a bit with it. While I had my site running on IIS express (either from VS or WebMatrix) everything worked fine. After deploying the site to IIS 7, the razor views of the front end are display in plain text, meaning that I actually see Razor syntax in the browser. Umbraco back office is working perfect though, except when I hit preview, in that case I get the plain Razor syntax again. I then try to deploy a simple new MVC project to IIS and the Razor engine worked just fine, so I guess is not a problem in IIS but in Umbraco configuration. Is there any configuration tweak I need to take care in Umbraco configuration to solve this problem? Thanks in advance for the help.
I also tried to deploy it in the IIS of my local development machine (the same in which it runs OK in IIS-express) which has the right framework and everything and I got the same cshtml display in the browser.
After struggling a bit more with the problem I found the issue causing this behavior. After installing the starter kit a lot of files are generated in the folder and subfolders of the solution. In order to publish the solution to generate the contents of your website the VS project needs to have all these files included as project files. I found out that some views were excluded of the project and thus not being generated when publishing. I included the missing views and double check that all important files were part of the project and problem solved.

SiteMapProvider doesn't work on the server

I'm working with ASP.NET MVC and I use DevExpress.
I created a menu with MvcSiteMapProvider. It works just as I want while debugging. But when I deploy it to the server it just prints the Strings from the Xml-File.
I checked the File-System of the server and it says that everything needed is deployed. (The Package & the xml-File).
Does somebody know what I forgot?
Or what I do wrong?
Thanks a lot :)
I suspect that you haven't deployed your HTML helper templates. Be sure you copy over the contents of the /Views/Shared/DisplayTemplates/ directory to your server.

Using dart web-ui (polymer) with ASP.NET MVC site, need help running as javascript

I have a dart polymer project being served up by an ASP.NET MVC site. The application page is actually a cshtml file that is in a different directory than the rest of the dart files. Besides this, everything is laid out in an idiomatic fashion. When running in Dartium, everything works great. When I run as javascript, I get the message boot.js only works in Dartium. Run the build.dart tool to compile a depolyable JavaScript version.
This scenario seems like it will be difficult to accommodate. Any ideas how I can get the application working as javascript while keeping it as a cshtml file served up by ASP.NET MVC?
This is a known issue. Try using this version of build.dart:
import 'dart:io';
import 'package:polymer/component_build.dart';
import 'package:polymer/deploy.dart' as deploy;
void main() {
build(new Options().arguments, ['web/index.html']).then((_) => deploy.main());
}
You might get a message about a missing index.html_bootstrap.dart.js file. Dart engineers are working on making all of this work more smoothly and you should soon be able to run the deploy script through the editor.
Meanwhile, there is a discussion of this very issue on the web-ui mailing list if anyone's interested:
https://groups.google.com/a/dartlang.org/d/msg/web-ui/mLsdykraJdA/k77QuP1T2_sJ
I'll update this answer when a better alternative to the current solution is implemented.

Resources