use SharePoint API from c# December 7, 2022
Posted by juanpablo1manrique in SharePoint.add a comment
string clientID = "XXXX";
string clientSecret = "XXXXX";
string resourceUri = "https://XXXXXXXXX.sharepoint.com/";
string authorityUri = "https://login.microsoftonline.com/XXXXXXXXX.onmicrosoft.com";
AuthenticationContext authContext = new AuthenticationContext(authorityUri);
var credential = new ClientCredential(clientID, clientSecret);
Task<AuthenticationResult> result = authContext.AcquireTokenAsync(resourceUri, credential);
result.Wait();
string token = result.Result.AccessToken;
return token;
foreach a generic list returned in a method by reflection October 3, 2019
Posted by juanpablo1manrique in SharePoint.add a comment
Un ejemplo bastante útil,
La definición del método en el .dll original
public List<CarroEntity> ObtenerCarros() { List<CarroEntity> list = new List<CarroEntity>(); list.Add(new CarroEntity() { Color = "Azul", Marca = "Mazda", Placa = "DSF450" }); list.Add(new CarroEntity() { Color = "Amarillo", Marca = "Renault", Placa = "ESF245" }); list.Add(new CarroEntity() { Color = "Verde", Marca = "Mercedes", Placa = "KLS435" }); list.Add(new CarroEntity() { Color = "GrisPlata", Marca = "BMW", Placa = "NBD645" }); list.Add(new CarroEntity() { Color = "Negro", Marca = "Mazda", Placa = "BGT845" }); list.Add(new CarroEntity() { Color = "Blanco", Marca = "Mazda", Placa = "BHT545" }); return list; }
Llamar este método por reflection
Assembly asm = Assembly.LoadFrom(@"D:\MyCode\MyCode\JUAN.WinWPF\JUAN.Carros\bin\Debug\JUAN.Carros.dll"); Type t = asm.GetType("JUAN.Carros.CarrosBL"); var methodInfo = t.GetMethod("ObtenerCarros"); if (methodInfo == null) { throw new Exception("No such method exists."); } var objBLInstance = Activator.CreateInstance(t, null); System.Collections.IEnumerable instances = (System.Collections.IEnumerable)methodInfo.Invoke(objBLInstance, null); Type tEntity = asm.GetType("JUAN.Carros.CarroEntity"); var property = tEntity.GetProperty("Placa"); foreach (object obj in instances) { Console.WriteLine(property.GetValue(obj)); } Console.ReadLine();
Saludos
View the structure of the GAC folder July 31, 2019
Posted by juanpablo1manrique in SharePoint.add a comment
start > run > cmd
type : “cd\windows\assembly”
type: “attrib -r -h -s desktop.ini”
type: “ren desktop.ini desktop.bak”
Anonymous authentication fails and redirects to login July 9, 2019
Posted by juanpablo1manrique in SharePoint.add a comment
Anonymous authentication fails and redirects to login (SHP2013, SHP2019)
302 http:// [mi sitio]
302 http:// [mi sitio]/_layouts/15/Authenticate.aspx?Source=/
200 http:// [mi sitio]/paginas/[Custom.aspx]?redirectURL=/_layouts/15/Authenticate.aspx?Source=/
Alguien por error le puso este chulo, loco,
A required component for using a geolocation field is not installed. Either go to the list settings page to delete this field or contact your administrator June 28, 2019
Posted by juanpablo1manrique in SharePoint.add a comment
Solo funciona con el instalador de SQL 2008 R2
Se ingresa a descargar…
https://www.microsoft.com/en-us/download/details.aspx?id=26728
y le dices…
1033\x64\SQLSysClrTypes.msi
AADSTS65001: The user or administrator has not consented to use the application with ID named Send an interactive authorization request for this user and resource. May 10, 2019
Posted by juanpablo1manrique in SharePoint.add a comment
Este error se presenta porque no se ha terminado el registro de la aplicación en azure,
Este ultimo paso es el que no incluye la documentación
Saludos,
Can’t Open Enterprise Calendars Project Server January 8, 2019
Posted by juanpablo1manrique in SharePoint.Tags: ProjectServer
add a comment
Con este error,
Project Cannot open the file
– check that the file name and path are correct
– check that the file format is recognized be project
Project files saved in a version earlier than Microsoft Project 2000 can’t be openen
If your file is from an earlier version, open it in that version, click Save as (File menu), and save in MPX format. Open the MPX file in the current version of Project. When you use this method, project data is imported, but formatting is lost.
Solucion,
- Agregar el sitio del pwa http://midominio en el listado de trusted sites, en el explorador IE 9 o IE 10, que es el único que abre,
- Tener la granja actualizada con un CU superior a Abril 2018,
- Asegurarse de tener el sitio de PWA registrado en el Project Profesional que esta por defecto
CRM: AuthenticationParameters: Object reference not set to an instance of an object October 16, 2018
Posted by juanpablo1manrique in SharePoint.Tags: CRM
add a comment
Este código me estaba arrojando un error,
AuthenticationParameters ap = await AuthenticationParameters.CreateFromResourceUrlAsync(
new Uri(serviceUrl + “api/data/”));
return ap.Authority;
El error que arrojaba era del tipo
Object reference not set to an instance of an object
Para solucionarlo fue necesario agregar la siguiente línea en el web.config
<httpRuntime targetFramework=”4.6″ />
La dirección URL Documents/filemy.doc no es valida. Puede que haga referencia a una carpeta o un archivo que no existe, o una carpeta o un archivo válido que no está en el sitio web actual. July 12, 2018
Posted by juanpablo1manrique in SharePoint.add a comment
Este error sale en SharePoint Online,
La causa fue una columna calculada que tenia un formato incorrecto.
The URL <file name> is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web.
Otra posible solución es esta
Salu2