Adding AJAX-enabled WCF Service to the Solution throws an error - ajax

I am just trying to learn Ajax enabled WCF service, when I try to create a new web application and add new item "AJAX-enabled WCF Service" I get an error message that "The extension of type 'System.ServiceModel.Configuration.WebScriptEnablingElement, System.ServiceModel.Web, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' is not registered in the extension collection 'behaviorExtensions'.
I had .net2.0/VS2005 and then I installed VS2008.

I was able to solve the problem after I reinstalled .Net 3.5. Thanks to Social.Microsoft forum.

Related

Want a common EnterpriseLibrary for .NET Core MVC (common database file)

Currently, I am learning .NET Core and updated my site from ASP.NET MVC to ASP.NET Core MVC.
In ASP.NET MVC, I used Microsoft.Practices.EnterpriseLibrary for handling the database related tasks. But when I used this library in .NET Core, I got this error:
FileNotFoundException: Could not load file or assembly 'System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling.SqlDatabaseTransientErrorDetectionStrategy.IsTransient(Exception ex)
Can anyone help me to get the example of all types of SQL operations with Enterprise Library and RetryPolicy? I want to create a database common file from where I can do all SQL operation

Errors when trying to use StackExchange REDIS in Azure Cloud Service Worker Role

I have a solution hosted in Azure that is using ServiceStack.Redis 2.0.601.
App Services (Web API) and On-Premise windows services are all working as expected but the Cloud service worker roles are throwing binding errors.
Add Binding redirect and enable auto binding redirect in the worker role.
Use ILSpy to verify the versions that are copied by the build have same version as defined in the binding redirect.
Use fuslogvw.exe to catch binding errors but couldn't make it get any data from the Cloud Service Emulator
I'm running the same code with same app configs in other type of projects and all working great
The code is very simple, Create a cloud service with one worker role.
Add StachExchange.Redis nuget version 2.0.601 and try to connect a REDIS instance using the following line:
var connection = ConnectionMultiplexer.Connect(#ConnectionString#);
This is the only line I have in the code inside WorkerRole.OnStart Method.
System.BadImageFormatException: 'Could not load file or assembly 'System.Memory, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)'
I was getting similar errors, and realized I needed to add a bunch of additional Nuget packages.
System.Buffers
System.IO.Pipelines
System.Memory

Could not load type 'System.Web.Http.WebHost.HttpControllerHandler', in Mono / xsp4

I'm getting this error when trying to access Web API controller, accessing via 127.0.0.1/api/myController/1
Could not load type 'System.Web.Http.WebHost.HttpControllerHandler'
from assembly 'System.Web.Http.WebHost, Version=5.1.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or
object): System.Web.Http.WebHost.
Why is this happening? I see that it exists in System.Web.Http.WebHost.
The error was due to the use of latest assemblies via NuGet. It turns out that, currently, Mono isn't completely compatible with WebAPI v5.1.
I replaced all my MVC libraries with a previous (v4.0) version and it all worked.

Adding a WCF Data Service reference to another WCF Data Service

We currently have two different applications consuming our OData, WCF Data Service
We want to add a third application, but this one, rather than being a website, is another WCF Data Service. It is effectively a subset of functionality, exposing some methods from the internal service to as a public api.
As soon as I add a reference from one WCF Data Service to another, I end up in a conflict between System.Data.Services in the GAC and Microsoft.Data.Services implementations of DataService.
Is there a proper way to create an OData WCF Data Service wrapper for another OData WCF Service?
This is the error
Error 1 Reference.datasvcmap: The type
'System.Data.Services.Client.DataServiceCollection`1' is ambiguous: it
could come from assembly 'D:\source...\bin\Microsoft.Data.Services.Client.DLL' or from
assembly 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Data.Services.Client\v4.0_4.0.0.0__b77a5c561934e089\System.Data.Services.Client.dll'. Please specify the assembly explicitly in the type
name. App_WebReferences/WcfDataService/
Not sure it has to do with the wrapping (may just be a side-effect from the way you set it up in Visual Studio). Try removing the reference to System.Data.Services.Client.dll, I believe the OOB NuGet packages are favored.

Add WCF Service Reference to Umbraco

Im currently using Umbraco 4.11 that is integrated to an asp.net mvc 3 application. Im trying to reference a wcf service in the umbraco project by selecting Add Service Reference in visual studio but I can not seem to access the service library once it is added. I tried to look into the object view browser and I couldn't find the object namespace for the wcf service. Am I missing something? Is this method of consuming wcf service in umbraco possible? I prefer not to use a separate project that uses a user control to access the wcf service since it seems to be tedious to do.
There is a warning when adding a service reference:
Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Could not load file or assembly 'umbraco, Version=1.0.4090.38017, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
You may want to setup the service reference in a separate project, then migrate the dll and the web.config settings. Then you should be able to access your web service via razor after adding using statements.
The problem is that the code file for the service isn't being generated because of a conflict with umbraco. You could alternatively generate the code file manually using svcutil.exe.

Resources