CodeCloudy

Azure | .Net | JQuery | Javascript | Umbraco

Easiest way to fix the svn icon overlay issue in windows 10

Rub below command Script:

https://gist.github.com/HelderMagalhaes/37ca7bbdba2b693006c46df1d8481705

Advertisements
Leave a comment »

Log Everything in a complex object C#

Download and add reference of this dll > Newtonsoft.Json.dll or Json.NET

use below method to log the entire complex object:

public static string ToJson(object value)
{

var settings = new JsonSerializerSettings
{
ReferenceLoopHandling = ReferenceLoopHandling.Ignore
};

return JsonConvert.SerializeObject(value, Newtonsoft.Json.Formatting.Indented, settings);

}

Leave a comment »

Request.Url

Get Only the Domain with protocol. in simple words base or first part of it.

String strPathAndQuery = HttpContext.Current.Request.Url.PathAndQuery;
String strUrl = HttpContext.Current.Request.Url.AbsoluteUri.Replace(strPathAndQuery, “/”);

Other Tips from Stackoverflow:

Main URL : http://localhost:8080/mysite/page.aspx?p1=1&p2=2

Get different parts of URL in C#.

Value of HttpContext.Current.Request.Url.Host
localhost

Value of HttpContext.Current.Request.Url.Authority
localhost:8080

Value of HttpContext.Current.Request.Url.AbsolutePath
/mysite/page.aspx

Value of HttpContext.Current.Request.ApplicationPath
/mysite

Value of HttpContext.Current.Request.Url.AbsoluteUri
http://localhost:8080/mysite/page.aspx?p1=1&p2=2

Value of HttpContext.Current.Request.RawUrl
/mysite/page.aspx?p1=1&p2=2

Value of HttpContext.Current.Request.Url.PathAndQuery
/mysite/page.aspx?p1=1&p2=2
Leave a comment »

Umbraco admin login doesn’t work after migrating Live to Local

Umbraco admin login doesn’t work after migrating Live to Local

Since, The schema is different, can’t login. simply change it for the user.

 

But, in 3rd party hosted remote sql servers where you have less control over, it’s difficult to do this change.

now the user is trying to login using the schema dbo, but the database migrated is having a custom schema. due to this the login can’t access any tables of the database. so, it will continuously give the error invalid object.

in that case, below script is a life saver :

REPLACE BELOW OLDSCHEMA with your old schema.

SELECT ‘ALTER SCHEMA dbo TRANSFER ‘ + s.Name + ‘.’ + o.Name
FROM sys.Objects o
INNER JOIN sys.Schemas s on o.schema_id = s.schema_id
WHERE s.Name = ‘OLDSCHEMA’
And (o.Type = ‘U’ Or o.Type = ‘P’ Or o.Type = ‘V’)

 

you will get below result. and copy and paste in a sql query and execute. Now, all should be good.

ALTER SCHEMA dbo TRANSFER socialse_care.cmsTagRelationship
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUser
ALTER SCHEMA dbo TRANSFER socialse_care.cmsTaskType
ALTER SCHEMA dbo TRANSFER socialse_care.cmsTask
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoNode
ALTER SCHEMA dbo TRANSFER socialse_care.cmsContentType
ALTER SCHEMA dbo TRANSFER socialse_care.cmsContentType2ContentType
ALTER SCHEMA dbo TRANSFER socialse_care.cmsContentTypeAllowedContentType
ALTER SCHEMA dbo TRANSFER socialse_care.cmsTemplate
ALTER SCHEMA dbo TRANSFER socialse_care.cmsContent
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUser2NodeNotify
ALTER SCHEMA dbo TRANSFER socialse_care.cmsContentVersion
ALTER SCHEMA dbo TRANSFER socialse_care.cmsDocument
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoServer
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoAccess
ALTER SCHEMA dbo TRANSFER socialse_care.cmsDocumentType
ALTER SCHEMA dbo TRANSFER socialse_care.cmsDataType
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoAccessRule
ALTER SCHEMA dbo TRANSFER socialse_care.cmsDataTypePreValues
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoCacheInstruction
ALTER SCHEMA dbo TRANSFER socialse_care.cmsDictionary
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoExternalLogin
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoLanguage
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoMigration
ALTER SCHEMA dbo TRANSFER socialse_care.cmsLanguageText
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoRedirectUrl
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoDomains
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoLock
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoLog
ALTER SCHEMA dbo TRANSFER socialse_care.cmsMacro
ALTER SCHEMA dbo TRANSFER socialse_care.cmsMacroProperty
ALTER SCHEMA dbo TRANSFER socialse_care.UCUserSettings
ALTER SCHEMA dbo TRANSFER socialse_care.cmsMemberType
ALTER SCHEMA dbo TRANSFER socialse_care.cmsMember
ALTER SCHEMA dbo TRANSFER socialse_care.cmsMember2MemberGroup
ALTER SCHEMA dbo TRANSFER socialse_care.cmsContentXml
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUserGroup
ALTER SCHEMA dbo TRANSFER socialse_care.cmsPreviewXml
ALTER SCHEMA dbo TRANSFER socialse_care.cmsPropertyTypeGroup
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUser2UserGroup
ALTER SCHEMA dbo TRANSFER socialse_care.cmsPropertyType
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUserGroup2App
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUserGroup2NodePermission
ALTER SCHEMA dbo TRANSFER socialse_care.cmsPropertyData
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoUserStartNode
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoRelationType
ALTER SCHEMA dbo TRANSFER socialse_care.umbracoRelation
ALTER SCHEMA dbo TRANSFER socialse_care.cmsTags

 

 

Leave a comment »