Friday, June 2, 2017

The "DebugType" parameter is not supported by the "XamlCTask" task. Xamarine Forms Android

If you getting the below error, then follow the solution to fix this.

The "DebugType" parameter is not supported by the "XamlCTask" task. Verify the parameter exists on the task, and it is a settable public instance property. CabPOC01.Android


Solution - Go to the below folder and removed the DebugType = "$(DebugType)" From Xamarin.Forms.targets File

\packages\Xamarin.Forms.2.3.4.247\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20

Thursday, February 16, 2017

Azure Blob file download using API in C#

I am working a large Data Integration application and there was a need to share a large file (250+meg ) with vendor who was working on IPad UI application for our sales team. Vendor technology has some limitation to only get the data throug API layer they were adamant to connect to SFtp/DMZ file share etc.

To solve the above business problem we thought we will host the file in AZure Blob and will expose the file using API.

Setting up the Azure Blob to host the File

1. Create a new storage account using portal.azure.com. Make sure to select "General Purpose" option while creating account account. e.g. "apidemostorageaccount"

2. Create a container in the account. eg "ProjectFileContainer"

Code to upload the file to Azure Blob



   Config file
    <add key="StorageConnection" value="DefaultEndpointsProtocol=https;AccountName=??;AccountKey=??" />
    <add key="StorageContainer" value="projectfilecontainer"/>
    <add key="FileName" value="C:\Temp\Launchpad\CustomerMasterData.csv"/>

Code to download the file from Azure Blob


Step 1- Get Sas url


Step -2 GetBlob object url



Step 3 - Return File blob url from web service


Please note the above web service call will return the url of the file. the file url has to be called within 3 minutes to download the file other wise the file url will expire.



Thursday, January 26, 2017

Creating a list item in Sharepoint List from c#




    <add key="SharePointSIte" value="https://abc.com/sites/ISS/ts/buslead/"/>
    <add key="apiList" value="Business Lead QA list"/>


using Microsoft.SharePoint.Client;

ClientContext clientContext = new ClientContext(siteUrl);
                    SP.List oList = clientContext.Web.Lists.GetByTitle(apiList);

                    ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
                    ListItem oListItem = oList.AddItem(itemCreateInfo);
                    oListItem["Title"] = lead.LeadName;
                    oListItem["City"] = lead.City;
                    oListItem["Zip_x0020_Code"] = lead.Zip;
                    oListItem["Address_x0020_1"] = lead.Address1;
                   // oListItem["Address_x0020_2"] = lead.Address2;
                    oListItem["Phone_x0020_number"] = lead.UserPhone;
                    oListItem["Email_x0020_Address"] = lead.UserEmail;
                    oListItem["Branch_x0020_Code"] = lead.BranchCode;
                    oListItem["Branch_x0020_Name"] = lead.BranchName;
                    oListItem["FullName"] = lead.UserFullName;
                    oListItem["Notes"] = lead.Remark;
                    oListItem["Business_x0020_contact_x0020_nam"] = lead.LeadContactName;
                    oListItem["Business_x0020_contact_x0020_add"] = lead.LeadContactPhone;
                    oListItem["Business_x0020_contact_x0020_cit"] = lead.LeadContactEmail;
                    oListItem["Business_x0020_contact_x0020_sta"] = lead.LeadAcquisition;

                    oListItem.Update();

                    clientContext.ExecuteQuery();