Consuming WCF in Xamarin forms - wcf

I am generating a WCF proxy using add web referance in Xamarin Studio
yet genrated proxy create the following error:
The type or namespace name IExtensibleDataObject' does not exist in the namespaceSystem.Runtime.Serialization'. Are you missing an assembly reference? (CS0234) (infra)
I am using mono4.0.5
Can anybody help me solve this problem that gave me many sleepless nights.
PS: I tried to skip proxy generation to using slsvcutil.exe code generation
but the same error keeps happening

Right click on you project and select Edit references. Look for System.Runtime.Serialization and select it.

If you already set the reference of System.Runtime.Serailization and error is still persist then try following regular steps..
clean solution and rebuild solution
restart visual studio

I found a solution for your problem. The problem is Xamarin Portable Targets. The targets must not contain any Windows targets selected. After changing this as in the image below it will not give you any compile time errors for System.Runtime.Serialization.
I found that after reading this https://developer.xamarin.com/guides/android/under_the_hood/assemblies/
The System.Runtime.Serialization.dll is for the Silverlight package and when selecting windows targets it might be removing these dlls/code not supported in windows platform from the portable libraries.

Related

What does "Predefined type 'System.TypedReference' is not defined or imported" mean on Metro project?

I am currently converting a library to be a Metro library for Windows 8. I've created a brand new project in Visual Studio 2012 using the "Class Library (Windows Store apps)" C# Template. I've been adding a lot of files and working through the compile errors, but the one that's confusing me is:
Error 2 Predefined type 'System.TypedReference' is not defined or
imported CSC MyNewProject
The "CSC" appears under the "File" column. Double-clicking the error does nothing. Googling only gives me this:
Do not specify the /nostdlib option from the command line compiler.
Make sure that the project refers to the correct mscorlib.dll.
Reinstall the .NET Framework common language runtime (if the previous
solutions do not solve the problem).
(source http://msdn.microsoft.com/en-us/library/f5c3ehka.aspx)
I'm not using a command line compiler, I don't know how to include or exclude mscorlib - because unlike previous .NET apps in Visual Studio, the only thing my project references is ".NET for Windows Store apps" and "Windows" (something I'm still getting used to).
Any thoughts/advise on this?
That Object is not available or has been relocated for the new ARM .NET architecture.
Here is the Full API for you to search, I would of searched for it, but it is missing a search func.
http://msdn.microsoft.com/en-us/library/windows/apps/br211369.aspx
For anyone else who encounters this, I experienced this while I was converting a project to run on metro. I continued to fix other issues (at the time this was one of hundreds of errors) and eventually this just simply disappeared. My plan was to eventually compare this to a new metro project in a text editor once I fixed all the other errors, but it solved itself before that could happen.

Unable to compile workflow-project

I have a build-server running CC.Net. So far I never had any problems compiling projects on the build server (which has no VS installed, just use the .Net Framework).
But now I have a new projects and I get this message:
C:\Program Files\MSBuild\Microsoft\Windows Workflow Foundation\v3.5\Workflow.Targets(127,5): error : Compilation failed. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Has anyone any hint's on what's causing this problem?
What might be of some interest is the fact, that this is a SharePoint project wich includes a SharePoint workflow. But this shouldn't stop the project from being able to be compiled.
The problem with LoaderExceptions described here sounds like what you are seeing. Maybe targeting 3.0 instead of 3.5 does fix your issue too.

Version information missing from .NET assembly (Compact Framework 3.5/VS2008)

I am building an executable using VS2008 and .NET compact framework 3.5, targetting Windows Mobile 6 professional, but whenever I compile the project, everything that I have specified in the AssemblyInfo.cs file is ignored.
I have done this many times in other projects and it works without problem, but for some reason I cannot get the AssemblyTitle/AssemblyProduct/AssemblyVersion attributes etc to show up (I am trying to view them using Windows Explorer, I am able to see these properties in the details tab for any other assembly that I have built - even other projects in the same solution).
Any suggestions?
That info is looking at the native version info, which on the desktop is set using the AssemblyFileVersionAttribute. The AssemblyFileVersionAttribute is unsupported in the CF, so the only way to set the version info out of the box is to command-line compile. There is a workaround in this blog.
I know this is old, but there's a simpler solution posted here:
Version number in .NET Compact Framework application
You have to use reflection.
System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Minor System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Build System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.Revision
in tag PlatformFamilyName; rather that PocketPC, change to add WindowsCE
in csproj

Strong Signed Assemblies

I have a project I made in Visual Basic 2008 Express. I converted it from someone else's C# project, but it works. It has several DLL dependencies. I went to publish my project so I can install it on another machine and for each DLL, I get an error: "Assembly must be strong signed in order to be marked as a prerequisite." I've done some research, but am not finding a lot and what I have found I don't really understand. What does this error mean? What is the best way to resolve it? One other thing: it took me a LONG time to be able to get all my dll's to reference correctly, so I prefer that the solution has NOTHING to do with moving DLL's around because that will likely break the functionality in my main project.
If you're publishing via ClickOnce, go to the publish page and click on "Application Files". From there you should see a list of your DLL's. Ensure that the ones that are giving you trouble have their Publish Status marked as "Include" rather than "Prerequisite".
What this error message means is that the current publishing settings are going to expect all of the assemblies in question to be present in the Global Assembly Cache on the target machine before installation can take place. Since all assemblies in the GAC must be strong signed, any assembly marked as a prerequisite that isn't strong signed will give you this error.
The workaround is more simple than that:
Go to your project.
Right click and Select Properties.
Go to the Security Tab.
Uncheck Enable ClickOnce security Settings.
Unless you are deploying this application through ClickOnce, you don't need to StrongName your assemblies.
Strongly named assemblies are mainly assemblies which have are signed by a cryptographic key. This is fairly easy to do with Visual Studio and does not require re-ordering of your dependencies.
I'm using non-express Visual Studio so the steps may be slightly different for you.
Right click on the project and select properties
Click on the Signing tab
Check "Sign the assembly"
In the combo box select "<New...>"
Complete the wizard
Rebuild
Check this link out...it has instructions for signing your assembly with a strong name:
MSDN: Signing an Assembly with a Strong Name
To create a strong name just go to the SDK Command Prompt or Visual Studio 200X Command Prompt then type in the following
sn -k sgKey.snk
Refer this link for details
Then associate the strong name to your assembly by running the below command
al /out:MyAssembly.dll MyOldAssembly.dll /keyfile:sgKey.snk
Refer this link for details
This just worked for me after the above mentioned solutions failed:
Remove the reference to the assembly in error, then add it again.
I found my problem to be in the .csproj file
<Reference Include="OtherProjectNothingToDo">
<HintPath>..\..\..\..\Pedidos\XBAP\Pedidos\Pedidos\bin\Release\Pedidos.exe</HintPath>
</Reference>
Then I removed it using notepad and it is okay now.
Using Adam Robinson's solution allowed me to publish, but I found that users could not install the project once it was published, as the end user system would complain of an inability to install, noting hard drive space. As this seemed highly unlikely to be the root cause, I looked further into it.
Apparently the basis for my problem was that one of my references was also referencing a .dll that my project used, but a different version. ClickOnce was not having this, and refused to copy the second version of the .dll to the user's system, citing the version already present. Fixing it so the .dll and the project referenced the same version of the other .dll removed the error and corrected the install problem.
Check that the Target Framework is actually set to 3.5 or whatever framework you want to target. Sometimes it will error out when it's not set properly.
I just had this problem too. In my case the blabla.dll was referenced in my solution but blabla.dll was also used in another.dll which i had referenced in my project.
On checking the versions of both blabla.dll they were not the same. So i updated another.dll with the correct blabla.dll and then referenced the new another.dll in my solution. The error was gone.
In short: i was using 2 versions of blabla.dll
I hope this makes sense, if not let me know. :)
Check my blog for more detailed explanation:
Blog article
Regards, Jacob Iedema

Problems adding a COM component reference to a VB.NET project

I have a third party COM dll that I'm trying to add to a vb.net (2008 express) project. I put the dll in C:\WINDOWS\system32\ and registered it with "regsvr32 vxncom.dll". When I go to projects > add reference and go to the COM tab it shows up in the list of available components/libraries. But, when I select the library and hit ok, visual studio complains: "A reference to 'vxncom 4.0 Library' could not be added. Could not register the ActiveX type library 'C:\WINDOWS\system32\vxncom.dll'."
The project I am doing this in is an example provided by the folks who distribute the dll. The component also fails to be added when I start a new (blank) vb.net project.
UPDATE 1:
I ran dependency walker on the dll in question and here's what I got in the error log:
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
The module in question seems to be libeay32.dll, but it already exists in C:\WINDOWS\system32.
UPDATE 2:
I went to the openssl site and downloaded and used their installer to update the libeay32.dll. I ran dependency walker again on vxncom.dll, and there were no errors. Went back to visual studio and it still didn't want to add the reference. Exact same error as before.
Maybe the DLL VB is trying to register depends on another DLL that is not present. You can confirm this (or rule it out) by using the free Dependency Walker tool from http://www.dependencywalker.com/
RESPONSE TO UPDATE 1:
Sounds like there's a mismatch between the version of libeay32.dll that's installed on your system and the one that your component is expecting -- depends is saying that your component is looking for a function that isn't there. I would check the version number of libeay32 and then contact the vendor and ask them what versions they support.
Just a thought - you may get a more detailed error message if you create your own PIA using tlbimp.exe, rather than relying on the IDE to do it for you.
Assuming you haven't fixed it or have moved on to alternatives; and following on from jeffm's answer is libeay32.dll properly registered with the operating system? Re-installing / repairing usually fixes that type of problem (I see it a lot with MS Office and MapPoint where the COM objects occasionally unregister themselves for one reason or another.)