| Jason's profileJason's .NET BlogBlogLists | Help |
Jason's .NET BlogMy experiences with Microsoft.NET and more September 03 BizTalk BAM Portal failure and configuration woesWell ... BizTalk just never fails to surprise me with the "one-thing-after-another" issues which I run into...
Symptom ...
I did a fres BizTalk 2009 install on a virtual machine for some PoC deveopment ... went to prepare a demo of BAM and the BAM Portal and when I hit the website it just failed with a generic message. Well ... as is standard practice at this point it MUST have been something I did wrong ... so I decided I needed to fix the issue by re-configuring the BAM Portal.
The First Try ...
For some reason, I had the bright idea that I should delete the BAM Portal web applications and app pool before un-configuring. I did that, restarted IIS and ran the BizTalk configuration tool. Next, I un-configured the BAM Portal and completed the wizard ... no problems, right? Of course not! When I went back into the BizTalk Configuration Tool to configure the BAM Portal feature the services accounts and website options were disabled!
The Second Try ...
It turns out that the BAM database was still configured to point to the original website even though I had unconfigured that feature. So, according the this blog post I needed to use BM.exe to remove that configuration information.
The Fix...
Conclusion... Nothing in BizTalk is as it seems August 26 BizTalk Error: Failed to grant permission to execute. (Exception from HRESULT: 0x80131418)Here is an issue I ran into for BizTalk 2009 when using the WCF-BasicHttp or WCF-WSHttp adapter.
I received the following error:
The adapter "WCF-WSHttp" raised an error message. Details "System.Security.Policy.PolicyException: Failed to grant permission to execute.
What was I doing?
What I was trying to do is expose a schema as a web service endpoint so that any calls to that service would dump that message straight to the message box. Now ... not wanting to expose my internal schema I created a schema definition especially for this service and a corresponding map to map it to my canonical/internal schema. Deployed the solution.
Next, I used the handy BizTalk WCF Service Publishing Wizard to create the .svc and ports, etc. I then updated the Receive Port to run the map. When I tested the endpoint I got the above error. I then removed the map and the test ran succesfully (albeit with my intended map).
What the heck was happening?
Well ... as luck would have it I had quickly ramped up this virtual server environment and put the portal on port 80 which meant WSS was running on port 80. Upon inspecting the .NET Trust Level for my web application it was set to WSS_Minimal!!! Arggg! I had spent way too much time on this one!
What was the fix?
Just some things to remember when setting up a web application to run a service into BizTalk:
Well ... hope this helps someone else! May 26 Visual Studio Team Test: Web Tests and IE8I ran into an interesting problem while trying to create a demo for Visual Studio 2008 using the Web Test macro recorder (IE plugin) and Internet Explorer 8.
The test website I had was on my local PC so I started recording and typed in the localhost address. Suddenly, the macro recording stopped and only had a message stating the the recording had to be initiated via Visual Studio. Also, the recording had stopped within Visual Studio as well ... no steps were added to the test script.
After scratching my head, searching the net, and gazing into the air I realized that IE was switching from the Internet Zone (for the default about:blank page) to the Local Intranet Zone (for my web site). To fix this, I manually added about:blank to my list of Intranet sites and everything worked as expected.
I am not sure if there is any more legit fix to this but this worked fine for me! April 06 Silverlight 2.0: Creating an Offline Application (Smart Client), Part 1The following is part 1 of a series of posts for creating an offline application using Silverlight 2.0 Introduction Once of the alluring aspects of Silverlight is creating an application with a pretty broad reach (cross-platform/browser) using technologies familiar to the “Microsoft Developer” (C#, VB.NET, etc.) together with some common application patterns (smart clients). This series of posts is intended to plug the gap in creating a Silverlight 2.0 application that completes the “smart client” pattern with occasionally connected (read: “offline”) features. Problem Silverlight does have many of the aspects of a “smart client,” such as …
… and some added of it’s own:
However, it currently lacks formalized support for the most prominent feature of being occasionally connected. Customers, however, are unwilling to compromise and want all of the above, together, without having to learn a new platform and a set of technologies (like Flash, for example). Silverlight 3.0 promises new features to help in implementing these new features it is not out yet (in Beta at this time) and customers may already have a need for Silverlight today or have existing application in Silverlight 2.0. Solution The good news is that, with one exception, Silverlight 2.0 is fully equipped to handle the offline scenario with little additional effort over what may be coming in 3.0 or what you may have today with other Smart Client or Rich Internet Application (RIA) technologies. The following techniques will be demonstrated in the upcoming series of posts:
Companies can create fully disconnected application today in Silverlight 2.0 and I’ll walk you thought the process in upcoming posts. If you would like to see anything specific please feel free to add some comments and I’ll try and incorporate those into subsequent posts. April 03 Silverlight: Cloud ConnectedA few weeks back I delivered a presentation on connecting Silverlight to services (web, SOAP, REST, etc.) as well as some practical real-world offline caching of data.
Here was the actual agenda from the slides:
The slides and demo code are here: http://drop.io/jagostoni. January 19 Review of online game trading sites: Goozex, SaySwap, GameTZI put up a review of some online game trading sites on AdultGamingEnthusiats.com ... check it out: Do you have a bunch of old games you want to sell/trade? Gamestop/EB is always an option, but we all know they have some pretty crappy trade in prices. You could always try one of the many online game trading sites. But, which one is best? See this review to get a better idea of what to expect from these online game trading services.... http://adultgamingenthusiasts.com/blogs/age/archive/2007/01/18/review-of-online-game-trading-sites-goozex-sayswap-gametz.aspx November 16 SOA - Service-Oriented ArchitectureI just completed another webinar as part of CEI's .NET Webinar Series. This time, the topic was Service-Oriented Architecture (SOA) with demos using WSE 3.0. You can download the slides and code below and if you have any questions you can either post them here or email myself or Eric directly. The agenda was:
- SOA Slides - Demo Code July 14 Visual Studio Unit Testing an asynchronous event callbackProblem ...
Here's some code:
You can make modifications to this so that the calling method does not wait indefinitely as well as other handy mods. If you come up with anything cool please drop a comment here so everyone can share in your find!
May 19 Atlas - AJAX Programming for the .NET 2.0 FrameworkI just completed a webinar on using Microsoft's Atlas framework for creating "AJAX" applications in ASP.NET 2.0. Despite that one of my demos failed to work (my poor, poor typing skills) the webinar went well.
The webinar started with an introduction to AJAX with a little (read: cheesy) demo of AJAX using a text editor and a browser. The presentation moved into an overview of the Atlas framework and a decription of the client- and server-side architectures and improvements. Of course, this all included some more cheesy demos (yet representitive) of:
For anyone that wants them ... here are links to my slides and code: For more information I recommend you check out the Atlas home page at: http://atlas.asp.net . April 17 Code Camp: Creating .NET Solutions using OSSOn April 8's Southwest Pennsylvania's Code Camp I presented on creating .NET solutions using open source software (OSS). The demonstration went quite well and I received a very generous response from the audience. Thanks to all who attended and made this first Code Camp quite a success! The premise of the presentation was to demonstrate that it is completely possible to create .NET solutions (specifically an ASP.NET web application) using free and open source tools. I used a GNU/Linux based laptop (Ubuntu) with the following tools:
The slides, code and documents are all freely available for download here. Use them however you want (at your own risk, of course If you have any questions or comments please feel free to drop a comment on this entry! April 10 SharePoint Redirect using only IISHere is a quick solution to an small issue we had here at work... One of our internal users (of our SPS instance) wanted to redirect an old list to a new list. I did not want to create a code-based solution (e.g. an aspx page, et al) and with the friendly "Apache could do this" jabbing I got from this guy I decided to see if IIS would handle it. And it did ... really easy: Example: Redirect http://mysite/sites/Department/IT/oldlist to http://mysite/sites/Department/IT/newlist
All other sites in that path should remain untouched by IIS but since IIS processes this redirection prior to running the ISAPI filter/extension (e.g. SharePoint) then there is no need to even unmange this path from within SharePoint itself. Simple. Clean. Quick. Even an Admin can do it! April 02 Southwest Pennsylvania Code CampOn April 8, 2006, we will be having the first (as far as I know) Code
Camp in Pittsburgh. As both an organizer as well as a presenter,
I encourage everyone in the area to attend this free event. There are no corporate sponsors and all of the presenters are from the community doing presentations and demos for the community. There will be free lunch (I think) and plenty of free information! For more information, please check out the Code Camp website: http://www.pghdotnet.org/CodeCamp/default.htm. My presentation will be on creating .NET solutions using free/open source tools! It was interesting to create the demo so I hope that remains when I actually give the presentation. February 17 Getting and Setting a SecureString in .NET 2.0SecureString Class
January 26 SQL 2005 Reporting Services and Sharepoint Web ServicesIntroduction One nice addition to SQL 2005 Reporting Services is the ability to have a XML Data Source (e.g. Web Service). However, getting it to work seems to be a little trickier than need be, especially for SharePoint's web service. The Problem Following the example in the SQL Books Online makes it look like you can apply it to just any web service but you'll end up fighting with the parameters if you do as they simply don't get properly serialized. After researching the issue and combining several different answers it comes down to the XmlDP Query syntax. The syntax which works looks like this (using GetList as an example): <Query> <Method Namespace="http://schemas.microsoft.com/sharepoint/soap/" Name="GetListItems" /> <SoapAction> http://schemas.microsoft.com/sharepoint/soap/GetListItems </SoapAction> </Query> The difference from the books online is the <Method> node which seems trigger something in RS to handle the issue. One other note is that even with the Method node, SSRS is still picky about the parameters so I have pretty much gotten by using only the essential parameters. I haven't really built upon this example too much further but feel free to leave a comment if you have. The Recipe The following instructions assume an existing report but they should still work just fine using the add report Wizard.
October 07 InfoPath stops loading drop-down values from data connectionA very strange problem indeed ...
We have an InfoPath (SP1) form the has a handful of drop-down lists each of which gets its values from a secondary data source. This data source, in turn, gets its data from a web service. Very straightforward and very "working." That is, until it randomly stopped working.
We could not figure out why it stopped as we hadn't made any major changes. Although, we did frequently update the data connection between dev and deployment servers so we thought the constant back-and-forth somehow screwed up the various XSDs and XSLs that are in the InfoPath solution. Given our assumption, we deleted the data connection and replaced it (no dice) then deleted the drop-downs and the data connections and still no luck. As a last ditch effort we reverted back to an older version of most of the files, deleted all binaries, cleared all cahces. Same behavior! What the ....
After many many many hours of trying different combinations of everything we could think of ... I decided that we needed to re-create the view. However, there are well over one hundred fields on this form so doing this from scratch was simply not an option. So, on a whim, I created a new view, cut/pasted the default view's content to the new view, deleted the old view and made sure the new view was set as the default view.
Now everything works fine. Go figure! October 06 Events not firing for controls in the HeaderTemplate of a RepeaterProblem
At a client's site, we were making extensive use of Repeater controls to render data piped to it via a custom entity and collection. In addition, we wanted to implement sorting in the repeater using LinkButtons which were rendered in the HeaderTemplate of the Repeater. So for so good ... seems like a pretty reasonable request and it works.
In addition to this, we also hosted these Repeaters (amongst other UI elements) in a UserControl so that we could take advantage of the WYSIWYG design features of Visual Studio.Net. These UserControls, in turn, were to be re-used in several aspects: hosted on ASP.Net web pages, loaded dynamically into server controls, and loaded dynamically into SharePoint WebParts. The last was the most important as prior to ASP.Net 2.0 there are no easy WYSIWYG methods for creating WebParts so we decided to host UserControls inside WebParts.
At this point, the UserControls worked just fine when hosted on an ASP.Net web page leading us believe everything was ok. We dropped the user controls onto the test web page and used the Page_Load event to pass data into the control to be rendered. The LinkButtons that were in the header of the Repeaters re-sorted the data and everything looked great.
Next came the WebParts
At this point we created WebParts that were designed to host the UserControls and pass along any personalization and configuration properties from SharePoint's Storage to the UserControl. Again, everything appeared to be working great with one exception: The LinkButtons were no longer sorting! I figured it had something to do with the fact that I was lazy and did all of my work in the RenderWebPart method (no need to lecture me; I have learned my lesson). I moved the call to Page.LoadControl to the CreateChildControls() method where it should have been the entire time. This would assure that the UserControls were created and added to the Page's collection in time for the events to fire. Almost there....
Still ... the events did not fire but I still had a little bit of laziness left in me. My thoughts went back to when I gave SharePoint WebPart development training. In my own words were: "You should create the controls in CreateChildControls, load them in the Load event of that control, and ONLY render them in RenderWebParts." Of course, there is a reason for this which I now realize.
In a Repeater control, the HeaderTemplate (and FooterTemplate) is not created until the DataBind event is called and, thus, any controls in the template will not exist until that happens. In my laziness I had not moved the actual loading of the data in the UserControl out of the RenderWebPart method so while the control itself was getting added to the controls collection at the correct time, the LinkButtons did not exist. Following my own advice I moved the loading code into the UserControl's Load event (on the web part) and now everything works as advertised.
The Moral
Having passed my ASP.Net MCP ... I should have known better. Having uttered the words in training that would have prevented this from being a problem in the first place ... I should have known better. Being lazy at the wrong time ... priceless. August 22 Oracle 9i Client and System.Data.OracleClientIf you haven't yet upgraded to a newer Oracle client (e.g. 9.2) or you
are having problems with your current Oracle client (9i or higher) then
you will need to take a few steps to make your client work as you might
expect. There are two main considerations:
Typically, companies will centralize the tnsnames.ora files (used for resolving Oracle service names) but putting it on a fileserver and pointing to it in the registry. This works just fine for Oracle's toolset and many other client programs with the exception of the System.Data.OracleClient ADO.Net provider. The provider, for some reason, expects this file to be installed locally (example: c:\oracle\ora92...\tnsnames.ora). Installing (and perhaps mirroring from a network share) locally will take care of the first requirement. Permissions For some reason, the permissions for the "Authenticated Users" user is not fully propagated throughout the Oracle client install. The fix for this is straightforward as well:
August 11 Proper source code management of your Visual Studio 2003 solutionsSource Control, and thus products like Visual Source Safe or CVS, is obviously an important part of your software development life cycle but can also be a source of frustration (especially for ASP.Net web projects). It is important to have a standard, repeatable method for any process in your SDLC including your project structure and source code management. Visual Studio makes this even more important for ASP.Net projects given it's natural tendency to put all of your web projects under wwwroot. While this is a perfectly acceptable solution for some teams, many prefer to have their entire project under one folder structure. Reasons for this range from obsessiveness to easy of backup to convenience. Below is a good (mission tested) method for source code management in Visual Studio. Step 1: Decide on your folder structure in advance Through experience, anecdotal and empirical evidence, common sense and (of course) trial and failure many people in the industry have come to agree that to following folder structure just makes sense. ...\SystemName\SolutionName\ProjectName System Name represents an overall name for your system (like EcommercePortal) and allows you to group not only more than one Visual Studio.Net solution but other components of your project as well (documentation, diagrams, etc.). Solution Name corresponds directly with the name of your VS.Net solution. If the folder does not represent a VS.Net solution then common sense prevails on your naming and hierarchy from this point on. Finally, Project Name is simply the name of your VS.Net project where the solution folder can have one or more projects in this branch. The root location of this structure does not initially matter (e.g. on team member can use d:\SystemName... while another uses his My Documents folder); However there are certain cases where the full physical path makes a difference. InfoPath projects, for example, become much more easily managed if all team members are using the exact same physical path. Step 2: For ASP.Net web projects, pre-create your folder structure At this point, if your solution is going to contain one or more ASP.Net web projects you should create the folder structure in advance in preparation for the next step. The following would be an example of a full folder structure for an Ecommerce web front-end: c:\Projects\EcommercePortal\EcommerceSolution\EcommerceWeb
Step 4: Create your solution At this point, you can finally begin creating your Visual Studio.Net solution that will contain your projects. Using Visual Studio, create a new Blank Solution, name it appropriately, and save it in the directory you created above. Continuing this example, your solution file should be created as follows: c:\Projects\EcommercePortal\EcommerceSolution\EcommerceSolution.sln
Step 5: Add the empty solution to source control Now that you have your folder structure and blank solution you can start putting it into your source control system. This will pre-create the structure you have so far and make the rest of the processes a little bit simpler. The following list demonstrates this using Visual Source Safe:
Step 6: Create your project(s) You can now add projects to the solution as you normally would with one note: For ASP.Net projects make sure that you name your project the same as the virtual directory you created above. If you are prompted, check out your solution file.
Step 7: Bind your project to source control With the exception of ASP.Net projects, your solutions will be properly created under the solution directory when you check them into source control. However, ASP.Net projects will not be created where you anticipate. The following instructions will re-bind your ASP.Net project under the correct hierarchy:
Final Step: Getting the source tree from source control You now have your entire system, solution, and projects checked into your source control system in a manageable hierarcy. However, there is still one more precaution the rest of your team needs to take before they begin working with this system: they need to get the entire source tree back out of source control without undoing any of the above steps. The safest and cleanest way of getting the source tree is to follow Steps 2-3 above, then use Visual Studio.Net's "Open from Source Control" wizard (under File->Source Control). You will need to navigate down to folder/project where your solution is under source control and make sure your local path in the dialog matches what you created in Step 2. Another method is to use your source control client to get a local copy of the source tree (outside of VS.Net) and then create your Virtual Directories (as in Step 3) for your web projects BEFORE you open the solution in VS.Net August 02 Checking in BizTalk file before editing can corrupt the fileWe've all been there... When you are working with a team of developers (whether two or ten), who are collaborating on a project in Visual Studio.Net, there certainly is the chance that you will need to add a new file to the solution. Of course, to do this you have to check out the project file locking it for yourself. Play Nice! The courteous thing to do (karma, right?) is to add your file and immediately check in the new project file with your newly added file (as long as it doesn't break the build :) ). Try doing this in BizTalk sometime (if you already haven't) and watch the quick destruction of your file. Once you start editing that file again and check it back in you get a nice little warning about the encoding type changing. Visual Source Safe does not handle this very gracefully; Visual Source Safe does not handle this at all. You will be fooled into thinking your file is safe because you are working with the version on your local disk but the next time one of your team members gets the latest version of your project the file will be toast. What the ...? The issue here is that when you create new files in VS.net it likes to create them as UTF-8 encoded files. Seems like a good idea; a nice standard encoding type. BizTalk, however, has to be different and save everything as UTF-16. Once again, another nice, standard format. However, visual source safe is completely oblivious to the change in encoding types an will gladly assume that your are still managing a UTF-8 encoded file. The Moral You can still be a gracious team member and have a quick turn-around on adding new files to the project but just give those files a little edit first before you check everything in. July 26 True != true ... duh!Ok ... so once again one of the simplest of errors put me into out-thinking-myself mode. Simply put, when you have a boolean in an XML file that goes into a BizTalk Orchestration, it is case-sensitve.
So if you get an error stating that you have invalid text for your System.Boolean type then now you know: "True" is not true ... "true" is true.
Put this on under the "duh" category. July 24 Using Jalindi Igloo plugin (CVS) with VS.Net ... successfullyIf you need to use CVS for source code control on your Visual
Studio.Net project, here is a quick way to enable the latest version of
CVS in combination with the free Visual Studio.Net add-in: Jalindi Igloo. The
plugin does have it's own install program and scripts but the problem
is that it uses an older CVS library and does NOT work well with SSH
connections to a CVS repository. While the older version may work
well for you, I certainly suggest you always use the latest CVS client
for at least security reasons. First, download all of the following packages:
Next, install the CVSNT client as you normally would making sure to note the location of the install directory. Once that is installed, open the beta version Igloo archive and copy the files into the CVSNT directory (ignoring the paths). But first, please note: *** DO NOT OVERWRITE ANY FILES IN THE CVSNT DIRECTORY *** The
beta igloo client has some older CVSNT files and you don't want to mess
up your install. After that, you just need the nice VBS scripts
provided with the release version of Igloo. One script will
register the plugin as your SCC provider in VS.Net and the other will
restore SourceSafe as your client. Problem naming a BizTalk operation ReceiveMessage or SendMessageHere was a strange one that took me a while to nail down. First, the error messages:
After searching for a few hours on the Internet for that one and playing around with recent changes I had made I finally had realized what I did: I was getting a little too creative for my own good (or not creative enough, perhaps).
I decided that Operation_1 and Operation_2 were not good names for my receive and send ports so I decided to name them something else. Of course, in a burst of creativness I used 'ReceiveMessage' and 'SendMessage' for the names. I had done that a while back but apparently never did a build as I made several other changes since. Then I compiled and got the errors above on the receive port.
Figuring it had something to do with the ports I decided to just nuke them and recreate them. I used my usual internal justification that Microsoft's software had somehow screwed up my code (uh ... it never turns out that way). After doing this everything compiled just fine once again. Ah Ha! It was Microsoft screwing up my code! Then I immediately went and renamed the ports once again to my ever-so-creative names and boom.
DOH!
Moral: Either get very creative with your naming or have a complete lack of creativness altogether. Don't sit in the middle. |
|
||||
|
|