So I'm working through my WCF Step-by-step using my favourite langauge, VB.NET, although the book is written in C#! No VB.NET code here so I have to translate and type, no copy paste for me. Well after carefully crafting an interface as the public part of my service and implementing the interface in a class, I build the svc file just like the book and get
The type 'Products.ProductsServiceImpl', provided as the Service attribute value in the ServiceHost directive could not be found.
I think this is a typo, so I check my namespace, OK, I check the Class that implents the interface and it checks out, so I google a bit and some say, you need the fully qualified name. hmmm So I take of the rootnamespace on the assembly and all is OK. But this is not the way to fix problems, I want my rootnamspace so I decide to alter the svc to look like this:
ServiceHost Service="ProductsService.Products.ProductsServiceImpl"
Looks good but then I get another error:
Service 'ProductsService.Products.ProductsServiceImpl' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.
So lets look in the Web.config, under system.serviceModel section:
service behaviorconfiguration="ProductsBehavior" name="Products.ProductsServiceImpl"
endpoint address="" contract="Products.IProductsService" binding="basicHttpBinding"
Ohhh the servicename and the contract are now wrong:
name="ProductsService.Products.ProductsServiceImpl"
contract="ProductsService.Products.IProductsService"
Ah at last the service is up and running and browsing the svc file in IE7 shows me the link to the WSDL and all is well.
Thursday, September 20, 2007
TechEd Developers 2007 BCN
Wow a year has past since the last conference and it looks like I'll be returning to Barcelona this year for THE developer conference in Europe, Microsoft TechEd Developers 2007. I will be attending to the Hands-on-Labs as a Proctor for the duration of the conference as well as taking a shift at the Ask-The-Experts booth, most likely for Visual Studio 2005. Well As things start to develop I'll keep posting the details, but for now it's flights and accomodation that I need to take care of!!
Saturday, September 15, 2007
Multithreading with VB.NET Series - Part 1
So yes we all know that VB can now multithread with so much ease that we can get ourselves into trouble!! Tell m e about it, I was a victim of a naive assumption once which brought a SQL server to a grinding halt after it spawned 700 threads when a user press the damn button 7 times to make sure the 100 transactions went through!! The data was fine but the server was 'crying' for resources. Anyway that's another story...
So to create a new thread to do some work it a POC:
Dim th As New System.Threading.Thread(AddressOf MyLongRunningProc)
' Kick off that new thread to do some work
th.start
Private Sub MyLongRunningProc()
' Do the hard work here !!
End Sub
The questions that start to arise as you move into the world or asynchronous programming will soon start to pop up, due to most peoples affinity to synchronous programming mind set. So if two things are happening at once how do I keep track of progress, access shared data in a safe manner, etc. Well here MS has given us so many toys to play with, enter:
1. The Monitor,
2. The Mutex,
3. ReaderWriterLock
4. The Interlocked Type
5. The SyncLock Statement,
6. The Synchronization and MethodImpl Attributes,
7. VolatileRead/Write and MemoryBarrier,
8. The Semaphore Type.
So over the next few posts I will try to demystify so of these terms you may have heard about, but were to too afraid to use them. This should hopefully put some pretty cool tools into you toolbox to help you create those responsive applications you love to give to your clients, but also to make them more robust and safe :)
So to create a new thread to do some work it a POC:
Dim th As New System.Threading.Thread(AddressOf MyLongRunningProc)
' Kick off that new thread to do some work
th.start
Private Sub MyLongRunningProc()
' Do the hard work here !!
End Sub
The questions that start to arise as you move into the world or asynchronous programming will soon start to pop up, due to most peoples affinity to synchronous programming mind set. So if two things are happening at once how do I keep track of progress, access shared data in a safe manner, etc. Well here MS has given us so many toys to play with, enter:
1. The Monitor,
2. The Mutex,
3. ReaderWriterLock
4. The Interlocked Type
5. The SyncLock Statement,
6. The Synchronization and MethodImpl Attributes,
7. VolatileRead/Write and MemoryBarrier,
8. The Semaphore Type.
So over the next few posts I will try to demystify so of these terms you may have heard about, but were to too afraid to use them. This should hopefully put some pretty cool tools into you toolbox to help you create those responsive applications you love to give to your clients, but also to make them more robust and safe :)
Wednesday, August 22, 2007
Ever wished you could select a vertical column of code?
How to find the system directory (and other environement variables)
Was looking through the msdn Forums recently and someone was asking how to get the system path to save some files... and I though hmm this sounds like a job for the my namespace.... Alas I was wrong, my.computer could not help me but then it struck me... The system.enviroment class could help. Here are some of the goodies in this class:
CurrentDirectory
Returns and sets the fully qualified path of the current directory; that is, the directory from which this process starts.
MachineName
Returns the NetBIOS name of this local computer.
OSVersion
Returns an OperatingSystem object that contains the current platform identifier and version number.
SystemDirectory
Returns the fully qualified path of the system directory.
UserDomainName
Returns the network domain name associated with the current user.
UserName
Returns the user name of the person who started the current thread.
Version
Returns a Version object that describes the major, minor, build, and revision numbers of the common language runtime.
WorkingSet
Returns the amount of physical memory mapped to the process context.
e.g
me.text = System.environment.systemdirectory
CurrentDirectory
Returns and sets the fully qualified path of the current directory; that is, the directory from which this process starts.
MachineName
Returns the NetBIOS name of this local computer.
OSVersion
Returns an OperatingSystem object that contains the current platform identifier and version number.
SystemDirectory
Returns the fully qualified path of the system directory.
UserDomainName
Returns the network domain name associated with the current user.
UserName
Returns the user name of the person who started the current thread.
Version
Returns a Version object that describes the major, minor, build, and revision numbers of the common language runtime.
WorkingSet
Returns the amount of physical memory mapped to the process context.
e.g
me.text = System.environment.systemdirectory
Monday, August 20, 2007
Where is SmartNavigation in ASP.NET 2.0 (VS2005)
Had a quick question taday that comes up often so I decided it's time to blog it!! In vs2003 there was this feature that would hold the page position after a postback so that it was redisplayed, updated at the postion where the page was scrolled to during the postback. It's a page level property that is not visible anymore in the Properties Window. however drop into a code window and it there, under a different name:
Page.MaintainScrollPositionOnPostBack = True
For more info please follow this link:
How to implement the smart navigation features in ASP.NET 2.0
Page.MaintainScrollPositionOnPostBack = True
For more info please follow this link:
How to implement the smart navigation features in ASP.NET 2.0
Saturday, August 11, 2007
Remove Remote Desktop IP Entries on Public Computer
I was teaching a class y'day when I saw trainee was search desparately to remove the remote desktop entry on his PC after he had successfully connected to his home PC. He was obviously worried that some other user may find the entry and start trying to establish a connection to his home PC. The moral of the story so far... don't use remote desktop from a public PC!!
Anyway the MSDN site proved as valuable as ever turning up this:
How to Remove Entries from the Remote Desktop Connection Computer Box
To remove entries from the Remote Desktop Connection Computer box in the Windows Remote Desktop Connection client, start Registry Editor, and then click the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default
Entries appear as MRUnumber, and are visible in the right pane. To delete an entry, right-click it, and then click Delete.
All have now vanished ... except for ONE; the default that you find as soon as you open Remote Desktop. After numerous reboots, logging off and on... the answer was easy... Go to my documents and remove the Default.rdp file. It's a hidden file so you won't see it unless you go to Tools->Folder Options-> View -> Show Hidden files and folders :)
Anyway the MSDN site proved as valuable as ever turning up this:
How to Remove Entries from the Remote Desktop Connection Computer Box
To remove entries from the Remote Desktop Connection Computer box in the Windows Remote Desktop Connection client, start Registry Editor, and then click the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client\Default
Entries appear as MRUnumber, and are visible in the right pane. To delete an entry, right-click it, and then click Delete.
All have now vanished ... except for ONE; the default that you find as soon as you open Remote Desktop. After numerous reboots, logging off and on... the answer was easy... Go to my documents and remove the Default.rdp file. It's a hidden file so you won't see it unless you go to Tools->Folder Options-> View -> Show Hidden files and folders :)
Subscribe to:
Posts (Atom)
