How do i get to SForceService using .Net Core 3.1 framework - wsdl

I am able to connect salesforce by using standard dotnet framework with web reference option. But, i am unable to connect SForceService by using dotnet core 3.1 framework as it is using system.web.services namespace which is not available in .net core 3.1, i have added parter wsdl file using Connected service option, the methods are not exposed to access.

I was able to get this to work and figure I should help out the community a bit here.
I was able to use the Metadata & Partner WSDL after generating a reference.cs file via WCF tools, you can achieve it either by using VisualStudio (https://learn.microsoft.com/en-us/dotnet/core/additional-tools/wcf-web-service-reference-guide) or dotnet-svcutil (https://learn.microsoft.com/en-us/dotnet/core/additional-tools/dotnet-svcutil-guide?tabs=dotnetsvcutil2x) CLI.
If you're using CLI like me, make sure you have the folder structure created correctly and add reference to the .csproj file.
Folder Structure should look like this:
Connected Services
Metadata Service
ConnectedServcie.json
reference.cs
Partner Service
ConnectedServcie.json
reference.cs
In the csproj:
Add a new ItemGroup property under Project property:
<ItemGroup>
<WCFMetadata Include="Connected Services" />
</ItemGroup>
Hope this help =)

Related

Service fabric not showing .net core 3.1

Visual Studio 2019 template for Service Fabric has a drop down to select the dotnet framework. Mine only shows dotnet frameworks and not core. I am able to create other .net core application but not service fabric. Any ideas on what to look for? I have already validated the SDKs are on the computer.
OK, I think I understand what is happening. The first thing the template creates is the project. Since my development machine's OS is Windows, it requires me to use .Net framework. Once inside the project I am able to create individual .Net Core Applications. I haven't been able to find documentation that explains this. I was initially following this tutorial which seemed a little out of date or for some other reason was missing the step for setting up the projects framework version. I don't know how the projects framework is used in either case.

how to use EF6.0 in .netframework 4.6.2 class library project referenced inside ASPNET Core 2.0 project

I am trying to use EF6.0 in Class Library Project .Net Framework 4.6.2 (Repository project) where the DBContext live next to the repository and the Entities have been created in different project(.NET framework 4.6.2) using Reverse Code First POCO,
The Repository will be called thru another (framework 4.6.2) Manager Project referenced inside ASPNET Core 2.0 SPA Project, where StructureMap used as IoC.
The first thing I faced was the issue of passing the connectionstring to the DBContext inside Repository Project, as I want to Register the services (DBContext,Repository) inside the Repository Project not from the ASPNET Core Startup.cs, the reason to that is to avoid exposing the DBContext to the frontend project, anyway I ended up hard-coding the connection string in Repo Project temporarily, "appreciate if there is another way!"
The main issue that I am facing with this design comes when the request send to collect the list of "Products", it reaches to the Repository Project where the Linq statement use _dbcontext.Product , then error message thrown
NotSupportedException: Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.
The Entityframework is registered inside Repository project, but not inside ASPNET Core 2.0 Project as it will show Nuget conflict error when its installed in ASPNET Core 2.0.
also I tried to install "System.Data.SqlClient" from Nuget in ASPNET Core2.0 but the error still throwing.
Any Idea on how to use EF6.0 in .netframework 4.6.2 class library project referenced inside ASPNET Core 2.0 project.
The Microsoft article Get Started with ASP.NET Core and Entity Framework 6 has the steps necessary for using Entity Framework 6 from a ASP.NET Core project.
Regarding the NotSupportedException, I would refer to the related question System.NotSupportedException: Unable to determine the provider name for provider factory of type 'System.Data.SqlClient.SqlClientFactory'.
I ran into the same issue because I failed to change the Core .csproj file from <TargetFramework>netcoreapp2.2</TargetFramework> to <TargetFramework>net471</TargetFramework> (which the article told me to do, but for some reason I thought wasn't necessary in Core 2.2).
I provided more explanation and details in the posted explanation/answer to the question I referenced above.

Asp.net V5 Web API fails to add reference to AspNet.Identity

I have created a new Web Api project in VS2015 community Edition using framework 4.6
This new project has no extra references other than the ones that were added by default. When I attempt to add a reference to Microsoft.AspNet.Identity I get the following error
Strangely enough, I have another Web Api project in the same solution to which I have added the same reference and it works. I can't seem to figure out what is going on here. Please help.
just try install Microsoft.AspNet.Identity.Framework via NuGet Manager.

Is wsdl used at runtime for actually making a connection

After i have used wsdl to generate web service client classes, do i still need to use the wsdl at runtime?
It seems like i dont have to, but in the generated classes , I see a url link to the wsdl file. So is the wsdl needed at runtime for the client to consume the web services?
It depends on the language. You didn't specify what you're using, but - for example...
In c#, if you generate a proxy via Visual Studio, the WSDL is not
used at runtime; it generates a class for you that is used instead.
I have seen other clients that require a local copy of the WSDL;
older versions of the MS Soap Toolkit required one. We ran into this
when using that toolkit with VB6.
According to this question, java requires a wsdl at runtime
because some dependencies are generated at runtime.

Debugging a nuget of an entire web installed into an empty web app

We are in the middle of development for a core ASP.NET MVC web project and a customer plugin in the form of an MvcContrib plugin web project -- a web project injected into the core web as an area. The plugin is a soft reference in the core project, so it can be developed completely separately and dropped in.
I am trying to generate a way to debug/code the plugin, so that the multiple custom plugins can be developed independent of the core web.
The developers should only have to worry about coding and testing the plugin code. Also, I don't want them to change the core code in this custom plugin project -- that should be done in the core anyway.
I created the core web as a NuGet package and included all the necessary files so I could include it in a web.
My thinking was that I could create an empty web, install my core web, and the developers could have an F5-driven debugging environment.
I tested by creating a blank Mvc project, installed my core package and included one of my plugins. I changed the namespace of this empty web app to the namespace of the core web, thinking that Visual Studio debugging would properly attach and my core assembly.
Simple VS debugging in the empty app does not work -- I receive an HTTP Exception, most likely due to my routes not being registered. I also see that my log4net is not creating its logs folder, so I know the assembly's app start is not being called.
So I see that VS is not attaching to and calling my core assembly.
Can I use this empty web as a host project for my nuget installed web and debug? If so, what configuration am I missing?
If not, how can I include the core web in each customer plugin project in such a way that I can drop my DLL into the bin and debug it?
Using:
Visual Studio 2010
ASP.NET MVC2
The way we are doing things that works pretty well is to use a combination of Web Activator and Razor Generator (available as a Visual Studio extension). In order to access the views within the core web application, the consuming client application needs to know about them, either because they are all included as file references inside the Nuget package (messy) or because they are compiled into the core web dll. You can do that using Razor Generator. Once installed via Nuget you would need to change the Custom Tool property for each .cshtml file to RazorGenerator, which will create a .generated.cs file for each view. This will allow your sample client to use the layout and views from the core web application.
David Ebbo has some useful blog posts on Razor Generator
Couple that with Web Activator to create a PostActivationStartMethod that runs your initialisation code (such as initialising Log4Net) and you should be good to go. We've had this running in 2 scenarios - consuming the framework package via Nuget and adding a project reference directly. Debugging was not working for the Nuget package consuming route but we don't include the pdb files in the Nuget package. We can debug when adding a project reference directly though.

Resources