Hello,
I have created a Silverlight Application Project with the name test for example. I have selected "Web Application Project" as Project Type.
In the second project test_web I have added a simple WebService that sum two digits. Therefore I have clícked the right mouse button in the test_web project and selected WebService.
Now, when I add a Service Reference to the Silverlight project (test) then I'll get two warnings (see below). For this I click the right mouse button in the folder Service References. After I compile the project, the application will be crash with the following error in page.xaml.cs in the constructor by InitialzieComponenet().
------
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.dll
Additional information: AG_E_PARSER_BAD_PROPERTY_VALUE [Line: 9 Position: 56]
--------
What is the solution? How can I use the WebService.
Thanks for your help.
------------------------------------
The two warnings:
Warning 1 Custom tool warning: Removing unsupported type System.Windows.Controls.OpenFileDialog
System.TypeLoadException: Could not load type 'System.Security.SecuritySafeCriticalAttribute' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.IsCustomAttributeDefined(Module decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable)
at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.IsDefined(Type attributeType, Boolean inherit)
at Microsoft.VisualStudio.ServicesProxy.WcfSilverlightCodeGenerationExtension.WsdlImporting(WsdlImporter importer) E:\SilverlightApplicationWebSerivce\SilverlightApplicationWebSerivce\Service ReferencesService References\ServiceReference1\Reference.svcmap 1 1 SilverlightApplicationWebSerivce
Warning 2 Custom tool warning: Removing unsupported type System.Windows.Browser.HttpUtility
System.TypeLoadException: Could not load type 'System.Security.SecuritySafeCriticalAttribute' from assembly 'mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
at System.ModuleHandle.ResolveType(Int32 typeToken, RuntimeTypeHandle* typeInstArgs, Int32 typeInstCount, RuntimeTypeHandle* methodInstArgs, Int32 methodInstCount)
at System.ModuleHandle.ResolveTypeHandle(Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
at System.Reflection.Module.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, Module decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, RuntimeMethodHandle& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
at System.Reflection.CustomAttribute.IsCustomAttributeDefined(Module decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable)
at System.Reflection.CustomAttribute.IsDefined(RuntimeType type, RuntimeType caType, Boolean inherit)
at System.RuntimeType.IsDefined(Type attributeType, Boolean inherit)
at Microsoft.VisualStudio.ServicesProxy.WcfSilverlightCodeGenerationExtension.WsdlImporting(WsdlImporter importer) E:\SilverlightApplicationWebSerivce\SilverlightApplicationWebSerivce\Service References\ServiceReference1\Reference.svcmap 1 1 SilverlightApplicationWebSerivce