Debugging on a device emulator

by Bjørn Storkholm 19. December 2009 12:27

One thing I always hated about developing for mobile devices is waiting for deployment. Hit <F5> in Visual Studio... and wait for all the assemblies being copied to the device.
A workaround for this can be, to setup the device emulator’s storage card to point to the bin folder. Doing this you have instant access to the updated binaries, whenever you build. In the emulator click File -> Configure. In Shared Folder add the path to your target library.
Setup device emulator to point at storage card

With this, you can execute your program instantly upon a new build without waiting for deployment. But if you want to debug your code you can try to attach to process, and get an error saying Unable to attach to the process. Attach is not enabled for this process with this debug type.

 Error trying to attach to process

You’ll need to use Visual Studio’s remote tools Windows CE Remote Registry Editor to enable remote debugging. Add the following d-word to registry and set the value to 1:
HKLM -> Software -> Microsoft -> .NetCompactFramework -> Managed Debugger -> AttachEnabled

  Add AttachEnabled to registry
This enables debugging on the device, but be aware it slows down the device quite a bit, so it should only be done on development devices.
Doing it this way, you build and attach, no wait for deployment. It showed to be quite a time saver for me.

Note: In general it cannot be recommended to execute programs from the storage card, it can show to be quite unstable. But for debugging purposes it’s great.

Limitations

by Bjørn Storkholm 24. November 2009 23:03
  • Biztalk taught me, not to put more than 65000 files in one folder
  • Microsoft CRM taught me not to do more than 1024 joins in one select statement (if you're working with SQL 2005 and newer)
  • Ibatis taught me not to use more than 2100 parameter in a sql command
  • Some stupid code taught me not to select 50000 rows and store them in session

Tags:

dotNet | Microsoft

MSCRM Outlook client

by Bjørn Storkholm 22. November 2009 11:37

Recently I moved my Microsoft CRM installation to a new server. This showed to be surprisingly easy. However I had a some time consuming problems, configuring the outlook client afterwards. When trying to connect to the server through the Configuration Wizard I'd get an errormessage The request failed with HTTP status 401: Unauthorized.

 

Accept this error, and a new message pops up: Mandatory updates for Microsoft Dynamics CRM could not be applied successfully. Try running the application again. 

The first message indicates that some authentication settings was messed up. Doing a lot of googling gave so many suggestions on how to solve this. Add the website to intranet zone in internet explorer, install Internet Facing Deployment tool (IFD Tool) and lots of other stuff, but nothing helped me.

Spending a lot of time on this getting nowhere, I decided to move on to the second error that indicated that there could be some update for the Outlook Client. And there is, you can get it here: rollup 7

Installing this made both errors go away, but of course a new error popped up. This time a big messy messagebox containing a lot of xml, claims that a wrong name for the server, has been entered in the Configuration Database. In the MSCRM_Config i found a table called Server that has a column Name that contained the name of the old server. When this value was changed to the name of the new server, everything worked.

Zyxel

by Bjørn Storkholm 3. October 2009 12:18

This is totally not interesting but is posted, so I don't have to google evertime I need this. Once in a while I have to reboot my Zyxel router, and every time I do it, the loopback setting is reset to off. To fix this issue telnet to the router and enter the command: ip nat loopback on

Tags:

Report services with VS2008... and custom assemblies

by Bjørn Storkholm 22. July 2009 21:00

The other day, I had to convert some old reports from Report Server 2005 to be able to compile in Visual Studio 2008.

The first challenge about this was, that all the developers at the clients place runs VS 2008, but the SQL Server is 2005 - hence the developers only runs SQL 2005 on their dev machines. This results in VS not being able to recognize the report projects.

Solution for the first problem is, to install Business Intelligence Studio 2008 from the SQL Server 2008 installation. I ran the full installer, but only selected BI to be installed, and it does not seem to interfer with the actual SQL 2005 instance, that is running on the dev machine.

Second problem is, that these reports is using a custom assembly. The reports all referenced the custom assembly, but building the project failed - claiming it couldn't find the assembly. It appears, that the assembly has to be copied to a directory under Visual Studio, since reports sucks. The directory in my case was C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies. But the final solution to this would be, to add a post build event to the project copying the assembly to the correct directory: copy "$(TargetPath)" "$(DevEnvDir)PrivateAssemblies"

 So now it builds... everybody is happy... hehe ... heard that before :)

The reports still fails runtime on the server. The custom assembly needs to be deployed, in this case in the folder C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\ReportServer\bin.

Note that the mentioned folders is pretty much different from versions of Visual Studio and SQL Server. The mentioned folders are pretty much standard for Visual Studio 2008, but is very much taken from my own installation, and may vary from setup to setup.

 

Update 20091125: Whatever team in MS who does the reporting services fucked up again. Even though you can compile the reports under 2008 and have them running on the production server, they will not work if you modify them in VS 2008 and try to deploy it on an SQL Server 2005. They changed the schema again, so it seems there's no way you can edit reports in VS 2008 and run it on SQL 2005 - you need to have VS 2005 installed.

How to format dates in SQL scripts

by Bjørn Storkholm 19. July 2009 10:48

Erik Ejlskov posted this great tip on how to format dates in sql scripts to avoid localization issues. {ts '2009-05-11 23:00:00'}

MSCRM outlook client and colored categories

by Bjørn Storkholm 17. July 2009 17:10

I’ve been messing a bit today, with installing the Outlook Client for Microsoft CRM. I had a few issues regarding my own infrastructure, but got that solved in a short time.

But when I got it up and running there was one thing that was really annoying, that Google couldn’t give me an answer to. When I synchronized with the server, all appointments and other items that were categorized as [CRM] regarding: <some account>.

Seems fair enough, but I’d like my appointments from CRM to have another color, so I can easily see which appointments should be invoiced, and which is private. But this did not seem to be possible. Trying to do this, the CRM category is not editable at all.

As mentioned Google gave no answers, and some MVP at a Microsoft forum claimed, that it is not possible to edit the color of the CRM category. What a bummer.

But hey…. The answer is quite simple. In Outlook go to folder view, right click Mailbox select Properties for… click the button Upgrade to Color Categories…

This will create new categories for all the items that you’ve already related to CRM. And these categories are editable. If in the future, you add some new appointments related to a customer, that doesn’t have a category yet, just find the Upgrade to Color Categories…  button again.

Silverlight 3 released

by Bjørn Storkholm 10. July 2009 12:46

Yesterday Microsoft released Silverlight v3. Trying to install the new version I had a few sad findings. First of all, Silverlight v3 is not supported on Windows 7 with IE 8. I sure couldn't install it, and figured it might be because Win7 is still in Beta or the fact, that I'm running the 64 bit version of the OS. But check their system requirements:

While trying to figure out what was going on, I tried to see what would happen if I ran the 64 bit version of IE8, and discovered that silverlight does not support the 64 bit version at all. But ok... Adobe flash doesn't support the 64 bit version either.

I think, that it's weird.

LinQ and PocketOutlook

by Bjørn Storkholm 2. July 2009 13:22

I started writing a small application, which can handle objects in Pocket Outlook Object Model (POOM) items, aka Appointments, Contacts etc.

Writing a simple LinQ query to select my appointments, with a specific subject:

IEnumerable<Appointment> filteredAppointments = from appointment in appointments

                    where appointment.Subject == "Cornelius 2001"

                    select appointment;

 

 I was astonished to find, that this gives a compilation error, with a description saying “Could not find an implementation of the query pattern for source type”. Since I previously did a lot of work with POOM, I’m not that surprised with the fact, that there are always surprises.

Search Google for 5 minutes gave the solution. Explicitly specify the type of the object you want to select:

IEnumerable<Appointment> filteredAppointments = from Appointment appointment in appointments

                    where appointment.Subject == "Cornelius 2001"

                    select appointment;

Authentication failed after restoring database

by Bjørn Storkholm 29. June 2009 19:25

The last year or so, I’ve had a problem just about every time, I’ve restored a database that was backed up from another server.  After every restore, the applications I’ve been working with, throws an exception with authentications errors. The last project I worked on, we could solve this by deleting the user from the DB and add again.  A pretty weird solution, but it worked. But today I ran into the same problem, on another application, where I wasn’t able to delete the user for some reasons. So what to do? It would be nice to find the right solution to this topic, and not just the workaround I’ve been using previously.

The last few months I’ve had the pleasure of working with Erik Ejlskov, who knows a lot about MSSQL Server, so why not just ask him? As usual he was just about, to send a mail to everybody in the office with a solution to this.

If you get the failing authentication, after restoring a database, run the following sproc:

EXEC sp_change_users_login 'Update_One', '[username]', '[username]';

 I wonder what Update_One means, maybe Erik can give an answer to that tomorrow. Anyway it works, and I wish that I'd known this before, since it's really been bugging me.

Powered by McDonalds

About Bjørn

Bjørn StorkholmBjørn Storkholm has been working in the IT industry since the mid 90es, with a primary focus on Microsoft technologies. Started developing on the dotNet platform in 2001, when it was in it's early beta stages.

About the blog

This is a place where I can discover my own findings, after they have slipped my memory. But maybe others can find some usefull stuff here as well.

The blog is powered by BlogEngine