NAVmoble - the pocket-sized ERP
Optimized for Microsoft Dynamics NAV and Windows Mobile powered devices

Friday, June 09, 2006

Unspecified error 80004005

Lately, I am working over a Visual Studio 2005 Add-In for our NavMobile product. It is meant to allow our partners to be more productive, while customizing the solution for their customers. Yesterday, we've spent some time clearing old stuff from our central source repository.
Later, I've opened the Add-In Project and this message box appeared on my desktop after running the project:

This message was not quite helpful for me, although I knew there is a problem with the output assembly loading. I've tried some goggling, but no luck. I've checked the \BIN folder security settings, but there wasn't anything wrong. Finally, after an hour or so I solved my problem.

When a new project of type "Extensibility/Visual Studio Add-in" is created you'll get a bunch of files, including 2 files with ".Add-In " extension.
1.MyAddInProject.AddIn
2.MyAddInProject - For Testing.AddIn".

However during our source repository clearing, we've accidentally deleted the file #2. This file is created by default in ...\My Documents\Visual Studio 2005\AddIns
When I've opened the project first I saw the file #2 is missing. I've created a file with the same name and copied the content from file #1. And this was the reason to get the error message.

These files contain XML describing the Add-In and they are used by VS2005 in order to know which Add-Ins to load. The files contain a tag named /Extensibility/Addin/Assembly,which points to the Add-In assembly name. However, by default file #2 contains the full path to the assembly Add-Ins and file #1 contains only the name of the assembly.

The error dissappeared after placing the full path to the assembly Add-In in the /Extensibility/Addin/Assembly tag.

In general: if you get such an error, while trying to debug your Add-In, check if the assembly path written in file #2 is "visible" for VS2005.

Wednesday, May 17, 2006

Will WPF/E replace CF?

I read this interesting article discussing the new Microsoft initiative based on Windows Presentation Foundation called Windows Presentation Foundation Everywhere (WPF/E). The author gives some early bits about the initiative:

  • Will provide subset of the XAML and CLR functionality
  • Supported on platforms other than Windows
  • Available as a internet browser plugin
  • No need to have .NET installed
  • Download size under 2 MB
  • Available in the first half of 2007


See the full article here

Thursday, May 11, 2006

Performance problems on WM5.0

Are you experience performance problems on your WM 5.0 device
This post at Windows Mobile Team's blog explains some issues related to the WM 5.0 Compaction thread

Monday, April 24, 2006

NET Compact Framework 2.0 SP1 Beta is out

.NET Compact Framework 2.0 SP1 Beta is now available! See more details at the Compact Framework Team's blog.
There are number of new features and a lot of bug fixes. The long waited WinCe 4.2 support is already a fact! Another great new feature is the
.Net Compact Framework Remote Performance Monitor. It may be downloaded here

Thursday, April 06, 2006

How to drop all tables from a database(MSSQL)

I had a problem upgrading one of may dotnetnuke based portals and I needed to start over with a fresh database. Due to some hosting issues I couldn't drop and recreate the database. I had a large number of objects and needed a quick magic sentence to drop them all. fortunately the following ones did the job:

I deleted all table with:
exec sp_MSforeachtable "DROP TABLE ? PRINT '? dropped' "

And then used the following statements to drop procedures
create procedure DropSPViews
as

-- variable to object name
declare @name varchar(100)
-- variable to hold object type
declare @xtype char(1)
-- variable to hold sql string
declare @sqlstring nvarchar(1000)

declare SPViews_cursor cursor for
SELECT sysobjects.name, sysobjects.xtype
FROM sysobjects
join sysusers on sysobjects.uid = sysusers.uid
where OBJECTPROPERTY(sysobjects.id, N'IsProcedure') = 1
or OBJECTPROPERTY(sysobjects.id, N'IsView') = 1 and sysusers.name =
'USERNAME'

open SPViews_cursor

fetch next from SPViews_cursor into @name, @xtype

while @@fetch_status = 0
begin
-- test object type if it is a stored procedure
if @xtype = 'P'
begin
set @sqlstring = 'drop procedure ' + @name
exec sp_executesql @sqlstring
set @sqlstring = ' '
end
-- test object type if it is a view
if @xtype = 'V'
begin
set @sqlstring = 'drop view ' + @name
exec sp_executesql @sqlstring
set @sqlstring = ' '
end

-- get next record
fetch next from SPViews_cursor into @name, @xtype
end

close SPViews_cursor
deallocate SPViews_cursor


this is the original source