This blog is for all Microsoft & .net lovers who may find themselves in need of help or information once in a while. We all have questions and we all need to know more than we know right now. When I come across things that I think may be useful, I post it. When I have something to say that I think is important, which is everything, I post it. All of my C#, ASP.NET, VB, AJAX & programming friends around the world are welcome to the info in my blog - Ramblings Of A Crazy DotNet Woman!
Friday, November 12, 2010
Finding The .SQL Mime Type SQL Server Mime Type
Friday, October 22, 2010
How To Solve System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial'
How To Solve System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
Ummm.....NO I am NOT missing a using directive or assembly reference - thank you very much! Well actually I was - LOL. I'm using MVC2. It seems that it wants an additional reference to reference RenderPartial now.
Here is a list of the usings I was using
(notice that wording - "usings I was using" - that makes me laugh - I crack myself up sometimes!) -
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Web;
using System.Reflection;
The using statements above SHOULD be enough to allow me to use RenderPartial. Unfortunately, I had to add ONE MORE using statement to make it work -
using System.Web.Mvc.Html;
That solved the issue! Why does Microsoft change little things like this? Do they do it just to drive people crazy?
Smooches,
Kila
PROBLEM:
How To Solve System.Web.Mvc.HtmlHelper' does not contain a definition for 'RenderPartial' and no extension method 'RenderPartial' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?)
SOLUTION:
Make sure you are referencing MVC in your web.config, make sure you have a mvc using statements listed above in your file and make sure you add the following item to that list of using statements.
using System.Web.Mvc.Html;
Sunday, October 10, 2010
Problems With The HP ZD8000!
A few years ago, I was given an HP zd8000 as a gift. I know the person that gave this thing to me cares for me very much so I don't hate them, but this laptop has to be one of the worst pieces of technology I have EVER owned. If this was my only laptop, I would be really, really angry right now. As it stands, it is one of many. However, since I just had to spend more time than I care to admit upgrading it to Windows7, I'm going to just list the problems I have had to date.
The computer is now 3 years old. However, I have been having many of these issues for a while now.
1.) The keyboard misses, skips and does not register some keystrokes. It happens to all of the keys. You will go along typing with a smile on your face only to realize that half the letters you typed were not registered by the keyboard. I used to have a USB keyboard attached to this laptop so I didn't notice this problem. It makes you want to scream!
2.) Several of the USB ports have DISCONNECTED from whatever they are connected to inside of the computer. I'm pretty handy with a screwdriver so I can correct this one, but it should not have happened in the first place.
3.) The computer overheats to the point that it could cause a fire! I have handled this issue with a Belkin cooling fan underneath the laptop. I hope this will help.
4.) The DVD RW drive stopped recognizing DVDs. This was OK after an upgrade to Windows 7. Well let me say that it MIGHT be OK. I say MIGHT because I JUST upgraded the machine from XP to Windows 7 TODAY! However, so far so good on that issue.
5.) The laptop battery no longer works. The system will not register that there is a battery. This is my FOURTH battery! There is a recall on this issue, so maybe it will work now.
6.) The power supply stopped working. It seems like it is the power supply connector that is the issue. I had to use some electrical tape to keep it connected and still.
7.) The middle of the touch pad has worn down to the point that I can see the green circuit board underneath it.
Of course, the warranty is gone so the best I can do is replace the parts myself. I wasn't angry about these things until I did a search and discovered that these are major issues for MANY ZD8000 owners! In fact, I saw MANY people talking about and suggesting class action lawsuits over the ZD8000 issues.
It makes me feel sick to my stomach that a company like HP would make computers like this without the thorough testing needed to make sure that they will work consistently and it really makes me sick to know that HP won't make things right!
Sunday, September 26, 2010
How To Get Fluent NHibernate, NHibernate And Castle To Work Using Medium Trust
There are times when open source projects can give you incredible joy. Then there are other times when you just want to go find the developers of a particular open source project and yell at them just a little bit. The truth is that we should all be thankful that open source developers care enough to create fantastic open source projects, but sometimes things can get hairy and scary. I had one such situation with NHibernate, Fluent NHibernate, Castle and StructureMap when I tried to get everything working in a medium trust environment. I'm going to tell you how to solve the problem so that you can have an easier go of things than I had.
I created a beautiful project using NHibernate, Fluent NHibernate , the part of Castle that NHibernate relies on and StructureMap. Everything worked perfectly in development and I was super happy and all smiles. Instead of just releasing the project, I decided to create a coming soon page for it. The coming soon page can be seen here - http://www.thedesigncoders.com/comingsoon. That page has a contact form on it that uses NHibernate to persist the data. This page looked and worked great on my development machine, but I got a rude awakening after deploying it. That rude awakening was an error - System.Security.SecurityException: That assembly does not allow partially trusted callers. What? OMG! Here was the first lesson for me - always run your project on dev using the same trust level as your production environment. Doing this
Now I was in a pickle. The error was occurring in Castle according to the error message. I used Google to investigate the issue. There were a whole lot of different things that people tried. One of them was to disable lazy loading. I nearly lost my lunch when I read that! I had set up Fluent NHibernate using its AutoMap feature and I had an EXTENSIVE database system with a lot of interconnected many to one, one to one and one to many relationships. Disabling lazy loading would basically mean that I might as well remove NHibernate and Fluent NHibernate and use Entity Framework. That, however, would have taken me a long time to do and it simply wasn't anything I even wanted to think about. I don't have anything against Entity Framework, but it took effort for me to set up NHibernate, Fluent NHibernate and StructureMap and I wasn't about to abandon my beautifully done project because of one stupid error. I was GOING to figure this out.
OK. So after viewing some blogs AND the NHibernate website, which suggested that I would need to go through hell and high water to get things to work, I decided to keep searching. Here are some of the articles I came across.
- Use NHibernate Proxy Generators
http://nhforge.org/blogs/nhibernate/archive/2008/09/23/introducing-nhibernate-proxygenerators.aspx
This would be good, but I'm using Fluent NHibernate's AutoMap feature so I don't use mapping files. That means that this is useless to me and it is likely unnecessary for you. - Disable Lazy Loading, Disable Reflection Optimization & Change Web.Config Permissions
http://nhforge.org/wikis/howtonh/run-in-medium-trust.aspx
No, no and NOOOOOOOOOOOO!!!!!!! Fluent NHibernate's AutoMap feature makes things REALLY easy for me. If I had to disable lazy loading on my project given how large the database is and how much work Fluent NHibernate saves me from doing, I would have a fit. This just WAS NOT an option. In fact, it was a beyond useless idea to me. - Rebuilding The Castle Project, NHibernate and Fluent NHibernate
http://blog.yeticode.co.uk/2010/03/running-nhibernate-in-medium-trust/
Hmmmm....this sounds good...... or so I thought! I would SIMPLY download all three projects, change the assembly in Castle to AllowPartiallyTrustedCallers, build it and use the dlls to then rebuild everything else. Great! I download the latest version of Castle and I start down that road. God/Allah/Jehovah/Jesus/Messiah/ HELP ME!!! It is times like these that make you feel stupid. I did all of that without thinking about ONE important (very important) thing - I didn't initially pay attention to the various versions of the files! Doooh!! Things did not match up! This version needed that version and that version needed this version and so on and so on. The problem wasn't JUST the versioning. Castle rolled its Dynamic Proxy into Castle.Core. It used to be its own project, but they changed this in the latest version. This meant that I had to change various parts of NHibernate. NHibernate was looking for a reference to Castle.Core AND Castle.DynamicProxy. I was starting to think about looking for a drink - and that says a lot because I have never had a drink of alcohol in my life! Fortunately, I figured out a different way.
I started thinking about the problem. The problem was that I couldn't set this project up on my chosen host because they don't allow people's apps to use full trust and the components I was using required full trust to do certain things. Surely I wasn't the only person who had this issue. In fact, I was positive I wasn't the only person with this issue because Google told me so (lol). Therefore, someone else had to have come up with a solution. I found that someone or a group of someones (I know this isn't proper grammar) had already solved the problem for their project. That project is called Cuyahoga. That brings me to solution number 4 -
4. When In Doubt, Use The Files Of Someone Else To Work It Out! (I love that rhyme)
Yeah! Now that is my kind of solution. After pulling out my hair by the root, this “solution” left me with 5 strands left! Cuyahoga is using NHibernate with Castle. Since they have already conquered the medium trust issue, I knew that their latest files should be sufficient for me. They don't use Fluent NHibernate (shame on them), but I knew that it would be nothing for me to download the latest source of Fluent NHibernate, add the dlls I took from Cuyahoga to the src and then compile everything. That is what I did and it worked like a charm. I swapped out the dlls in my project and I didn't have to disable or change anything else. Yes! Yes! Yes!
Here is the link to the Cuyahoga files.
https://cuyahoga.svn.sourceforge.net/svnroot/cuyahoga/trunk/lib
There you have it! Using those files will allow you to get everything running in a medium trust environment!
There are a couple of things that I found during my search that troubled me. There have been a lot of people who have had this issue. I would think that the open source project creators, especially NHibernate, would create source code that works in a medium trust environment. They won't. Making people do it themselves isn't necessarily a bad thing, but everyone doesn't want to spend time struggling to get things done. That is one of the things that makes Entity Framework appealing to the masses - for the most part, it just works.
Here is a link to one particularly onerous discussion surrounding the issue involving users and the Nhibernate developers. I found the whole character of the discussion to be completely distasteful. It shouldn't be so hard to do something that is so easy.
If you have this issue, don't fret, worry or drive yourself insane. Just get those files and make it happen. Do not, I repeat, do not disable lazy loading for NHibernate to make it work in a medium trust environment. That defeats the whole purpose of the tool.
Smooches,
Kila
Friday, September 24, 2010
How To Tell What Happened When Publish Failed In ASP.NET MVC
Smooches,
Kila
Wednesday, September 22, 2010
How To Uninstall Internet Explorer 9 Beta
On Windows 7 here is what you do:
- Go to Control Panel
- Select Programs And Features
- In the upper left hand corner, select View Installed Updates
- You will be provided with a list of updates, but you will likely not see Windows Internet Explorer 9 clearly in the list
- To find Windows Internet Explorer 9, go to the search box in the upper right hand corner and type in Windows Internet Explorer 9
- Windows Internet Explorer 9 will magically appear and you should select it and then hit the Uninstall button.
- The computer will uninstall the components and then ask you to restart.
- Once you restart, you will need to set up some attributes of Internet Explorer 8 again, but you will be rid of Internet Explorer 9 and ready to rock and roll.
Whew....lets not EVER do that again until IE9 is ready - lol!
Smooches,
Kila