Log4net with dotnetnuke - log4net

How can i configure Log4net to work in a Dotnetnuke solution?
I am using DNN 5.2
the Global.asax does not have a code behind file to put code to initialize the Log4net.

You can use something like this in the Global.asax file:
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Configure log4net here
End Sub
</script>

I found the Global.asax.vb (code behind for the global.asax) under App_Code.
For some reason in dotnetnuke the code written inside in the asax is not called.

Related

Why am I getting a 404 for my LESS file on my Azure App Service?

Ok, so... famous saying... this works locally, but not when I deploy.
I recently switched to using Less.js so that I could dynamically change my less variables with Javascript. Again, locally this works like a champ.
In my header I have it referenced:
<link rel="stylesheet/less" type="text/css" href="~/Content/main.less" />
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/3.9.0/less.min.js"></script>
When I use Visual Studio to deploy this to my Azure App Service I get a 404 on the less file and it all breaks.
I FTP'd into my server and the file is indeed there. https://i.imgur.com/cV5FQOW.png
I double checked to make sure that my properties for the less file are right. I have the build action set to Content and Copy if Newer. https://i.imgur.com/I3DbfHg.png
No matter what I do, if I go looking for that main.less file the azure server returns a 404.
As an FYI, the site is a ASP.Net MVC 5 website. I am using bundling, but only for external css like JQueryUI. I have removed the bundling of my CSS to work with the new stuff.
What am I missing?
Ok! After a bunch of attempts and searches I finally found a related error and found my solution.
This poor gentleman was having an issue serving up JSON files (angular2 app, http request for file json file, 404 on azure) and that made me think I had the same problem.
Eureka! I needed to update my web.config to let it serve LESS files.
<system.webServer>
<staticContent>
<mimeMap fileExtension=".less" mimeType="text/css" />
</staticContent>
<system.webServer>
Hope this helps someone else who runs into the same issue.

Google Sites Gadget with Javascript

I created a simple slideshow script to include on a Google Site for Google+ albums (it uses a library found at: https://sites.google.com/site/scriptsexamples/new-connectors-to-google-services/picasa-services). The test version worked except for the fact that if publish for anonymous access, it displays that aweful "This application was not created by Google" nonsense at the top. As this is a slideshow, I tried finding a way to avoid this. Thus I decided to try my hand at a Gadget. I opted to use Google Gadget Editor and combed through the internet to see how to do this (I am a complete noob with regards to gadgets, so excuse my ignorance...)
In the end I came up with this: http://hosting.gmodules.com/ig/gadgets/file/117039901033759910299/google-plus-slider.xml
Once I insert the gadget, I do not get any error messages and the frame does display on my google site (without the warning message, as far as I can tell), but nothing else happens. And I have no idea why.
Some notes:
the javascript works when it is a google apps script, published and then inserted in my site (but the warning message is ugly)
I have no idea whether it is even possible to call typical GAS calls such as Ui.App in XML gadget - if not, then I will have to learn, but don't know where.
Obviously the library that I am using needs to be loaded - I researched as much as I could but cannot find any way to load the library. The only option I could find was to include specific predefined libraries with the Required tag.
I hope you have all the info and that someone can help! Thanks in advance.
Do you get any Cross-Domain warnings in your console?
I would try and include the external library in your gadget-name.xml file. You're free to include (mostly) whatever JS you like under
<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs
title="Slider"
height="50"
width="200"
border="none"
/>
<Content type="html">
<![CDATA[
<script type="text/javascript">
function my-slide-show(){
//Dump your lib JS here
}
</script>
<div class="slideshowHtml"></div>
]]>
</Content>
</Module>
This will at least avoid any scoping / Cross origin worries you might be having

include file directive not working in linux sever

My problem is, i have included a page using the code
<%#include file="../include/dbconnection.jsp"%>
My page resides in a sub directory of public_html but when i load my page it shows the following exception
org.apache.jasper.JasperException: /index.jsp(23,1) File "/../include/dbconnection.jsp" not found
But this code works fine in my development system(which is windows) i use a linux server for my website. Is this a problem with file separator or file permission issues? what could be the problem?
You can find your answer in the post below which is using <jsp:include page="..."> , the <%#include only works with static references.
Is it possible to have a dynamic path as part of a jsp include

iisnode - IIS7.5: 405 Method not allowed when performing PUT request

I started to do some experimentation with iisnode and expressjs to create a REST like API with node.
So on the server.js I created something like
app.put("/test", function(req, res){
...
});
However, when I execute the PUT request I get a 405 Method not allowed from the IIS 7.5 installation.
Any idea on how to solve this?
BTW, I googled already and tried to add the PUT verbs here and there in the different Handler Mappings with no success...
I now finally found the solution to this problem namely the WebDavModule was blocking my PUT requests.
To resolve the issue:
Open your IIS Manager
Goto your application configuration and open "Modules"
Search WebDavModule and remove it (menu on the right)
It then worked for me.
Alternatively, in your application's web.config add
<system.webServer>
...
<modules>
<remove name="WebDAVModule"/>
</modules>
</system.webServer>
One reason may be that your web.config does not map the particular request you are making to the iisnode handler. In that case the request is picked up by the static request handler which does not support PUT methods and responds with a 405.
To fix this you need a iisnode handler registration like this in your web.config: https://github.com/tjanczuk/iisnode/blob/master/src/samples/helloworld/web.config#L7
In addition, if you plan to use URL that do not end with the name of your node.js file (like seems to be the case above), you will need to use a URL rewrite module to tell IIS exactly which requests should have their URLs rewritten to point to the URL of your node.js entry point. Read more at: http://tomasz.janczuk.org/2011/08/using-url-rewriting-with-nodejs.html

Subsonic REST 404 error

I'm trying to use the REST interface with Subsonic, but am not having any luck.
I have this in the web.config
<httpHandlers>
<add type="SubSonic.WebUtility.RESTHandler, Subsonic" path=".xml" verb="*"/>
</httpHandlers>
and just to test that I have a version of Subsonic that has this functionality, this works fine (doesn't do anything but I get the Intellisense and it compiles fine):
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim dr As New SubSonic.WebUtility.RESTHandler
End Sub
But when I try a URL like http://localhost:59271/CBVA35/schedule/list.xml, I get a 404 error.
You need to route "xml" to the rest handler:
<httpHandlers>
<add verb="*" path="*.xml" type="SubSonic.WebUtility.RESTHandler, Subsonic"/>
http://subsonicproject.com/tips-and-tricks/webcast-using-subsonic-s-rest-handler/
I had this same problem -- it worked fine using the ASP.NET dev web server but did not work in IIS. In addition to what Rob mentioned, I had to configure IIS mappings to accept other file types. See the comments here for details:
http://www.swindelles.com/ed/2008/07/22/creating-rest-web-services-in-c-sharp-2/

Resources