ASP.NET
WebORB for .NET ERROR: Access to path is denied
I want to write more about my recent experiences with WebORB for .NET, an amf remoting solution to integrate Flex with .NET, but that'll have to wait until I complete this project.
The day was going along swimmingly and I was testing my services via the WebOrb management console when I bumped into this error message as I selected a new assembly:
faultCode:Server.Processing faultString:'Access to the path 'C:\inetpub\wwwroot\weborb30\weborbassets\codegen\{guid}.codegen' is denied.
Problem
Although I have generated code from the previous version of WebOrb 3.4, this error is coming from v3.5.0 and evidently my file permissions were not set to allow writing to that temp path. It would appear this was not correctly setup during the install.
Running the WebORB diagnostics page verified this under the heading of "WebORB Permissions Summary > WebORB can generate client code"
System.UnauthorizedAccessException: Access to the path 'C:\inetpub\wwwroot\weborb30\weborbassets\codegen\{guid}' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.IO.File.OpenWrite(String path)
at a.b(String A_0)
Solution
I granted the local IIS_IUSRS account modify permissions on my Vista workstation for the codegen directory, and this resolved the issue.
The diagnostics and console for WebORB have made this integration nearly painless.
Categories: ASP.NET • Flex • Permalink
Evidently Microsoft Thinks We Are Stoopid ASP.NET Developers
Because they are letting Rob Conery spend most all of his time educating us on MVC, TDD, mocking, scalable architecture, Linq, the (his) repository pattern, pipes and filters, IQueryable, dependency injection, and plenty more for FREE to you and me.
13 installments into Rob's MVC Storefront series and we readers/viewers have been beneficiaries of 5 plus hours of screencasts on overdrive. Rob not only jams a ton of information into his fast paced presentations, but he has also been including rich "interviews" with some of the brightest and best at Microsoft as he transparently carries us through and includes us in his decision making process. Then there are the discussions carried on in the blog comments and now forums where the community calls Rob out on issues, offers suggestions, and most importantly teaches me SO much.
Which brings me to the heart of what I'm loving about this series, what I find to be the best and most refreshing aspect: the character and attitude of Rob and his teammates. How they go about their business is more important than whether or not you know how to use dependency injection.
I get the feeling that once the recording stops these guys aren't backbiting and ridiculing one another. They seem to genuinely like each other, or at least respect each other.
Rob isn't working as an island, but he's working "agile" including his clients, the community, and his teammembers all along the way.
And it's not just Rob, but it's Scott Guthrie (who I suspect sets the tone for this behavior), Scott Hanselman, Phil Haack, Joe Stagner, Ayende Rahien ... and these are just the guys I know of. These guys love what they do and they don't seem to have a bone of elitism in any of them. Check out the tone of the blog entries below.
Phil Haack - The Design is Never Right the First Time
Scott Hanselman - Professionalism, Programming, and Punditry and Success as A Metric
I can't count the number of times I've heard one of them write or talk about Ruby or Java or some other non-Microsoft technology. For a good while I was reading the blogs of a few ASP.NET developers who were abandoning ASP.NET for Ruby on Rails, sentiments I understood and at times shared. And then the community got the ear of the ASP.NET team and now we are all evaluating the MVC bits.
Contrast that to a Ruby on Rails user group meeting I attended where the first 20 minutes were spent ridiculing (all in good fun, but still) other web technologies one by one.
Clearly, my title was in jest to get attention. What Microsoft is doing with their team seems to be working. It's certainly working on me; my passion for ASP.NET development has been rekindled. And greater than the FREE training we are getting on the why's and how's of the technology, we are receiving a phenomenal education on how to function as developers within a team and a community.
Other great resources on this topic:
The Pragmatic Programmer
Practices of an Agile Developer
And any of the blogs listed in the blogroll on this page
Categories: ASP.NET • General • Permalink
Using C# Arrays
I use arrays tirelessly in actionscripting, and I always found it odd that I don't use them much in C#. At least I don't use them in the same way.
I recently had the opportunity to remember some basic usage and thought I'd pass it along. I have a small list of strings and want to store them in an array so I can quickly search for the existence of a value.
To create the single dimension array looks like this.
string[] names = new string[] {"Toby","Lucy","Maggie","Rocco","Hank","Mallard"};
If you wish to initialize the size of the array it's just
string[6] names = new string[6] {"Toby","Lucy","Maggie","Rocco","Hank","Mallard"};
Then you can search the sorted array for the presence of a value by using Array.BinarySearch(). This returns the position of the value in the array (and not necessarily the first occurance), or a negative number if no matching item is found.
string[] names = new string[] {"Toby","Lucy","Maggie","Rocco","Hank","Mallard"};
Array.Sort(names);
bool exists = (Array.BinarySearch(names,"Toby") >= 0);
Just google C# arrays and you'll find a plethora of resources on how to use Arrays in your C# projects. C-sharpcorner.com has always been good to me.
Categories: ASP.NET • Permalink
Keeping up with ASP.NET MVC
I began with ASP and a little Access database some 14 years ago. I scrounged my way to become pretty adept at providing solutions with ASP, Javascript and SQL…until ASP.NET came out. That's when I think I got lazy. And I've never worked so hard at being lazy…a lazy programmer that is…building my classes and plumbing my database access and playing with my datagrids.
Probably 8 months ago I just became totally fed up with the performance and bloat of my ASP.NET applications…I wasn't getting the performance I thought I should.
Really, it was getting more into AJAX that brought me to this realization of my laziness. I, like probably everyone else, started using the magic Update Panel only to realize that it's really just hiding the fact that my page is doing a full page lifecycle postback. Ouch. So, I can add a progress panel to inform the user that I'm gonna be a while…nice. ahem.
Then I wrote my own javascript callback and rediscovered the joys of writing my own code. And it wasn't easy, but it felt good. You know, like when you exercise that muscle for the first time in years…it HURTS so good. My callback took a fraction of the time as my postback/UpdatePanel. And I was using html controls again, not server side controls. Is that allowed in an ASP.NET project?!
I hear you laughing at me. Like I said, I was lazy. Those server side controls with all their built in wonderfullness can lull me to sleep while I wait for them to finally load in the page.
So, I was rediscovering the joys of really going back to the way I was coding in my ASP days, but in C#. But I was pissed at WebForms for having done this to me (like WebForms really have a mind of their own and a malicious intent to harm me).
And do you know where I turned? Ruby on Rails.
Do you know what I found when I got there? A bunch of pissed off Microsoft ASP.NET developers much more talented than I.
What does any of this have to do with ASP.NET MVC? I am so very excited about what I'm seeing and learning because it's like RoR is coming to ASP.NET. It definitely has me excited again about being an ASP.NET developer.
As a results, I'm following this very closely.
Categories: ASP.NET • Permalink
My Relationship With 3rd Party Controls
There comes a point in this developer’s relationship with his faithful sidekick, the 3rd party control, when faith is broken.
Things have been going along well, everything I read on the website that the control could do is working, and everything I believe the control should do succeeds (beware the false expectation). The sun is shining and all is well with the world. And then it happens: something doesn’t work. Suddenly (well, it’s not sudden at all….) a black hole opens up and sucks away 2, 3, 4, 12 hours of my life trying to figure out if I’m doing something wrong with the control or if the control just flat doesn’t do what I thought it would.
Asking the right question is key to getting the right answer. I get that. So, I generally assume I’m a knucklehead and have done something wrong or incomplete.
My phases of conflict resolution with the offending sidekick go something like this:
1) Documentation - is there an example of what I’m trying to accomplish that I can mimic? Is there a tutorial or decent reference entry to tell me that the property TextWrap is not just a boolean but will infact override every width setting and take my column from 760 pixels to a nicely (right) stacked column 20 pixels wide.
2) Latest Version - do I have the latest and greatest? I don’t want to update to the latest unless I KNOW it solves my issue or discover it has strong merit otherwise. Who needs to swap 1 problem for 10.
3) Knowledge Base - can you tell me anything I don’t already know that I don’t know from the documentation? No? Ok, next.
4) Forums - aha, my friends the other knuckleheads are out in force and I will now likely discover that it’s not just me. Comfort at last…wait, it doesn’t work and the vendor (apart from promises) will not be doing anything about it even though every other vendor listed provides that same functionality. Well, at least I know have a list of other sidekicks to interview.
In fairness, I more often than not find the solution at some point along the way, and will on occasion jump straight to the forums for a quick search. And, of course, Google is a developer’s best friend.
Here are some of the ASP.NET sidekicks that have served me well in the past.
ComponentArt WebUI - I have had success with the menu, tabstrip, navbar, treeview and breadcrumb. I like the various design samples which makes bidding and creating comps easier.
Cute Editor - This wysiwyg editor weighs in a little on the heavy side, but has been extremely customizable and useful for me. I’ve liked the integrated file upload and image editing capabilities, but I’m not so much a fan of the client assets that I need to deploy along with the site.
Intersoft WebGrid - I use this control extensively in an intranet project where we needed a lot of onscreen filtering, grouping and sorting made easy. For that this grid fit the bill, but again is another control I’d say is on the heavy side. I would be extremely reluctant to use this grid elsewhere. I tried using their combo box control which had some promising features, but in the end was never able to deploy it. This was at the very early release of the ASP.NET Ajax toolkit and the combo box was just too buggy.
Do I even need to say I use the ASP.NET Ajax framework and Ajax Control Toolkit? However, you will not catch me using the update panel, sorry.
Other controls I’ve used:
* Telerik RadControls Editor - used it a little and it seemed ok. Felt bulky and loaded slowly
* TinyMCE - seems very lightweight and robust. This is one I’d like to spend more time with.
And while they don’t qualify as controls, I have at times found the following ORM and data access pieces invaluable:
* Enterprise Library and before that SqlHelper
* SubSonic - love it, but why in the world is MySql in medium trust such a nightmare?!
* EntitySpaces - ok, I haven’t used this one yet in production because SubSonic has done very well, but gimme a week and I will. The ability to use SQL and MySql in medium trust is invaluable to me with the clients I have. Darn you SubSonic, why do you push me away?!?!
So who are your sidekicks that make life easier for you?
Categories: ASP.NET • Controls and Components • Permalink

