Tag Archives: tip - Page 2

Orchard: Custom Content in Sub-Folders

Orchard doesn’t seem to like anything in it’s web root except for it’s own content. Try it out – create a folder (I created /TestContent/) and then put a test from there (I created test.html) and try to access it. You’ll get a 404 error. Orchard “traps” all requests and effectively kills them if it doesn’t like them. That’s a bummer though if you want to drop some custom content on your site somewhere for some reason. Let’s see what we can do about it.

I created a default Orchard site. No changes and running the default recipe selected during the initial configuration.

I created a folder named “TestContent” so that it would be available at <orchardsite>/TestContent/

I created a simple HTML file named “test.html” so that it would be available at <orchardsite>/TestContent/test.html

I confirmed that I got a 404 error trying to access the file.

OK. So now let’s see what we can do to fix this issue. There was a lot of research and testing for a solution and I spare you those details and just show how I got past the error.

I surrounded <system.web> and <system.webServer> with location tags to prevent the settings from pushing to all subfolders…

<location inheritInChildApplications="false">
  <system.web>
    ...
  </system.web>
</location>
...
<location inheritInChildApplications="false">
  <system.webServer>
    ...
  </system.webServer>
</location>

I also converted the /TestContent/ folder to an application in IIS. This can be done via many hosting control panels or directly through IIS (either on-server or via the IIS7 Remote Management tool).

Convert a folder an to application in IIS

Great, now my test URL works! But it seems also that the formatting within Orchard has broken. So…

I added another section to the web.config file. This time just below the ending location tag that I wrapped around the system.webServer section.

...
</system.webServer>
</location>
<!--
EDIT: Adding this next section to "fix" the Orchard formatting
-->
 <location path="Themes">
   <system.webServer>
     <validation validateIntegratedModeConfiguration="false" />
     <handlers accessPolicy="Script">
       <remove name="StaticFile" />
     </handlers>
   </system.webServer>
 </location>
 <location path="Core">
   <system.webServer>
     <validation validateIntegratedModeConfiguration="false" />
     <handlers accessPolicy="Script">
       <remove name="StaticFile" />
     </handlers>
   </system.webServer>
 </location>
 <location path="Media">
   <system.webServer>
     <validation validateIntegratedModeConfiguration="false" />
     <handlers accessPolicy="Script">
       <remove name="StaticFile" />
     </handlers>
   </system.webServer>
 </location>
 <location path="Modules">
   <system.webServer>
     <validation validateIntegratedModeConfiguration="false" />
     <handlers accessPolicy="Script">
       <remove name="StaticFile" />
     </handlers>
   </system.webServer>
 </location>
<!--
EDIT: Adding the above section to "fix" the Orchard formatting
-->
 <runtime>
...

And then the Orchard formatting started working again… And the test page in the test folder still worked!

Problem solved? I think so. It seems that this solution works great for me. If you have a different experience with this solution please let a comment and share with the world.

Happy hosting!

MVC3, Visual Studio 2010: Error: Microsoft JScript runtime error: Not implemented

Okay, so I’ve started tinkering with MVC3 just to get familiar with what more-and-more people are working with now from a Windows Internet development perspective. I have a development/test VM running Windows Server 2008 R2 so I figured I’d install it there and walk-through some of the online tutorials.

Microsoft MVC 3 (Model View Controller)

Well, right out of the bat even the simple project templates don’t work for me. Each time it would throw an error upon running stating “Microsoft JScript runtime error: Not implemented”. After a lot of online searching, and trying suggested things like uninstalling and reinstalling the MVC3 Tools Update, I still couldn’t get past the issue.

Persistence has paid off though because I was able to follow a few trails and finally wind up a page that said the issue was specifically related to IE9 and running the environment on Windows Server 2008. The resolution is to enable the Desktop Experience on Windows Server 2008 (and R2). It seems that IE9 doesn’t fully support some of the features that the MVC3 JScript files try to reference by default – but it does with Desktop Experience enabled.

Here’s a link about the Desktop Experience and how to enable it on Windows Server 2008 (and R2):
http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/233bae03-4e9f-4dc6-89bc-0b729fbdf64a/

I made this configuration change (which required a reboot in the middle of the configuration), then reopened my MVC3 sample project, clicked Run and… No errors! So it seems like this really does resolve the issue. Yeah!

SQL Server 2008 R2 – Saving Changes Not Permitted

Have you gotten the annoying “Saving Changes Not Permitted” error when trying to make a table change to SQL Server 2008 R2 through SQL Server Management Studio? I have and it’s quite annoying. A safe default perhaps, but annoying all the same – especially on a development machine where changes are frequent.

I found the following post online by Brian Knight where he ran into the same issue and he explains how to disable that “feature” so that you can edit your SQL Server tables as needed and without issue.

SQL Server 2008 Designer Behavior Change: Saving Changes Not Permitted

Add a second hard drive to a Dell E6400

I recently upgraded the hard drive in my Dell E6400 – literally swapping out the drive. I would have gone this route regardless because I like the faster boot time, but afterward I did find out that there was another option – adding the SSD as a second drive.

This would be a great solution if you use certain programs or utilities on your laptop that you want faster, but you are okay with the normal boot and run speed. For example, if you are going to run virtualization on your laptop you may want a faster IO option like SSD. In this case, adding the SSD as a second drive to hold the virtual disk files may be a route worth considering.

There are a few different caddies that support this option, but the one I found at the link below appears to be the most durable and recommended. When/if I get to the point of wanting another storage upgrade in my laptop, I’ll definitely be checking out this option.

http://www.newmodeus.com/shop/index.php?main_page=product_info&cPath=2_3&products_id=224

 

Get sound while connected to a remote server via RDP

When connected to a remote server (or desktop if you’re using VDI) via Remote Desktop Protocol (RDP) there may be a need or desire to hear sound played on that remote machine. At first it may seem like getting sound drivers installed and configured on the remote machine is the way to go – but in reality, you don’t want the sound to play remotely – you want the sound to initiate remotely but play on your local machine so that you can hear it.

I recently had this challange myself and found that the steps below resolved the issue for me so that I could hear sound locally that was played from a remote server while RDP’d into the system.

Windows 7 and 2008 R2:
1. Click Start > Run, type mmc, and click OK.
2. Add the Group Policy Object Editor snapin.
3. Expand Local Computer Policy.
4. Expand Computer Configuration.
5. Expand Administrative Templates.
6. Expand Windows Components.
7. Expand Remote Desktop Services.
8. Expand Remote Desktop Session Host.
9. In Device and Resource redirection, enable Allow Audio and Video Playback Redirection.
10. Restart the virtual machine.

Hopefully you found this useful and it helps resolve the issue for you too.

Oh, BTW, if you don’t have a remotely hosted virtual server (aka VM or VPS or Cloud Server) then you should note that you can get a fully managed Windows Cloud Server from OrcsWeb or a totally unmanaged (self-administered and very low-priced) Windows VPS from Cytanium.

Happy Hosting!