I am developing a mobile application with Xamarin.Forms / Prism.
I used PCL Profile 44 until now.
That is because PCL Profile 44 contains the function of WCF.
Today, I created a project using Prism Template Pack 2.0.
A project was created with .NET Standard instead of .NET Framework.
When .NET Framework and PCL Profile 44, there was an item "Add Service Reference" in the PCL project, in Visual Studio.
However, when it comes to .NET Standard, that item does not exist anywhere.
How do I run "Add Service Reference"?
The following site is introduced to the method of WCF access with Xamarin.
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/web_services/walkthrough_working_with_WCF/
But I do not want to use this method.
In this way, you will create a WCF access process in your Android / iOS project. And here we are using SLsvcUtil.exe.
When PCL Profile 44 is used, you can write WCF access processing in PCL project. Also, SLsvacUtil.exe is unnecessary.
I tried the following plug-in, but an error occurred when adding service reference.
https://marketplace.visualstudio.com/items?itemName=WCFCORETEAM.VisualStudioWCFConnectedService
Related
I got lost very quickly in all the moves from .Net Framework to .Net Standard to .Net Core. Could someone please just tell me what I need to do to get my projects to work together?
Here's the situation: I've got a simple web service written in ASP.Net that contains a set of classes built by Entity Framework from an existing database using a "scaffold" command. The web service can respond to a request for a list of coils from a database. The list is delivered as a JSON-serialized string.
I have a simple mobile app developed in Xamarin. I want it to accept the JSON string and deserialize it into a list of Coil objects. To do that, I need to add a reference to the web service project. But when I try to do that, I get complaints that the targets of the two projects are not compatible.
The choices for target frameworks for the web service are .Net 5.0 and .Net Core 1.0 through 3.1. The choices for target frameworks for the Xamarin app are .Net Standard 1.0 through 2.1. I have been unable to find a combination of these choices that works. What choices should I use that would enable me to add a reference to the web service project to the Xamarin project?
Or should I split the Entity Framework-generated classes out into a separate library? That would probably be a better project structure anyway. In that case, I'd have three projects. The target framework chosen for the library would have to be compatible with frameworks chosen for the web service and the Xamarin app, but the framework for the web service would no longer have to be compatible with the Xamarin app's framework.
Or perhaps I should rebuild all of these from scratch. These are all trivial projects, done mainly for education, although the Xamarin app might be useful in the real world. Recreating them would be easy. Again, if I did this, what targets should I use?
All development has been done in Visual Studio 2019.
Im am experimenting with Asp.net Core. I am using visual studio 2015 enterprise.
I set up two MVC projects. The first is targeting the .net-framework and the other runs on .net core runtime (dotnet.exe).
I noticed that when I run the app (targeting .net framework) in visual studio, the diagnostics-tools window shows all kinds of events e.g. which controller action was called or if model state was valid.
This diagnostics view does not show any kind of information, when I run a boilerplate mvc project template targeting .net core runtime.
See
I do understand that .net core applications are executed by the core runtime and not visual studio directly, but is it normal that visual studio does not recognize those diagnostic events anymore ?
If so, what is the recommended way of viewing or log away this information ?
I am trying to build a .net core API using MVC, but I am trying to add it to an application that was not build on ASP.NET Core. When I try and configure the interfaces to be used in the core app (Setup.cs) I am not able to reference the interface. When trying reference the solution within the core app, I get the error
"The following projects are not supported as references: [solution name] has target frameworks that are incompatible with the targets in current project.
.NETCoreApp,Version=1.0
.NETFramework,Version=v4.5
What is the best way to be able to reference a .NETFramework project within a .NETCore project?
from comment above I realized it was not possible. I was not able to use the .net standard version in my core app.
Can I have a .NET Class Library project with Entity Framework 6.1.1 (in windowsazure.mobileservices.backend.entity nuget package) work with Xamarin.Forms PCL app? Is this achievable? If not what are the possible complications?
Question Background:
I am working on a Xamarin.Forms cross platform PCL app with Azure Mobile Services back-end, targeting Android, iOS, Windows 8.1 and WinPhone 8.1. I actually dont care about Windows 8.1 but Visual Studio does not allow me to remove this target. So it stays.
Azure Mobile Services is setup, but I need the tables to be generated automatically (strongly avoiding manually typing table definitions in azure portal). I decided to go EF code first way with windowsazure.mobileservices.backend.entity nuget package to achieve this. However, the Xamarin.Forms PCL project does not support additional assemblies.
I am thinking of adding this package into a separate class library project and referring to it from the PCL project.
Thanks for your help!
The EntityData type is the required superclass of DTOs on the server SDK. Unfortunately, it has dependencies that are not supported in a PCL project, so it has to be used with a full .NET 4.5 project.
You could instead use partial classes to share DTOs between client and server. Just put all of the non system property types in a common code file that's shared between client and server. Then, on the client, add the system property implementation (ID field, UpdatedAt optionally, Version optionally). On the server, add another partial class definition that inherits from EntityData.
I am currently checking out asp.net vnext MVC6 in Visual Studio 2015 Preview. I'm pretty new to asp.net in general, but within my company we are going to move towards creating a web api using asp.net for accessing data on our server (currently we only support wcf communication with our own silverlight application). This is the reason I am checking out the new functionalities of MVC 6 to judge whether we should wait before starting our development and use MVC 6 when it is finally released or start development now and create a Web API 2 project.
Anyway, I am looking into auto documenting the web api, which is already integrated into the Visual Studio template for a WebApi 2 project by use of Microsoft.AspNet.WebApi.HelpPage.
Now for my question, is something like this available for MVC 6 aswell? I can import the same package in my project.json in my ASP.NET vNext / MVC6 (whatever you want to call it) project but i can't do app.UseHelpPage(); in my Startup.cs file.
I suspect this is not (yet) integrated in the current release yet. If not, is there anything known about integration of this feature once ASP.NET vNext eventually hits the shelves?
Probably this feature is not available in MVC 6 yet, but you could try Swagger.
Swagger basically is a framework for describing, consuming, and visualizing RESTful APIs.
The nice thing about Swashbuckle that it has no dependency on ASP.NET MVC, so there is no need to include any MVC Nuget packages in order to enable API documentation, as well Swashbuckle contains an embedded version of swagger-ui which will automatically serve up once Swashbuckle is installed.
Source: http://bitoftech.net/2014/08/25/asp-net-web-api-documentation-using-swagger/