Skip to main content

Posts

Showing posts with the label Visual Studio

The breakpoint will not currently be hit. No symbols have been loaded for this document. In SharePoint Development or Deploying SharePoints wsp

These symbols, Dlls can be belongs to same project or any other references from other projects. There are various reasons for this. I will explain few tips that you can try. Check for multiple solutions If the same reference libraries are referred from other solution and if it is in open in a visual studio solution, assemblies might being held with file lock by other visual studio; that cause not to deploy reference assemblies to GAC (global assembly cache).    Full Debug Information This is first to try.  Check the project build information and make sure full debug information is specified. Go to properties for SharePoint Project. Then go to build and advanced section.   Then check for debug information and make sure it is set to full.   Check Load Symbols in debug mode This is a quiet a handy way to check the symbols debug files.  First press F5 or start debugging your project. Then you ...

Report Server has encountered a SharePoint error. in SharePOint 2013

Report Server has encountered a SharePoint error. ---> Microsoft.ReportingServices.Diagnostics.Utilities.SharePointException: Report Server has encountered a SharePoint error. ---> Microsoft.SharePoint.SPException: The user does not exist or is not unique. ---> System.Exception: For more information about this error navigate to the report server on the local server machine, or enable remote errors in SharePOint 2013 This is error accouring because of Anonimous access to the Microsoft Reporting Services. According to the Microsoft ; Microsoft Reporting Service not supporting annonimous access for integrated mode. Ref: https://msdn.microsoft.com/en-us/library/bb283324.aspx#Anchor_4 So you might be wondered how you can archive this. Option One Simply you can dissable the Anonimous access from IIS. But this wont work if you really want anonimous access in your farm. For an Example If are hosting internet site with integration mode public reports you can not dissable the anon...

Browser is security restricted or JavaScript is disabled accessing Visual Studio Team foundation Servers

this is a common and simple error due to Dissable of Active Scripts. You can go to internet explorer settings and Click –> Custom Level button and Enable in Active Scripting under Scripting

you don't have permission to create new team project

  You might have encountered this problem when you are trying to create a Team Project Usign Visual Studio and You might be wondered that you are having correct permision also. Actually this is not about Permision it is all about the correct verision for Visual Studio. If you are using TFS 2013 you should use correspondign Team Explorer (Ex: Visual Team Explorer 2013) or related visual studio.

Understanding the Global Assembly Cache (GAC) and Managing , Copying Dlls from Global Assembly Cache

Most of you may confuse why there are two GACs available in the machine. C:\WINDOWS\assembly C:\WINDOWS\Microsoft.NET\assembly What is GAC GAC is a shared location in your machine that keeps assemblies, Dlls for common sharing purpose. Assume that you are using system.data.dll in your project. so one option is you can place the dll with your project. but assume you are creating another project which is also using the same .net assembly system.data.dll. so it is better to have it in a common place which that can be referred. since it is a common framework dll and used separately from your application logic it is good to place in a shared place for easy of maintenance and update process. What is  C:\WINDOWS\assembly Previous CLR s uses this place as its common location for Dlls. previous CRLs includes versions 1.0,1.1,2.0. these CRLs versions are used by before .NET framework 4. .NET Framework 1.0  - CLR v1.0 .NET Framework 1.1  - CLR v1.1 .NET Framework 2.0 ...

Programmatically Change Default Content Type in SharePoint 2013 List

  SharePoint list does not have any direct property or method to make content type default. but it is having content type ordering. thus making content type in first of the list automatically makes that content type default. following shows a sample code using (var site = new SPSite( "url" )) { using (var web = site.AllWebs[ "yourweb" ]) { var lst = web.Lists[ "Your List" ]; SPContentTypeCollection currentOrder = lst.ContentTypes;   // make default content type var newOrder = currentOrder.Cast<SPContentType>().Where(ct => ct.Name.Contains( "Content Type To Default" )).ToList(); lst.RootFolder.UniqueContentTypeOrder = newOrder; lst.RootFolder.Update(); } }    

MVC4 Session @ SL Air Force

I have hosted a MVC4 introduction and basic development session for Sri Lanka Navy (Head Quarters) behalf of Microsoft Sri Lanka. Audience was pretty good and we had  a more than one our questions and answer session Date : 31 Jul 2013 Attendance : 15 Members

The Web application at URL could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.

This is a common error we are came across most of the time. When you are running inside the SharePoint common resolutions are Running the web application in 64-bit mode. Changing to target framework to 3.0 instead of 4.0 Adding app pool identity user to WSS_ADMIN_WPG Adding app pool identity user to Administrator group Ref : http://spnovice.blogspot.com/2012/11/the-web-application-at-url-could-not-be.html But when you are creating a Web Service (WCF) or a Other Web Project which is ruining inside the SharePoint server but not inside the SharePoint You need to Change the AppPool Account to; which SharePoint is running.

Create a Web Part Page Programmatically

When creating SharePoint Solutions we need to deploy Web part pages with the solution. I'm sure most of us deploy pages as a module. But we are copying aspx page from some ware else and include it to module . (Visual studio does not allow to create web part aspx pages in SharePoint Solutions)  So I think it is good to use a method to create web part pages rather than copying from somewhere else and put it to the solution. Using below method you can add web part page to document library with  specified template. of cause you can add custom template ; in that case you can deploy custom template first and use the following method to create a web part page. First you need to generate the XML for add Web Part Page private string GetCreateWebPartPage(String list, string pageTitle, int layoutTemplate) { const string newItemTemplate = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<Batch>" ...

How to Check Bit is Set (Compare to Bits)

I had a recent requirement to check whether bit is set looking another bit. But then i found; it is easy to compare integer values it self rather than converting to bit arrays. public bool isBitSet( int value , int checkBit) { return (value & checkBit) == checkBit; } Ex: I want to check number 8 is set in 6164 , You can get it by isBitSet(6164,8)

Access is Denied when submitting Task Job to Azure Media Services

When submitting Job task in Azure media service it is giving error “ Access Denied ”. ITask task = job.Tasks.AddNew( "My task" ,processor, "H264 Broadband 720p" ,TaskOptions.ProtectedConfiguration); // Specify the input asset to be encoded. task.InputAssets.Add(asset); task.OutputAssets.AddNew( "Output asset" ,AssetCreationOptions.None); // Launch the job. job.Submit(); This is the code segment I have used. This is working in my local machine but I published to Cloud Web Site it is giving access denied error. I found that the  TaskOptions.ProtectedConfiguration caused this error. When you use this option it is accessing client machine certificate store. Since running context does not have sufficient permission; causing  access denied error. So change the TaskOptions.None . it will work.

How to Get SharePoint Client Context in SharePoint Apps (Provider Hosted / SharePoint Access ) in CSOM (Client Side Object Model)

First step of the of the app development is to correctly get the access to SharePoint client context. I have struggling with develop a simple model to initialize the SharePoint Client context. Most of the App development include ASP Master pages. So I need to figure out a working model for app development. First you need to know how SharePoint offer the contextString . contextString Offers when SharePoint is getting redirect from appredirect.aspx url. Ex :- https://rajee.sharepoint.com/_layouts/15/appredirect.aspx?instance_id={B0D5D768-303F-4AE7-A4D3-F94B687C6AB3 that point we need to capture the contextString and generate either AccessToken or RefreshToken and save it for access the SharePoint  Client Context in later time. other wise it will result in generating the  error The parameter 'token' cannot be a null or empty string (This is nasty error which drove me crazy) Normally AccessToken is valid for 12 hours and RefreshToken is valid for 6 months. In my approach ...

Break Permission inheritance and add custom permission to SharePoint 2013 List using JSOM (JavaScript Client Object Model)

First you need to refer relevant JavaScript files. <script type= "text/javascript" src= "../Scripts/jquery-1.7.1.min.js" ></script> <script type= "text/ecmascript" src= "/_layouts/SP.core.debug.js" /> <script type= "text/ecmascript" src= "/_layouts/SP.runtime.debug.js" /> <script type= "text/ecmascript" src= "/_layouts/SP.debug.js" /> Then approach is Get reference to current clientcontext get web site reference get reference to existing list break the inheritance define a role get the user finally add user and related role to the list <script type= "text/ecmascript" > function CustomPermision() { var clientContext = new SP.ClientContext.get_current(); var oWebsite = clientContext.get_web(); // provide the list name oList = clientContext.get_web().get_lists().getByTitle( 'ListName' ); oList.breakRol...

Add Fields to SharePoint 2013 List Using JSOM (ECMAScript Client Object Model)

Other Related Posts Creating a List In My previous post i described how to add a list to SharePoint. In here I'm going to  describe how to add fields to existing list.  First you need to refer same JavaScript files in your script page ( SP.core.js,SP.runtime.js,SP.js )  There are few approaches that you can use to add fields to existing list. But in my personal opinion i like following approach because It is easy rather that use XML to add entire field Intelligence are support based on field type (text, choice, user ..) Code is more readable than xml <script type= "text/ecmascript" > function addFields() { var clientContext = new SP.ClientContext.get_current(); var oWebsite = clientContext.get_web(); //Geting reference to the list oList = clientContext.get_web().get_lists().getByTitle( 'CustomList' ); // Get filed collection var fldCollection = oList.get_fields(); va...

Create a SharePoint 2013 List Using JSOM (ECMAScript Client Object Model)

JSOM (JavaScript client object model) heavily used in SharePoint App model. I'm going to post series of basic operations that can archive using jsom. First add these references to your page. //Add jquery version correctly <script type= "text/javascript" src= "../Scripts/jquery-1.7.1.min.js" ></script> <script type= "text/javascript" src= "https://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js" ></script> <script type= "text/javascript" src= "/_layouts/15/init.js" ></script> <script type= "text/javascript" src= "/_layouts/15/sp.runtime.js" ></script> <script type= "text/javascript" src= "/_layouts/15/sp.js" ></script> Then add following script to create the list. <script type= "text/ecmascript" > function createList() { var clientContext = new SP.ClientContext.get_current(); ...

Apps for SharePoint 2013 @ SharePoint Forum

Apps for SharePoint from Melick Baranasooriya

How to use SharePoint Emulator to test SharePoint list creation,Update

Open the visual studio 2012 and add empty SharePoint project.   Then create the project as farm solution by giving the testing SharePoint server URL (you can give sandbox solution as per your requirement) Then I'm going to add a feature ; which is going to create a SharePoint list in feature activation. (adding a feature receiver to the feature) Now I'm going to add a class (SPController.cs) which is used in Feature Activation event for creating the list in the SharePoint. SPController class having a method called AddListSample() that is use for create a list in the SharePoint. public class SPController { public void AddListSample(String siteURL, String listName, String description) { using (SPSite site = new SPSite(siteURL)) { using (SPWeb web = site.OpenWeb()) { Guid listguide = web.Lists.Add(listName, description, SPListTemplateType.GenericList); ...

Could not load file or assembly 'System.Web.2.0.0.0.Fakes

  Test method VisualWebPartProject1Test.SPControllerTest.CreateListTest threw exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.2.0.0.0.Fakes, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0ae41878053f6703' or one of its dependencies. The system cannot find the file specified.WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. Result StackTrace This error occurred to me when i try to test a SharePoint emulator with a test project.I tried in many ways and it is a simple code; but i wonder why it is  giving this error. i but the dlls to bin and did various things but nothing worked for me. then what i did was 1. First Uninstall the existing em...

Step by Step guide to create a Client App Part in SharePoint Hosted Development Environment.

I think you already know about hosted approaches in SharePoint 2013. There are three types of hosted approaches ( SharePoint-Hosted, Provider-Hosted, Auto-Hosted ).  Though there are similarities as well as differences. Thus there are slightly differences in developing client app part in SharePoint Hosted Model.    This is Step by Step Guide to Create a Client App part. Create a Visual Studio Project by specifying SharePoint Hosted option. Then Visual Studio will create a project for you. ( If you looked closely you can find out it is referring jQuery 1.6.2 version that is quite old. So if you want you can right click the project and go to NuGet Manager and install new version. ) Now we are going to add a Client App part. Client App Apart is concept which allows to run SharePoint pages inside the iFrame. Therefore you can theoretically display any page inside the client app part. As a guide I will show two types of Client App Parts. Simple A...