Skip to main content

LINQ Errors: “The Type arguements for method cannot be inferred from the usage. Try specifying the type arguments explicitly ” & for the data context object “There is no implicit reference conversion from XXX RepositoryContainer(ReportContext) to System.Data.Objects.ObjectContext”.

Day before yesterday, we faced minor problem in compiling our wcf service which is using LINQ for DML operations.  It’s continuously yielding in giving the errors like “The Type arguments for method cannot be inferred from the usage. Try specifying the type arguments explicitly ” & for the data context object “There is no implicit reference conversion from XXX RepositoryContainer(ReportContext) to System.Data.Objects.ObjectContext  ”.

We are actually using Entity framework and LINQ to entity.
After a couple of hours, I actually dig into the problem and I found that the project in which the entity is being queried is missing the assembly reference >> System.LINQ. Adding reference to this fixed the problem.

Popular posts from this blog

Debugging code running on Remote machine

Before performing below steps, you need to make sure you have pdb files matching dll version on the remote machine.  Open below folder in your remote machine C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Remote Debugger\x64  Open that folder and launch as admin  msvsmon.exe  Select all options to allow firewall From Tools > Options  - Keep the settings to default (as shown below) and click ok.  At this point your remote debugger is all set. You need to connect from Visual Studio by entering Machine IP: Port (4022) 

Dynamics365 PluginRegistration tool throws Error - Assembly must be fully signed (not delay signed) though you are uploading signed dll.

You might be here because you are getting this misleading error "Assembly must be fully signed (not delay signed)" although you have successfully generated signed dll either locally or from VSO server. I am documenting this specific error scenario here as I couldn't find anything available over the internet.     I had generated fully signed dll using our VSO build definition. When I am uploading this dll to PluginRegistration tool using the assembly “Update” option, it kept throwing the below exception: Unhandled Exception: System.ServiceModel.FaultException`1[[< >]]: Action failed for assembly << TRIMMED >>: Assembly must be fully signed (not delay signed). Detail: … Earlier we were able to update the build generated assembly right from this tool. We are using the task "ESRP CodeSigning" for code signing process. When I checked the history of this definition someone had modified it’s configuration.  So during update...

Using IsInRole() with Forms Authentication

A Little background…. Page object provides User [ System.Security.Principal.IPrincipa l ] in order to access to the information about the current authenticated user. User is having following two important members. These members provide way to implement Role-based authorization programmatically. Identity [Property] [ System.Security.Principal.IPrincipal.Identity ] – This property provides important members like AuthenticationType, IsAuthenticated, Name. IsInRole [Method] [ System.Security.Principal . IPrincipa l ] – This method takes single parameter that is string value of Role for which to check the membership.