No recompile of JSX file when debugging - reactjs.net

ReactJS.NET is not recompiling when debugging.
It compiles once, and then it remains static.
Strangely, when I make an error in my and my app is already built, I can fix the JSX and it will compile without having to rebuild my app but it will only do that once.
Where should I be looking to fix it?
My Web.config has
<system.web>
<httpHandlers>
<add verb="GET" path="*.jsx" type="React.Web.JsxHandlerFactory, React.Web" />
</stem.web
<system.webServer>
<remove name="Babel" />
<add name="Babel" verb="GET" path="*.jsx" type="React.Web.BabelHandlerFactory, React.Web" preCondition="integratedMode" />
</handlers>
</system.webServer>
and I've call the JSX in my view with all three methods
<script src="..."></scripts>
#Scripts.Render("...")
#Url.Content("...")
What should I be doing to fix this?

Related

Using Image Resizer AzureReader2 with MVC website "The image cannot be displayed because it contains errors"

I'm trying to use Image Resizer's AzureReader2 plugin to read images from blob storage. And it works fine when I try and retrieve the unedited image.
When I go to the following url it redirects to my local storage account where the image is stored
http://localhost:2000/azure/test/image.jpg
But when I navigate to the following I get "The image cannot be displayed because it contains errors"
http://localhost:2000/azure/test/image.jpg?width=400&height=400&mode=crop&borderWidth=10&borderColor=red
Here is what my web.config file looks like
<configuration>
<configSections>
<section name="resizer" type="ImageResizer.ResizerSection,ImageResizer" requirePermission="false" />
</configSections>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<httpModules>
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</httpModules>
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
...
</assemblyBinding>
</runtime>
<appSettings>
...
</appSettings>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<!-- This is for IIS7/8 Integrated mode-->
<add name="ImageResizingModule" type="ImageResizer.InterceptModule" />
</modules>
</system.webServer>
<resizer>
<plugins>
<add name="MvcRoutingShim" />
<add name="AzureReader2" connectionString="UseDevelopmentStorage=true" endpoint="http://127.0.0.1:10000/devstoreaccount1/" />
</plugins>
</resizer>
</configuration>
Any ideas?
It seems as if the problem was to do with my Owin pipeline. The way I had the rest of my project set up it was being routed through Owin and was never able to reach the Image Resizer. I changed the set up of my project so that it wasn't routing through Owin.

imageresizer remote reader plugin only displays the remote image if no query strings are present in URL

I'm trying to resize/crop the images stored on one of our servers and use them on another, also our server. Image resizer is running on www.aapg.org. Remote images are stored on assets.aapg.org.
Not sure why it doesn't work. I followed the process outlined in http://imageresizing.net/plugins/remotereader -- everything looks OK. I tried both a signed remote URL and human-friendly syntax, and neither worked for me.
Here are the plugins from the Web.config file I'm using:
<add name="MvcRoutingShim" />
<add name="DiskCache" />
<add name="SeamCarving" />
<add name="SimpleFilters" />
<add name="PdfRenderer" downloadNativeDependencies="true" />
<add name="DropShadow" />
<add name="WhitespaceTrimmer" />
<add name="PrettyGifs" />
<add name="AnimatedGifs" />
<add name="WebPEncoder" />
<add name="WebPDecoder" />
<add name="RemoteReader" />
<add name="CloudFront" />
And the remote reader plugin configuration ('xxxxxxxxxxxxxxxxxxxxxx' is obviously not what I'm using):
<remotereader signingKey="xxxxxxxxxxxxxxxxxxxxxx" allowAllSignedRequests="false" allowRedirects="5">
<allow domain="aapg.org" />
<allow domain="assets.aapg.org" />
</remotereader>
Can anyone tell me what I'm doing wrong? Or what I'm missing?
Thanks in advance!

add a helper on the razor views (pagedList)

i want to use the pagedList helper, i have a 4 layer aplication that has a MVC4 has a presentation layer. i have added the librarys using nuget. then added the keys on the web.conf of the views like:
<namespaces>
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Routing" />
<add namespace="JQueryUIHelpers" />
<add namespace="PagedList" />
<add namespace="PagedList.MVC" />
</namespaces>
the problem is thet when i try to use the helper (#Html.PagedListPager) is like it isnt loaded.
also try whit the clasic #using but i get the same result.
closed and reopen aplication and visual studio but nothing, any idea what else can i try?
I just had the exact same problem and the exact same error on
<add namespace="PagedList.MVC" />
just replace it with
<add namespace="PagedList.Mvc" />
Mvc not MVC with 'M' in upper case and both 'v' and 'c' in lower case.
Remember to restart visual studio.

Glimpse is not logging Nhibernate queries (mvc3)

I have installed glimpse in my visual studio environment.
all working fine except nhibernate...
this is how I pass the factory:
factory = configuration.BuildSessionFactory();
NHibernate.Glimpse.Plugin.RegisterSessionFactory(factory);
this is my relevant sections in the web config:
<configuration>
<configSections>
<section name="glimpse" type="Glimpse.Core.Configuration.Section, Glimpse.Core" />
</configSections>
<appSettings>
<add key="nhibernate-logger" value="NHibernate.Glimpse.LoggerFactory, NHibernate.Glimpse" />
<add key="NHibernate.Glimpse.Loggers" value="command" />
</appSettings>
<system.web>
<!-- Glimpse: This can be commented in to add additional data to the Trace tab when using WebForms
<trace writeToDiagnosticsTrace="true" enabled="true" pageOutput="false"/> -->
<httpModules>
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" />
</httpModules>
<httpHandlers>
<add path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" />
</httpHandlers>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<add name="Glimpse" type="Glimpse.AspNet.HttpModule, Glimpse.AspNet" preCondition="integratedMode" />
</modules>
<handlers>
<add name="Glimpse" path="glimpse.axd" verb="GET" type="Glimpse.AspNet.HttpHandler, Glimpse.AspNet" preCondition="integratedMode" />
</handlers>
</system.webServer>
<glimpse defaultRuntimePolicy="On" endpointBaseUri="~/Glimpse.axd">
</glimpse>
</configuration>
Any idea?
Thanks
Did you install the NHibernate.Glimpse NuGet package?
The Glimpse.Ado NuGet package only adds ADO profiling when used in combination with DbProviderFactory

ELMAH in ASP.NET MVC 4 app in subfolder

Setup:
I have an ASP.NET MVC 4 app in a subfolder of the root folder (~/tracker).
I have ELMAH installed in the MVC app using NuGet.
Dev Machine:
On my dev machine the website is at the root. ELMAH works fine.
Problem on the Server:
On the server, I can see the ELMAH page, but despite generating errors, no errors get logged. It just says: "No errors found".
It also appears without any styling.
Web.config on Server:
The Elmah relevant bits on the server web.config are:
configSections:
<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>
appSettings:
<appSettings>
<add key="elmah.mvc.disableHandler" value="false" />
<add key="elmah.mvc.requiresAuthentication" value="true" />
<add key="elmah.mvc.allowedRoles" value="Admin" />
<add key="elmah.mvc.route" value="tracker/elmah" />
</appSettings>
httpModules:
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" />
</httpModules>
system.webServer:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
<add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
</modules>
</system.webServer>
Finally:
<elmah>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data/Elmah" />
<security allowRemoteAccess="yes" />
</elmah>
ok, solved this one:
Add write permissions to the ~/App_Data/Elmah folder.
As the meerkat said, simples.
I solved it by finding the following SO answer:
Elmah.MVC does not log errors in production environment
There is also a guide for setting permissions on the ELMAH folder, or rather, a link to a guide in the accepted answer to that question.
What I can't get to work is the styling of the ELMAH pages. Any suggestions?