Wes Weeks

  Home  |   Contact  |   Syndication    |   Login
  17 Posts | 1 Stories | 34 Comments | 3 Trackbacks

News

Twitter












Archives

Post Categories

Monday, September 28, 2009 #

Struggled to get a Silverlight Application to load in the browser.  Checked and double checked that the .xap mime type was succesfully registered.  It was working correctly on our other machines.

The .xap file was in a folder called ClientBin.  Tried connecting directly to the xap in the browser by navigating to it directly, and it was found, something that wouldn't have happened had the mime type not been correctly registered.

Turns out the cause was a 'Debug' folder that was also in the folder where the .xap file was located.  Although this folder was empty, for some reason silverlight was checking/looking here anyway even though the source setting in the object tag was set correctly.  Removing this empty folder solved the problem.


Wednesday, March 04, 2009 #

You gotta love this work sometimes...

Spent the last few hours trying to get an ASP.Net web/silverlight project to compile.   Every project in the solution would build fine but the web project wouldn't .  The frustrating part is the compile was showing 0 Errors so I didn't know where to start.

In the past these kind of strange errors have been fixed by numberous methods and I tried them all:

  • Deleting everything from the bin and obj directories
  • Recreating the project
  • Recreating the solution
  • Deleting and re-adding all references
  • Deleting and readding the silverlight application
  • Rebooting the computer (the universal cure)

Nothing worked.  There were a few pages I found on a FWSE that mentioned similar issues but nothing that seemed relevant to my situation.  Started getting very frustrated.  My computer can kick my ass at chess, but I'm pretty sure I can take it in kickboxing and I was about to let it find out...

Then I remembered the MSBuild output window.  I wasn't displaying this (I don't think it displays by default anymore) and turned it on and then went into options in visual studio to deliver a detailed output.

There the problem was:   Task "RdlCompile" -- FAILED

The issue turned out to be an RDLC (reporting) file.  There were a lot of warnings coming from this report, something about overlapping fields, but nothing that gave any kind of indication that it would keep the app from compiling.  The warnings only indicated that there might be rending problems, so I wasn't concerned about them.  Guess I should have been.

Long story short, removed the offending report and the application compiled.

Hopefully I can save someone else out there some time and grief...


Monday, February 23, 2009 #

When developing for CRM, we like to keep our business login contained within its own class to be shared and used by other parts of the system.  Most all of our CRM implementations have other applications accessing CRM in one way or another so this approach works well.  This was fairly straight forward wtih the 3.0 callout model, you just had to put them in the same directory with your custom callout  (C:\Program Files\Microsoft CRM\Server\bin\assembly\  in most cases) .

The way around this is to either put your assemblies in the GAC, or drop the assemblies in the bin directory of the CRM Web application (which is the route we chose).

Another caveat is your assemblies MUST be signed.  This was a bit of a pain to get working because we had a few unsigned third party assemblies and a signed assemblie can only reference other signed assemblies.  Probably the biggest issue was the Plugin deployment tool registered the unsigned assemblies without any issue, and we were without any error messages explaining why our code wasn't running.  In CRM 3.0 you could use unsigned assemblies by setting a config setting to 'allowUnsignedAssemblies' to true.

Hope these two pointers helps you out with your development...


Wednesday, January 28, 2009 #

We are building an application in Silverlight 2 using WCF for data access.  Everything has been going fairly well, but one of the developers on my team came across this error trying to insert some data:

"The remote server returned an error: NotFound"

Now the error seems to suggest that there is something wrong with the service.  Binding isn't correct, something wrong with the contract interrface, etc.  If you've ever tried to debug a silverlight applicatino, you know you can't attach to it with something like fiddler to see what traffic is being sent across the wire.  Very frustrating and significant time was spent  looking into the problem.  There are several posts on this issue and they all seem to suggest that this is where you need to look.

Turns out it had nothing to do with WCF.  The method being invoked by the web service was erroring but the error information itself wasn't being propogated.  It was sending this 'NotFound' message. 

So if you run across this problem, right some tracing or test cases to ensure the method wrapped by the web service itself works.  I beat the developer on my team with a wet noodle for not having tested his method prior to exposing it as a service.


Thursday, January 22, 2009 #

Received an error Could not load file or assembly 'PresentationCore'  when trying to deploy and run a WCF service project.  It had been working fine for months without issue.  Turns out that the PresentationCore.dll had somehow been copied to the bin directory.  Removed this file and the site worked.

Still trying to figure out how/when this occured in the build...


Wednesday, January 21, 2009 #

Running Windows Vista 64 bit, Sql Server 2008 on a remote server.  Using ASP.Net and the Report Viewer control on an asp.net page for a local report.  Was also using IIS to host the web site instead of using the web server built into Visual Studio 2008.

Searched and tried everything I could find on the net trying to fix this freaking error.  On a whim (and because I didn't know what else to do and was trying everything I could think of) changed the IIS 7.0 app pool to the classic app pool.  Angels came singing down from the sky and my report worked.

What a PITA!  Hope this post helps someone else.


Sunday, September 07, 2008 #

While performing an update to some code originally written for CRM 3.0 which I was upgrading to 4.0 and using the new 2007 version of the web services, I found myself getting an unusual error during one of the callouts.  The code created a new custom entity from the data in an existing entity.  This code was orginally written by another party and I"m not sure why they didn't use the mapping features in CRM to do this but it was coded manually.

The entity with typecode '8' was not found in the Metadata Cache.

Never having seen this before it of course took a lot of time digging through the event viewer and trace logs to find the source of the error.  In this case, it came down to one line:

newEntity.OwnerId = originalEntity.OwnerId

In a nutshell: the 'type' attribute on the originalEntity which had just been read out of CRM using the web services was '8', however when creating/setting the type on create the attribute field needs to be the name of the entity.  In this case, since the owner was a system user, the type field needed to be set to 'systemuser'

One would think that the inbound and outbound values could be the same or possible set up to parse for both a type code of or the type name.....

Anyway, if someone else comes across this or a similar problem, I hope this helps.


Friday, August 29, 2008 #

The CRM 4.0 installer has a nice new feature.  The ability to get upgraded setup files prior to running the instalation.  A nice step forward to hopefully address setup issues which are often present in the first release of the components.

Now for my Grip...

I've rarely been lucky enough to get it right the first time.  Usually I have to run the installer, fix a few things, and repeat until succesful.

The problem is that their isn't any 'memory' of the upgraded setup files.  If you have to run the installer a second time, you have to download the files again.  The connection I had was slow enough that it took nearly 20 minutes to update the setup files the first time.  When it came around to do it again, I wasn't patient enough to even consider going through that pain a second time and skipped the update.  I'd prefer not to go with that approach ;)

So if anyone from the MS team gets this message somehow, keep the upgrade strategy but provide a way for the updates to e maintaned or downloaded as a seperate file.  Will help us in he trenches out quite a bit.


Thursday, August 28, 2008 #

While performing an upgrade from Microsoft Dynamics CRM 3.0 to 4.0, the upgrade installer halted early on with the following error message:

Microsoft.Crm.Setup.Server.ShutdownCrmServerAction failed

Turns out that at some point the IIS Admin service was shutdown and disabled.  Not sure how this occured since I had been running CRM 3.0 just prior to the install.

So if you get unlucky enough to get this message, open up your services and Enable/Restart your IIS admin service.  The setup continued without a hitch after that.


Friday, August 22, 2008 #

After installing sp1 on Windows Vista, my previously created web sites would no longer start and I got the following error:

WebDev.WebServer.exe has stopped working
Unable to connect to the ASP.NET Development Server

with the following exception:

System.Net.Sockets.SocketException was unhandled
  Message="An attempt was made to access a socket in a way forbidden by its access permissions"
  Source="System"
  ErrorCode=10013
  NativeErrorCode=10013
  StackTrace:
       at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
       at System.Net.Sockets.Socket.Bind(EndPoint localEP)
       at Microsoft.VisualStudio.WebHost.Server.Start()
       at Microsoft.VisualStudio.WebServer.WebServerApp.Main(String[] args)

The work around?  Unbind from Visual Source safe, delete the web project from the solution, rename the folder where the website is stored and then re add to the solution as an existing web site and then bind to source safe again.

While this works, I would prefer not to have to rename every folder where I have a web site.  The issue appears to be that somewhere Visual Studio stores all of the information about a web site that has been created.  If you don't perform the folder rename, when you add the web site back in you will see that it has the same dynamic port settings it had originally.  It is renaming that forces the new port and whatever else is going on behind the scenes that restores the functionality.

I've tried to find out where this site info is stored so I can delete it or correct it, but have been unsuccessful.  I've searched in the registry, tried deleteing the temporary asp.net files and poked around the numerous config files and have been unable to find it so I'm stuck with the rename option.

Does anyone know where this is stored or how to clear it out so VS will reset itself for these sites?


Friday, April 25, 2008 #

Another issue that may be faced when deploying custom .Net applications in the CRM root directory is the following error:

'Microsoft.Crm.WebServices.Crm2007.MultipleOrganizationSoapHeaderAuthentica­tionProvider,
Microsoft.Crm.WebServices, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' doesn't exist.

You can resolve this one of two ways...

1.  Add the following to your applications web.config (not CRM's web.config!)

<assemblies>
<clear/>
<add assembly="*"/>
</assemblies>

2.  Go to the crm bin directory for IIS and either copy the Microsoft CRM.WebServices.dll to the GAC or to the bin directory of your custom ASP.Net application


Working for a client on an upgrade for 3.0 to 4.0 with an application that was in place under the CRM IIS directory as a virtual directory.  Struggled trying to get this to work and respond as it did under 3.0.

Basically, the site would work if it was it's own web site, but not as a virtual directory.  To make matters worse, the only thing returned when you navigated to the site was a blank page.  None of my code was executing and I wasn't getting any type of error message.  Tried messing with every IIS 7.0 setting that seemed to make sense and even a few that didn't

Didn't know what or who to blame.  CRM 4.0?  Windows Server 2008?  My brother-in-law? (because he owes me money and I blame him anyway)

The issue is that you cannot access to your custom application from IE because CRM 4.0 is running a .NET HttpModule and that .NET HttpModule is re-writing the URL depending of the organization (default organization normally.). This is a normal execution because of the multi-tenancy capability of CRM 4.0 and that is why you are not able to execute the ASP.NET pages from IE.  IE is not finding that changed URL.

In fact, that HttpModule is declared within CRM web.config as the following:

<httpModules>
<add name="MapOrg" type="Microsoft.Crm.MapOrgEngine, Microsoft.Crm, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</httpModules>

So, if you want to deploy and run your custom ASP.NET application within the same IIS WebSite where CRM is running, what you gotta do is to specify within your custom app’s web.config that you want to get rid of that kind of filter (HttpModule). Please, note that I am talking about changing your own custom app's web.config. Do not touch CRM 4.0 Web.config, ok

So, if you go to your custom ASP.NET application folder and then you open your own Web.config, if you add the following directives, your clean that CRM filter, so you’ll be able to run your custom app from IE.

This is what you have to add to your own web.con file:

<system.web>
<httpModules>
<clear/>
</httpModules>

Problem solved.  Still blaming the brother-in-law though....


Wednesday, April 05, 2006 #

As an MSDN subscriber, we get a monthly DVD with recent webcasts.  Sounds great.  Time saved searching and downloading from the site, all the recent webcasts in one place, etc.  We use webcasts and online training regularly for keeping our developers and consultants up to date and informed.

As nice as it is however, several shortcomings....

First, why do they only send 8 or 9?  Not because of capacity, the last full CD had only 145MB used space.  And why not DVD?  They could potentially send all new webcasts for the month. 

And why can't they keep the series consistent?  If you are going to have several segments of a multipart series, why not have all parts of the series?  For example.  I've seen a series that has 15 parts spread across several disks.  However parts 1 and parts 6 are missing.  Why?  Can anyone explain?

So the other option is to download from MSDN....

First you have to log in to passport.  No big deal,  don't have any problem with that.

But then you have to click through about 3 other pages that request information that is already contained within your passport registration.  I'm asked for my name and email address multiple times before i actually get to the download.  What's the point of me signing in if you aren't going to remember who I am?  And I have to repeat this process for each webcast.  Perhaps the people creating this site should watch the webcasts themselves so they can learn how to prevent users from having to do this.

I rarely use the live webcasts.  I download and watch offline at a time convenient for me.  Why not make the process a one click download/view once I've signed in?  Is that too much to ask?

Enough whining for now....


Wednesday, September 28, 2005 #

"Don't you work?" a colleague of mine asked after seeing me leaning back in my chair with my hands behind my head for the umpteenth time.

"I'm waiting on the debugger" was my response.

And that is exactly what I was doing.  Trying to debug an application with a machine whose hardware configuration was identical to the secretary who rarely does much more then fire up an instance of Word.

This is not the only company I've worked for where I have found myself in this predicament.  On the contrary, I've yet to accept a position or contract where I have been given a box worthy of a development machine.  In fact as a consultant, I often find I'm getting the leftover dregs as the employees get the upgrades.  But even their upgrades are rarely top of the line workstations designed with productivity in mind.

As a developer, It's rare I have less then 10 windows open at a time.  I usually have copies of Sql Server, IIS, Visual Studio.Net, Enterprise Manager, Query Analyzer and several browser windows open.  Often I have multiple copies of several of the development apps open.  I often have remote access to one or more machines going as well.  Firing up an ASP.Net app to debug often takes several minutes. The machine usually has to be rebooted once a day.  I waste time in small, usually 2-3 minute increments throughout the day.

The result?  I estimate I end up spending an average of 30-60 minutes a day waiting on the computer, leaning back in my chair, hands behind my head... 

The cost? Let’s take the low end of 30 minutes a day waiting on the machine.  You would still have wait time on a better system, so let’s make the assumption that a high grade workstation will only cause 10 minutes of dead time a day.  That leaves a difference of 20 minutes a day.  Times 5 days a week = 100 minutes a week, times 26 weeks over six months = 2600 minutes lost.

Divided by 60, this is 43.33 hours of lost productivity.  Multiplied by a modest hourly rate for a consultant of $75 an hour and the company has spent $3250 literally for nothing.  Half that amount spent at the beginning to obtain better hardware would have paid for itself in just 3 months time and would have given me another full work week to try and meet the deadline.

Developers and especially consultants who are on the clock at a premium dollar, should be spending there time working as much as possible.  A higher end workstation and multiple monitor setup increases productivity.  And the truth is, I hate to wait. 


Friday, September 09, 2005 #

I find myself in yet another contract with a company that has recently switched to using an Agile methodology.  I like Agile.  I believe the methodologies that encompass Agile strongly support good software development, help minimize risk, and help to meet the needs of the customer quicker then a traditional waterfall approach.

The problem I am finding is that many companies do not understand Agile enough to utilize it correctly.  There is a tendency to take bits and pieces of it, run with them to an extreme, and then get frustrated when they are not achieving results.

"Working software over comprehensive documentation"

The most common mistake I see is in the area of requirements.  Managers, business people and sometimes even developers see the Agile Manifesto statement above and take it to mean 'No Requirements Necessary' and sketch out stories and tasks on their 3 x 5 index cards that don't provide enough information to allow for successful development of the software. 

An example of this occurred on one of the projects with which I am currently involved.  Requirements have been minimal to non-existent and we have been able to muddle through until recently because the types of things we were developing were simple enough that requirements really weren't necessary. (Creating and saving users, addresses, phone number, email addresses, etc.)  As the project is progressing and the true business logic is starting to come in to play, writing a story that says "Create a Compliance Front End" simply doesn't cut it.  When it was brought up during the iteration planning meeting that perhaps another meeting to actually gather the requirements to know how to create the aforementioned piece was probably necessary, one of the members of the team got visibly irritated and suggested that if we were going to do things by a waterfall approach then we should just give up agile.

Agile projects have requirements.  In fact, they have just as many requirements as any other methodology.  The difference is that there isn't a focus on documentation.  The working software serves as proof that the requirements were met.  However when things are complex, not understood or unclear, having meetings and team discussions to make sure all members of the team understand the business needs and goals is just as necessary under Agile as it is under any other approach.  In fact, sometimes these meetings will develop documentation, usually informal, that summarize the meeting and makes certain that everyone left the meeting with the same understanding.  It is impossible to develop successful software without knowing what you are trying to create!

The rant of the day,