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.NETFlexPermalink

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.NETGeneralPermalink

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.NETPermalink