This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Dynamic; | |
using System.Xml.Linq; | |
namespace ConsoleApplication5 | |
{ | |
internal class ToXml | |
{ | |
public string GetXml(ExpandoObject obj, XElement rootElement) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Today I've faced a problem with Microsoft.WindowsAzure.Storage nuget package. Running the application I've got the following runtime exception: | |
"Could not load file or assembly Microsoft.Data.OData Version=5.2.0.0..." | |
I've found some blog posts that says to use binding redirect to Version 5.6.4.0. However, only configuring the binding redirect of this version will not fix the error, When I've published my application to Azure, I've saw a message on the output window: | |
1>------ Build started: Project: XXX, Configuration: Release Any CPU ------ | |
1> Consider app.config remapping of assembly "Microsoft.Data.Edm, Culture=neutral, PublicKeyToken=31bf3856ad364e35" from Version "5.6.2.0" [] to Version "5.6.4.0" [C:\Users\br.thiago.custodio\documents\visual studio 2013\Projects\XXX\packages\Microsoft.Data.Edm.5.6.4\lib\net40\Microsoft.Data.Edm.dll] to solve conflict and get rid of warning. | |
1> Consider app.config remapping of assembly "Microsoft.Data.Services.Client, Culture=neutral, PublicKeyToken=31bf3856ad364e35" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install-Package Microsoft.IdentityModel.Protocol.Extensions | |
Install-Package System.IdentityModel.Tokens.Jwt | |
Install-Package Microsoft.Owin.Security.OpenIdConnect | |
Install-Package Microsoft.Owin.Security.Cookies | |
Install-Package Microsoft.Owin.Host.SystemWeb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ApiVersion1RoutePrefixAttribute : RoutePrefixAttribute | |
{ | |
private const string RouteBase = "api/{apiVersion:apiVersionConstraint(v1)}"; | |
private const string PrefixRouteBase = RouteBase + "/"; | |
public ApiVersion1RoutePrefixAttribute(string routePrefix) | |
: base(string.IsNullOrWhiteSpace(routePrefix) ? RouteBase : PrefixRouteBase + routePrefix) | |
{ | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Testes | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void ReadShortSessionItem(SqlBytes SessionItemShort) | |
{ | |
using (MemoryStream ms = new MemoryStream(SessionItemShort.Buffer)) | |
{ | |
using (BinaryReader br = new BinaryReader(ms)) | |
{ | |
var sessionTimeout = br.ReadInt32(); | |
bool sessionDataExists = br.ReadBoolean(); | |
bool containsStaticObjects = br.ReadBoolean(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem with Microsoft.Owin 2.0.1 | |
Update-Package Microsoft.Owin -Reinstall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sometimes the root cause of HttpContext.Current null is the missing <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /> in the web.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the steps I followed to resolve the issue. | |
Right click on (load Failed) project and edit in visual studio. | |
Saw the following line in the Project tag: <Project Sdk="Microsoft.NET.Sdk.Web" > | |
Followed the instruction shown in the error message to add xmlns="http://schemas.microsoft.com/developer/msbuild/2003" to this tag | |
source: https://stackoverflow.com/a/44785842/1384539 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class StringExtensions | |
{ | |
private delegate bool TryParseDelegate<T>(string s, out T result); | |
private static T To<T>(string value, TryParseDelegate<T> parse) | |
=> parse(value, out T result) ? result : default; | |
public static int ToInt32(this string value) | |
=> To<int>(value, int.TryParse); | |
OlderNewer