I am sure it happens for most of us: when you debug some code, you need to see a certain property in debug without changing the ToString() implementation or to see the return value of a method without stepping out of it. You say in heart "I wish it would be possible" and continue to debug the old way. Two courage guys Vitaly Belman and Omer Aviv had quit their job to make their dream true. They have developed a Visual Studio addin that makes what ReSharper to the code writing.
Free trial for 60 days:
http://www.bugaidsoftware.com/
Wednesday, 4 January 2012
Thursday, 17 November 2011
There was a problem loading the XSD documents provided: a reference to a schema element with name X and namespace Y could not be resolved because the element definition could not be found in the schema for targetNamespace Z.
Posting this one mostly as a reminder for myself:
I was working on extending some existing WCF service in development, while an older version already deployed to production. Let's say our production site is
www.borismod.com
and my local machine name is borism
When I tried to create a local proxy of the web service I got the following error:
(all the ULRs and namespaces are fictive)
>svcutil http://www.borismod.com/RealGeekyURL/mex
Attempting to download metadata from 'http://www.borismod.com/RealGeekyURL/mex' using WS-Metadata Exchange or DISCO.
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'DoSomeCrazyGeekyStuff' and namespace 'http://borismod.blogspot.com/' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://www.borismod.com/'. Please check the XSD docu
ments provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.borismod.com/']/wsdl:portType[@name='ISomeRealGeekService']
Problem:
The actual problem is that there are references from the WSDL to some internal classes. The references point to the production site. The new added classes were missing in production.
Solution:
Point in host file to the local machine, actually adding the following line in hosts file:
127.0.0.1 www.borismod.com
I was working on extending some existing WCF service in development, while an older version already deployed to production. Let's say our production site is
www.borismod.com
and my local machine name is borism
When I tried to create a local proxy of the web service I got the following error:
(all the ULRs and namespaces are fictive)
>svcutil http://www.borismod.com/RealGeekyURL/mex
Attempting to download metadata from 'http://www.borismod.com/RealGeekyURL/mex' using WS-Metadata Exchange or DISCO.
Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: There was a problem loading the XSD documents provided: a reference to a schema element with name 'DoSomeCrazyGeekyStuff' and namespace 'http://borismod.blogspot.com/' could not be resolved because the element definition could not be found in the schema for targetNamespace 'http://www.borismod.com/'. Please check the XSD docu
ments provided and try again.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://www.borismod.com/']/wsdl:portType[@name='ISomeRealGeekService']
Problem:
The actual problem is that there are references from the WSDL to some internal classes. The references point to the production site. The new added classes were missing in production.
Solution:
Point in host file to the local machine, actually adding the following line in hosts file:
127.0.0.1 www.borismod.com
Wednesday, 14 September 2011
Windows 8 Build event
Haven't been here for a while, will try to update the blog more frequently. I attended a Microsoft Build event yesterday where guys and a girl from Redmond presented the next operating system - Windows 8. The presentation was held in the US and was broadcast live worldwide.
So what are the new buzz words we hear in the next years:
- WinRT - a new run-time to provide a unified access to all languages: C, C++, C#, VB.NET and Javascript
- Reset/Restore will replace the familiar Restore Points. Creating your own "reset" point is available in command line utility only
- Metrostyle - is the new unified styling of applications supporting multi-touch, sliding etc
Additional features are:
- Publishing applications to the cloud. All the apps will be certified by "the big brother" to have no malicious code
- I was also impressed by boot up performance, it's a real improvement
Good work!
So what are the new buzz words we hear in the next years:
- WinRT - a new run-time to provide a unified access to all languages: C, C++, C#, VB.NET and Javascript
- Reset/Restore will replace the familiar Restore Points. Creating your own "reset" point is available in command line utility only
- Metrostyle - is the new unified styling of applications supporting multi-touch, sliding etc
Additional features are:
- Publishing applications to the cloud. All the apps will be certified by "the big brother" to have no malicious code
- I was also impressed by boot up performance, it's a real improvement
Good work!
Thursday, 22 July 2010
Microsoft AppFabric (former Velocity code name)
I visited yesterday a "Introduction to AppFabric caching" session in Microsoft offices in Raanana. The session was held by AppFabric team developer - Shani Pozin. In this post I'd like to summarize the session for those who missed it and as a reminder for myself.
What is AppFabric Caching?
1. A successor of Velocity - a distributed cache service
2. A part of AppFabric - Microsoft vision of application server
3. A competitor to Memcached, NCache and others
What does it do?
It provides an abstract level of clustered distributed caching for serializable objects. Cached data is stored in different physical machines in order to enable High Availability. Each value is stored in two machines (if configured) Primary and Secondary. If Primary fails, then Secondary becomes Primary and another machine becomes Secondary. If Secondary fails, another machine is chosen to be secondary.
What are additional things it knows to do?
1. There is support for locking objects they are retrieved from cache. It is provided by GetAndLock and PutAndUnlock methods. It is important to mention, that if object is locked by one thread the other one will receive an exception and will not be blocked.
2. There is support for versioning cached objects. If a thread is trying to Put an older version of cached object, it will experience an exception, saying that it has to get the most updated version from cache.
What it does not do?
1. It does not persist cached data, which is different than Velocity worked. There were several options for data persistency: SQL Server, XML file, MDF file.
3. It does not provide Read-through and Write-behind features. It is promised, that they will be supported in future releases
If/when the presentation will be available on the web, I'll put a link here.
What is AppFabric Caching?
1. A successor of Velocity - a distributed cache service
2. A part of AppFabric - Microsoft vision of application server
3. A competitor to Memcached, NCache and others
What does it do?
It provides an abstract level of clustered distributed caching for serializable objects. Cached data is stored in different physical machines in order to enable High Availability. Each value is stored in two machines (if configured) Primary and Secondary. If Primary fails, then Secondary becomes Primary and another machine becomes Secondary. If Secondary fails, another machine is chosen to be secondary.
What are additional things it knows to do?
1. There is support for locking objects they are retrieved from cache. It is provided by GetAndLock and PutAndUnlock methods. It is important to mention, that if object is locked by one thread the other one will receive an exception and will not be blocked.
2. There is support for versioning cached objects. If a thread is trying to Put an older version of cached object, it will experience an exception, saying that it has to get the most updated version from cache.
What it does not do?
1. It does not persist cached data, which is different than Velocity worked. There were several options for data persistency: SQL Server, XML file, MDF file.
3. It does not provide Read-through and Write-behind features. It is promised, that they will be supported in future releases
If/when the presentation will be available on the web, I'll put a link here.
Wednesday, 23 June 2010
Get browser information from Silverlight
Recently I needed to detect information about browser version within Silverlight. After googling around I found many posts that pointed to built-in class BrowserInformation, which can be accessed via System.Windows.Browser.HtmlPage.BrowserInformation.
So I should be happy and use its Name and BrowserVersion properties?
No, because BrowserVersion property returns something similar to HTML version instead of the real browser version. For example, on "Internet Explorer 7.0", it returns "4.0"
The "real" browser version can be extracted from the mysterious UserAgent property, just like this:
The code was successfully tested on IE and Chrome.
So I should be happy and use its Name and BrowserVersion properties?
No, because BrowserVersion property returns something similar to HTML version instead of the real browser version. For example, on "Internet Explorer 7.0", it returns "4.0"
The "real" browser version can be extracted from the mysterious UserAgent property, just like this:
public static string BrowserName()
{
string userAgent = HtmlPage.BrowserInformation.UserAgent;
if (userAgent.IndexOf("MSIE 8.0") > 0)
{
return "Internet Explorer 8.0";
}
if (userAgent.IndexOf("MSIE 7.0") > 0)
{
return "Internet Explorer 7.0";
}
if (userAgent.IndexOf("MSIE 6.0") > 0)
{
return "Internet Explorer 6.0";
}
if (userAgent.IndexOf("MSIE 5.0") > 0)
{
return "Internet Explorer 5.0";
}
if (userAgent.IndexOf("Firefox") > 0)
{
return "Mozilla " + userAgent.Substring(userAgent.IndexOf("Firefox"), 100).Replace('/', ' ');
}
if (userAgent.IndexOf("Chrome") > 0)
{
return "Google " + userAgent.Substring(userAgent.IndexOf("Chrome"), userAgent.IndexOf("Safari") - userAgent.IndexOf("Chrome")).Replace('/', ' ');
}
if (userAgent.IndexOf("Safari") > 0)
{
return "Safari " + userAgent.Substring(userAgent.IndexOf("Version"), userAgent.IndexOf("Safari") - userAgent.IndexOf("Version")).Replace("Version/", String.Empty);
}
if (userAgent.IndexOf("Opera") > 0)
{
return userAgent.Substring(userAgent.IndexOf("Opera"), userAgent.IndexOf("(") - 2).Replace('/', ' ');
}
return "Unknown Browser";
}
* This source code was highlighted with Source Code Highlighter.The code was successfully tested on IE and Chrome.
Subscribe to:
Posts (Atom)