Showing posts with label Developer Tools. Show all posts
Showing posts with label Developer Tools. Show all posts

Wednesday, November 18, 2015

How to create Outlook apps in Visual Studio 2015

Hi All,

I have been asked on what is needed to create outlook extensions, add-ins or apps. The new standard name from Microsoft  for these extensions is office apps. So in this blog post i will use apps which refer to add-ins or extensions.


With the new app model, All office apps are HTML5 & web based projects. When you create a project in Visual Studio 2015, VS creates two projects in the solution.

The first project is a web app project where you can create all your HTML pages with all required assets (CSS, JS...etc). The second project is an office wrapper project for your web app.  This project is being used to register your app in office client apps or office 365.

The office wrapper project contains information such as: application name, version, company information, end point urls and any required permissions that you need to configure when a user install the Outolook add-in.

Below screen shots shows how to create an Outlook Add-In to show in outlook email messages.

1) Open Visual Studio 2015.
2) From the file menu, click on New project.
3) Under Office/SharePoint, Select Apps from the right pane.



4) Click OK.
5) Visual Studio will prompt which project type you want for your outlook app.



6) Select Mail, Then click Next.
7) Choose where you want the app to appear.



8) Select Read and Compose Email Message, Un-check the rest.
9) Click on Finish.

Below shows how the two projects that have been created in VS 2015.



Enjoy!


Sunday, April 12, 2015

How to return JSON objects from Web API 2

Hi All,

I was trying to return an object from web api 2.0 and i was getting the following error:

The 'ObjectContent`1' type failed to serialize the response body for content type 'application/xml; charset=utf-8'.

The inner exception message was stating the following:

Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract which is not supported. Consider modifying the definition of collection 'Newtonsoft.Json.Linq.JToken' to remove references to itself.


Sample method:

[HttpGet]
[ResponseType(typeof(ChargifyTransaction))]      
public async Task<MyObject> GetTransactionDetails(string transactionId)

{

   MyObject obj = new MyObject();
   obj.Id=123222;
   obj.Name = "Mostafa dev";
   
   return obj;
}

The solution:

Add the following 2 lines in Global.asax file under App_Start method, This will force the web api to return Json formats and to ignore references to itself for Newtonsoft.Json dll.



 protected void Application_Start()
        {
            // Force to use Json formatter and ignore reference looping.
            GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore;
            GlobalConfiguration.Configuration.Formatters.Remove(GlobalConfiguration.Configuration.Formatters.XmlFormatter);


           }


Hope this helps.

Wednesday, March 12, 2014

Developer Dashboard doesn't show for anonymous users in SharePoint 2013

Hi All,

I was working on a public SharePoint site and i wanted to enabled the developer dashboard utility. I Ran the following powershell command to enable the developer dashboard:

Turn On Developer Dashboard Powershell Command:

$content = ([Microsoft.SharePoint.Administration.SPWebService]::ContentService)
$appsetting =$content.DeveloperDashboardSettings
$appsetting.DisplayLevel = [Microsoft.SharePoint.Administration.SPDeveloperDashboardLevel]::On
$appsetting.Update() 


**If you want to turn it off, just change the On flag to Off and you are good.

After that, I was able to see the developer dashboard icon in the Central Administration site but not on my public SharePoint site.

So basically, I found that you have to grant permissions for anonymous users to access this utility since it is not accessible for anonymous users even if the utility is enabled.

How to enable Developer Dashboard for anonymous users:

$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$dashboardSettings = $contentService.DeveloperDashboardSettings
$dashboardSettings.RequiredPermissions = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask
$dashboardSettings.Update()


By default, the required permissions property for the developer dashboard utility is "AddAndCustomizePages" which is available for authenticated users who have this permission, so you need to changed it to no permissions by setting the value to EmptyMask which means in SharePoint permissions world no permissions are needed.

Note: This is a good technique while you are developing, testing and in the user acceptance test phase of any SharePoint implementation project. when you don't need this utility it is strongly recommended to turn it off on production environment.

Hope this helps!


References:
1) SharePoint base permissions:
http://msdn.microsoft.com/EN-US/library/ms412690






Wednesday, June 12, 2013

Windows Phone 8 Get Started and in-depth topics - TechEd NA 2013

Hi everyone,

If you haven't attended TechEd North America 2013 and you are a windows phone developer, This blog post is for you.

I was looking to see all windows phone 8 sessions so i can check them on my own time, I found this blog post that has all videos for windows phone 8 in TechEd 2013.

Take a look and enjoy.


http://blogs.windows.com/windows_phone/b/wpdev/archive/2013/06/06/teched-north-america-2013-summary.aspx

-ME

Friday, April 12, 2013

WCF Error: The underlying connection was closed: The connection was closed unexpectedly.

Hi Folks,

While i was developing a WCF service API for my enterprise application, I got an error while i'm calling a search function in the WCF. The WCF function is calling a stored procedure.

I tested the stored procedure and there is no issues with it at all, and the error was being thrown in my web when the data is being serialized and sent over the network.

The error message:

The underlying connection was closed: The connection was closed unexpectedly.

The point here is that i have other functions in the WCF work perfectly with no errors but only the search function is throwing an exception.

So, it is not configuration thing, it is something else i want to nail it down!

The only way to get the actual error message from calling a WCF service, is to install a tool called "Microsoft Service Trace Viewer" . Here is the download link:
http://www.microsoft.com/en-us/download/details.aspx?id=3138


After you install it, add the following section in the web.config before the closing of the configuration attribue:

<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
<listeners>
<add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "traces.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>

Run your applicaiton, and execute the action that throws the exception then do the following:
1) Open the following path:
C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin

2) Double click on SvcTraceViewer.exe tool

3) From the File Menu, Click on Open.

4) Navigate to your project folder and you will find a file called: traces.svclog, select this file.

5) Check the actual WCF call that causes the error from the activity window and then see the details of the error in the right pane.




Hope this helps.
 

Friday, March 29, 2013

How to enable MS Dynamics CRM 2011 to integrate with Windows Azure

Hi,

I'm writing this article to explain a good architecture design for integrating your Microsoft Dynamics CRM 2011 with windows azure.

Let's  say you have on-premise CRM 2011 instance, and you want to use Windows Azure Blob storage to store Customer's documents on the cloud. How would you do that ?

The example i'm giving is applicable to any other windows azure service such as: SQL Azure, Mobile Notification Service, AppFabric Features..etc.

Since Windows azure is a scalable Cloud platform, you can easily integration your CRM 2011 with the windows azure on the cloud in 4 main steps.

Before going through the details, I'd like to explain the architecture of the proposed solution.

MS CRM 2011 has a backend windows service called "CRM Asynchronous Service" this is the component that will be in charge to communicate with the windows azure through a service bus.

MS CRM 2011 has 2 types of plugins, out-of-the box (OOB) and custom plugins. The OOB plugins runs  with full trust but the custom plugins runs with partial trust, and we will develop a custom plugin to connect to a listener through azure service bus.

The solution has the following components:

1) Configure CRM to be Windows Azure Aware.

2) We need to configure a service bus on Azure with an endpoint to communicate with the CRM server.

3) A listener hosted in Windows Azure to communicate with the asyncrhounous service, specificially listening to CRM assembly "Microsoft.Xrm.Sdk" with RemoteExecuteContext defined. so we need to develop a listener and deploy it on windows azure.

4) A custom CRM Plugin to communicate with the Windows Azure Listener.


How To accomplish, configure and develop this solution:

1) To accomplish step 1 , "Configure CRM for Integration with Windows Azure" :
http://technet.microsoft.com/en-us/library/gg328249.aspx

2) To accomplish step 2, "Configure Windows Azure ACS on Azure" :
http://technet.microsoft.com/en-us/library/jj863635.aspx

3) How to write a windows azure listener:
http://technet.microsoft.com/en-us/library/gg309615.aspx

C# Sample code - Listener:
http://technet.microsoft.com/en-us/library/gg309657.aspx

4) To accomplish step 4, "How to write Azure Aware CRM Plugin":
http://technet.microsoft.com/en-us/library/gg328194.aspx

Note, if you want to develop a custom workflow activity:
http://technet.microsoft.com/en-us/library/gg327854.aspx

Registration step - FINAL:
http://technet.microsoft.com/en-us/library/gg328524.aspx


**Here is some sample code for all what i mentioned above "listeners & plugins":
http://technet.microsoft.com/en-us/library/gg334712.aspx

Note: you should be having CRM SDK and Windows Azure SDK 1.7 or higher to be able to exercise and develop the solution.

Hope this helps.


Reference:
-Azure Extensions for Microsoft Dynamics CRM 2011:
http://technet.microsoft.com/en-us/library/gg309276.aspx



 

Wednesday, March 27, 2013

Fix It: Application deployment Failed, Please try again in VS 2012

Hi,

A well-known error message is being thrown from VS 2012 when you try to run the emulator for Windows Phone 8. After you installed all the tools and trying to see your application on the emulator you get the above error and it is a show stopper! It's so frustrating and annoying not to be able to view your running code.

After i was stuck for 3 days, and posting my question in MSDN and contributing on StackOverflow and other forums, all of these suggestions didn't work with me.

My case is fairly simple: I have a brand new laptop, Lenovo AMD E1500 (Supports SLAT) with 4GB RAM on Windows 8 Pro 64bit with VS 2012.

Every time i try to run my windows phone 8 application after selecting "WVGA 512MB" Emulator, it takes forever and i got this error:

Application Deployment Failed, Please try again.

When i check the output window in VS2012, I see the error happens when the VS 2012 tries to connect to the created VM in Hyper-V.

Here is the steps you have to make sure befor uninstalling the SDK or the other tools:

1) Turn off windows firewall.
2) Make sure that you are running VS 2012 as an administrator.
3) Make sure that you are a member of Hyper-V Administrator on your machine.
4) Open Hyper-V and check the you have a VM called "Emulator WVGA 512MB" since this is the VM that VS 2012 is trying to deploy the xap file into.
NOTE: IF YOU DON'T HAVE THE VM, THIS POST IS NOT INTENTED TO FIX IT.

5) Check the connection type for "Windows Phone Emulator Internal Switch" in Hyper-V manager by clicking on Virtual Switch Manager link on the right pane is Internal.

6) In the control panel, Check Network and Sharing Center and then click on change adapter settings --> you should be able to find 3 adapters starts with vEthernet, those are being used with Hyper-V.
Don't change any configuration by your self without any direction from a network guy! missing around these configuration might need you to re-install all the tools and rebuild all virtual switches!

7) Check below Article for MSDN and verify you have the following configuration for "vEthernet (Internal Ethernet Port Windows Phone Emulator Internal Switch)"

http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj681694(v=vs.105).aspx

8) IMPORTANT: Turn off  any antivirus real time scanning, This turns into scanning all communications which slow down the VS/Emulator and times out the emulator running process so you won't be able to deploy your application. THIS WAS MY FINDING AFTER SPENT 3 DAYS!

After following all above instructions you shouldn't have any issues with running your WP8 Emulator.

Have Fun.




VS 2012 Update 1 is available

Hi,

Yesterday, Microsoft released a new update for VS 2012. In this first update for VS 2012, They included a lot of enhancements in terms of TFS services, SharePoint Development ALM, .NET Framework enhancements, Mobile development Enhancements and IDE fixes.

The complete list of all the updates in details are listed here:

http://support.microsoft.com/kb/2797915

So, if you are developing using VS 2012, it is strongly recommended to install this update, this is the download link:

http://www.microsoft.com/en-us/download/details.aspx?id=35774

Hope this helps.

Tuesday, November 20, 2012

Error connecting to TFS 2010 using VS BIDS 2008

Hi All,

If you are experiencing an error when connecting to TFS 2010 using Microsoft Visual Studio Business Intelligence Development Studio (BIDS) while you don't have this problem connecting using VS 2010 so follow below steps to fix it.

1) Close your VS 2008 instance if you have it open.

2) Install VS 2008 SP1 if you don't have it already.
http://www.microsoft.com/en-us/download/details.aspx?id=10986

3) Install Team Explorer Forward Compatability Update:
http://www.microsoft.com/en-us/download/details.aspx?id=10834

4) From the start menu, Open Run window and type: regedit
we need to update the default entry of your Team Explorer for TFS server url.

Navigate to:
HKEY_CURRENT_USER -->Software -->Microsoft-->VisualStudio-->9.0 -->TeamFoundation -->Servers

Right click on Server and click on add string:
set the name to: tfsservername
set the value to: your tfs server url, for example:
http://TFSServer:8080/tfs/CollectionName

Collection Name: is the project collection you want to connect to in TFS.

5) Close registry editor window and open VS 2008 BIDS.

6) You will automatically be connected to the project collection you previously specified and be able to bind your projects to the TFS 2010.

Enjoy Coding!

Hope this helps.

Regards,
Mostafa E.


Wednesday, October 20, 2010

Avoid Run Time Errors while deploying SharePoint 2010 Solutions

Hi All,

Through my discussions with developers and attendees in SharePoint Events, I was getting a lot of questions about the target .net framework for applications and solutions that are built against Server and Client Object Model in SharePoint 2010.

I decided to list the things you need to take care and set before start compiling and deploying your solutions and getting runtime errors using SharePoint object model.

1) If you are developing a SharePoint 2010 Solutions. You solution has to target .NET Framework 3.5 Only and Not 4.0.

2) Also, if you build your solutions as layers and you have different projects ( Non SharePoint Project) all are used within your SharePoint project, ALL OF THEM HAVE TO TARGET .NET FRAMEWORK 3.5 as well.

3) Your target CPU platform can't be x86. Even if you are building a console application using the client object model. The Solution ? Next Point.

4) It's recommended that all your projects to target Any CPU platform, You can't have some projects are targeting x86 ( Such as Console Application ) that are referencing x64 CPU platform.

5) You have the option "Less Recommended" to target all your project to x64. but in this case your solution will not be able to run on x86 machines. Instead, Select Any CPU platform as recommended on Point 4.

6) If you made all your projects to target Any CPU, the only point you have to put in your consideration is the file size for your solution will be bigger than if you target x64 CPU platform.

7) If you decided to enable x64 configuration, here is the steps you need to do in VS 2010 and the resource of this post:
http://msdn.microsoft.com/en-us/library/ff407621.aspx


Hope this helps.


Regards,Mostafa Arafa
twitter.com/mostafaelzoghbi

Wednesday, September 01, 2010

How can you deploy Windows LIVE Project Template on Azure

Hi All,

If you are developing windows live application using Window Live SDK June CTP, You won't be able to deploy your windows live application on windows azure if you didn't update your web.config by adding the following section: diagnostics.

PROBLEM: You won't be able to view any page in your web role project, and you will get a blank page.

CAUSE: Missing web.config section needs to be set on the Windows Live Project Template in VS 2010

To add this section do the following:
1) Create a new web role project in your solution.
2) Open web.config file.
3) Copy the section system.diagnostics and add it in your windows live application.
You will notice that you don't have this section on your windows live application.

4) Note: MAKE SURE THAT YOU DON'T HAVE DUPLICATE ENTRIES ON WEB.CONFIG for OAuthWrapCallback.ashx HTTP HANDLER.

5) Note: Try to update your host file by commenting the entry you have added, so when you deploy it you will be able to use the deployed url and not the host file entry that points to the localhost 127.0.0.1


Try to run the cloud service now and you will be able to view the default page of your web role.

This blog post is a result summary from my MSDN thread below:
http://social.msdn.microsoft.com/Forums/en-US/netservices/thread/cc7d0a30-a12f-4280-acbb-ed77f405acd6/

To download Windows Live SDK - June CTP for VS 2010:
http://www.microsoft.com/downloads/details.aspx?FamilyID=7fdf2281-3ee4-466a-a68f-ac71d47d6620&displaylang=en


Hope this helps.

Regards,
Mostafa Arafa
twitter.com/mostafaelzoghbi

Sunday, March 08, 2009

Export office system files to PDF

Hi all,

Office System 2007 save as PDF add-in now is available without 3rd party tools/add-ins.

Download link:

http://www.microsoft.com/downloads/details.aspx?familyid=4D951911-3E7E-4AE6-B059-A2E79ED87041&displaylang=en

This add-in work with all office 2007 applications such as: Word,Excel,PowerPoint,Access,Visio,InfoPath and OneNote.


Regards,
Mostafa arafa

Wednesday, March 04, 2009

24 Hour Virtual Event - TechEd 2009 Developers !!!

Hi folks,

Do you have a problem of different time zones for online trainings and workshops ? If Yes, here is a good news from microsoft :

Defy all challenges of different time zones, Now you can attend Virtual Tech Ed Event for Developers on 1st April 2009 after your registration. No matter which time zone you belongs to.

Event contains 5 tracks:
1) Windows Development.
2) Windows Mobile Development.
3) Office & Sharepoint development.
4) Developer tools , Languages and tools.
5) Web Development & User Experience.

Read more on below link:

https://www.msfttechdays.com/public/home.aspx

Happy .Netting !!!

Regards,
Mostafa arafa

Saturday, February 21, 2009

Integrate SharePoint Data to non Microsoft Portal Products

Hi all,

Great News !!! Recently MS SharePoint product team has released Web Services Remote Portlets (WSRP) toolkit, This toolkit provides developers to expose easily sharepoint data to non microsoft portal products such as : AquaLogic Portal, IBM WebSphere Portal, SAP NetWeaver Enterprise Portal...etc.

Now if you have any portal in your organization and you want to expose sharepoint data in two different ways and MS also released the source code for both of them under MS Public License.

**Download Link :
http://code.msdn.microsoft.com/WSRPToolkit/Release/ProjectReleases.aspx?ReleaseId=1943

**Announcement - Sharepoint Product Team:
http://blogs.msdn.com/sharepoint/archive/2008/12/05/announcing-the-wsrp-toolkit-for-sharepoint.aspx

**Videos:
http://www.youtube.com/watch?v=STP5ArdFlMEhttp://www.youtube.com/watch?v=xwetm92V89Q

Hope this helps.

Regards,
Mostafa arafa

Saturday, December 06, 2008

New useful tool to prepare your web server or development machine

Hi All,

We used when we want to install any software for our web servers or any of our development machine is to read alot of KBs article how to install .Net Framewort 3.5,SQL 2005 express edition...etc. and it was a long process you have to have your DVDs or download it from your partnet account website,then start your software installtion process.

Microsoft has released a new wonderful tool,to prepare all required software for installations on your machine,it shows you all available SW based on your machine OS and architecture (32 or 64bit ) and make it available on a list.

The new tool called "Web platform installer",and you can download it from the following link:
http://www.microsoft.com/web/channel/products/WebPlatformInstaller.aspx

This tool should be used by .net web developers who prepare their web server or system admins.

The tool has alot of sensitive tools and updates,the person who use it should be aware about the tools and the conflict that might happen.

I have used it and it's pretty easy and fast :).



Regards,
Mostafa arafa

Friday, November 21, 2008

Test the performance of you web pages

Hi All,

For all web developers to measure the performance of your web pages,now MS has released new tool to visualize analyze the performance of your roundtrip in your webpages called VRTA.

download link :

http://www.microsoft.com/downloads/details.aspx?familyid=119F3477-DCED-41E3-A0E7-D8B5CAE893A3&displaylang=en


This is not a substitute for the tests that you can do it with VS team system testing tools such as : load test.

hope this helps.


Regards,
Mostafa arafa

Saturday, November 15, 2008

Different Languages Interface for VS 2008

Hi All,

MS has released a new tool since that all developers all over the globe can see the translation of VS Interface in different languages other than english Interface (CLIP).

This is one announcement,the other one which is interesting,that i have participated in this product 1 year ago and i'm very happy to see it in place and all MVPs efforts are presented in one of the most favourable products for all .Net developers.

One Question will come which language did I support in the VS Dictionary : Sure It's Arabic Translations for VS.


Tool download link :

http://www.microsoft.com/downloads/details.aspx?FamilyID=4E5258D2-52F4-46B8-8B74-DA2DBEC7C2F7&displaylang=en


Happy time with VS IDE.

Regards,
Mostafa arafa

Saturday, May 17, 2008

VS.Net WSS 3.0 Extensions V1.1

Hi,

Great News,New version of VS.Net 2005 Extensions for WSS 3.0 V1.1 has been released,New templates and tools has been added and updated from the last version V1.0.

Download it now :
http://www.microsoft.com/downloads/details.aspx?familyid=3E1DCCCD-1CCA-433A-BB4D-97B96BF7AB63&displaylang=en

User Guide,to get started with VS.Net 2005 Extensions for WSS 3.0:
http://www.microsoft.com/downloads/details.aspx?FamilyID=A8A4E775-074D-4451-BE39-459921F79787&displaylang=en

The only hope i wish from Microsoft ,i want to see those extensions on Orcas ?!.




Regards,
Mostafa arafa

Thursday, May 08, 2008

SharePoint Developers' Tips for better machine performance

Hi Folks,

As a SharePoint developer or any developer who have SharePoint on your development machine, after a while of developing SharePoint sites you will find that your machine is getting slower and slower and your don’t know plus the space is eating without a clear reason.

The fast action I did, I Deleted all created sites which I don’t use or I don’t want to work on them later, I have deleted all sites with their DBs.
This a good action and bring back my machine to the regular performance J.

This is not enough, for any future work you have to take care of the following:

1) SharePoint is creating a lot of Logs in the following path :
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS
Delete the old file to gain more space.
2) Backup SharePoint DBs to cut down the log files of SharePoint databases or shrink log file size.
http://support.microsoft.com/kb/873235


Hope this helps……

Deploy your Windows App using ClickOnce on Vista Machines

Dear Folks,

If you tried to deploy you are windows application using ClickOnce in Visual Studio 2005/2008 on Vista Machine, you will find that your published installation package will not work for clients have Vista machine, Why ? The reason is simple because you as Developer didn’t include Windows Installer 3.1 on your package which is required to run your application on Vista Machine.

The same installation will work for other clients who doesn’t have Vista Machine.

Tip : Windows Installer 3.1 is included on ClickOnce Deployment Package by default if you are running Orcas on Vista Machine J.

Happy .Netting..............

Regards,
Mostafa arafa