.status-msg-wrap { display: none; }
Thursday, January 31, 2019
no image

Bundling JS Files

What is the "Industry Standard" for bundling JS files in .NET apps? I've read about using CDNs to store third party JS files and then we just keep ours locally.

I'm working on bundling and the current implementation creates a separate bundle for each page, so we basically bundle jquery & other common js files in a million bundles, which creates poor experience for users loading web pages.

I attempted to add all of those bundles and load them once on a single page but that page either times out or the browser refuses to load any more bundles, as the show up as "cancelled"

Bundling JS Files Click here
no image

UWP?

I have not followed progress of .NET for few years as I was stuck on legacy systems. I'm struggling to understand how does UWP as a platform works.

Is UWP one of .NET Framework implementations with addition of UWP UI libraries? Under what runtime does UWP works (CLR, CoreCLR)?

UWP? Click here
no image

.Net Core MVC REST API

Hi all.

I would like to share this tutorial about how to make a REST API using .Net Core MVC. Was a very good explanation for me and also has a blog where you can read it if you don't want to watch the video.

Check it out!

Video: https://www.youtube.com/watch?v=mUAZ-EbGBOg&t=2s&index=2&list=LLIDCCf35CWhBPqI-eQkmQEA

Blog: https://binarythistleblog.wordpress.com/

Github Repository: https://github.com/binarythistle/S02E01-REST-API-.Net-Core

.Net Core MVC REST API Click here
no image

Choice of RDBMS with ASP.NET Core for Linux production server?

As title suggest I am looking for suggestion based on someone's past experience that which RDBMS is better on linux server with ASP.NET Core. So far we have used SQL Server including Azure SQL Database as service. I know SQL Server on Linux is a thing but not sure one should use it or MySql or any other database?

Choice of RDBMS with ASP.NET Core for Linux production server? Click here
no image

Clean Architecture generation script

Would there be any public interest in a powershell script that initialized a dotnet-core solution using the Clean Architecture/onion model? This would involve the projects, nuget packages, and possibly even default Dockerfile or Gitlab CI builds.

We're building one internally, and we might publish it openly.

Clean Architecture generation script Click here
Wednesday, January 30, 2019
no image

Web app controller actions to class library?

I have a web application that has some controller actions that run each run a process after clicking some buttons. This involves making database calls and updates using entity framework which was done using code first. All the code for everything in this web app is maintained in one project. I was asked to extract the code in these actions and turn them into methods in the class library so that we can run the processes from other applications.

What would be the best way to accomplish this?

Would I have set up the class library into code that uses database first entity framework?

Or do I make another library that has all the database access code that uses code first that’ll be referenced by the class library and the web app? I’ve never made a class library so this is all new to me so I’m not sure what my options are.

Web app controller actions to class library? Click here
no image

Help Wanted DDD (Domain Drive Design)

Im building a API that will provide some information about soccer games like position of each time on the table, goals for etc.

I have a Aggregate that contais the entity club(clubId, name, ICollection ClubResults), ClubResult is a value object.

Club Entity :

public int timeId { get; private set; }public string Name { get; private set; }public int league { get; private set; }public ICollection<ClubResult> ClubResults { get; set; }

//Public Methods ...

ClubResult :

public int season{ get; private set; }public int position{ get; private set; }public int points{ get; private set; }public int played{ get; private set; }

//Other Properties ...

Im with a doubt about the property league in Club entity, i dont know if it shoud be a other Aggregate, the league is a division os soccer clubs, example : Division a, b, c ....

Could Some one help me with that doubt ? Could i create a Aggregate to the league ? if i create a aggregate to the league could i share the league aggregate with the club aggregate ? If i can't how could i ensure that a league exist when i create a new club or update a info of club ?

Thx.

Help Wanted DDD (Domain Drive Design) Click here
no image

What are peoples experiences of VS 2019 Preview 2?

Sure loads fast.

Crashes multiple times a day. Some with a "turn off and turn on message, which I ignore. Other times with a hard shutdown.

Seems to hate JS (but so do I)

I am missing not having ReSharper in it, for generating Constructor injection. I don't see it as an option on the menu. Trying to see how I can get on without RS

I am doing asp.net core 2.2 with Jquery front end.

I have been doing some React, but either the ide is buggy or I just don't get it as its hard to get some components working.

What are peoples experiences of VS 2019 Preview 2? Click here
no image

Connect iOS App to backend of ASP.NET Core Angular Web Application

Hello, I'm trying to figure out how to connect an iOS app to the backend of an ASP.NET Core Angular Web Application. I believe I just need to make calls to the REST API built into the web application but am having trouble figuring out to expose the localhost server (running through IIS) to the network so that I can make calls to it from a different computer than the one that the web application is running on. Sorry if I am not explaining this correctly, this is all new to me, but any help would be greatly appreciated.

Connect iOS App to backend of ASP.NET Core Angular Web Application Click here
no image

GraphQL for existing web services

I have a very large API with well over 100 endpoints which provide data entities using CRUD operations. I have a well-designed DbContext which describes the relationships.

I am soaking up as much as I can to learn GraphQL on .net core with EF. Seems to be a LOT of regurgitation of the Star Wars and hockey samples, and those are not helping me.

Most examples have you creating the models from scratch. OK, for a learning exercise, I get that. But now I want the intermediate lesson - integration into an existing .net core with EF existing code base.

I was able to locate a project on Git that appears to do just what I want: https://github.com/lukemurray/EntityGraphQL. I think that this guy is really ahead of the curve with the work that he is doing. However.....

All of his work as of late is reflected in unit tests, which do not hit the endpoint. And the demo app has fallen out of sync with his work. As have the examples in the Readme. They do not work! I do not see that anyone has forked the project, either.

So, if you are still with me, my question.... Have you been able to get this working, or have you found a similar solution to plug in to your DbContext?

Or do I just start entering the issues to get his attention? I am allowing for this to be cockpit error on my side...

Thanks.

GraphQL for existing web services Click here
no image

Question about creating environment agnostic ASP.NET artifacts

Please excuse any ignorance or misuse of terminology in my question, I'm a foreigner to this part of the .NET world.

I've inherited an old ASP.NET web application (.NET 4) that gets deployed to IIS 7. The current build and deploy process is done manually and I'm tasked with automating it. If I only had one environment to deploy to, or the same connection strings in each environment, I'd be finished already. But life is never so simple. It's currently set up with separate Web.[configuration].config files that get transformed/overlaid on the base Web.config at build time, giving us a final Web.config file with environment specific connection strings, app settings, etc.

But I want to stop creating environment-specific artifacts. We want to create a build artifact once and then deploy that artifact to development, QA and production without rebuilding. I'm having a hard time coming up with the right solution. My instinct was that I could use an environment-agnostic Web.config file that imported another config file that would be pre-deployed to the environment. For example, it would have a section like: <connectionStrings configSource="C:\configs\connString.config"/>. But that doesn't work because it can't load a config file that isn't in the application directory, so that's a dead end.

I can think of lots of ways to accomplish my goal (like just copying out a new Web.config over top of whatever is there after I've deployed the application) but they all seem a bit hacky. Is there a recommended way of having different configuration values for different environments without creating a new build per environment? This seems like such a standard thing to do and yet I can't find a straight answer, which makes me think I'm missing something obvious.

Thanks in advance!

Question about creating environment agnostic ASP.NET artifacts Click here
no image

Any good, complete resources for WPF data binding?

I've got a side project that is requiring some use of WPF. It's been years since I've used it and data binding subtract was never my forte. Unfortunately most of the resources I've found to get back up to speed are very focused on one specific situation (which never seems to be my situation) and figuring out the proper syntax and approach for data binding has been tedious.

Does anyone out there have a really good comprehensive coverage of data binding that does more than tell me how to bind a text box to a slider?

Thanks

Any good, complete resources for WPF data binding? Click here
no image

What's a good log writing library for framework?

I have a need to generate a log file for a full framework app. I know there is Log4Net, but I need a library that handles the following:

- Writing as CSV

- File rotation

- Not adding in any extra text in the file, such as "Info", "Warning", etc like Log4Net does

Any recommendations?

What's a good log writing library for framework? Click here
no image

Integrate ASP.NET Core MVC with Firebase

Hi everyone, I'm learning ASP.NET Core MVC and in order to improve faster I've decided to develop a little web app. I really want to use Firebase Database as... database but, surprisingly, I don't find any useful resources that could show me how to do that.

Do you have any tips or link that could be useful for me?

Thank you so much

Integrate ASP.NET Core MVC with Firebase Click here
Tuesday, January 29, 2019
no image

Question regarding hosting/Docker/Kubernetes

Question, working on my long term plan for my project. Have been turned onto the whole Docker/Kubernetes thing. I'm used to traditional hosting yada yada.

Do/Can people use Docker/Kubernetes for large platform sites? Talking thousands of concurrent connections etc? Or should I just think of it like an Admin, get the biggest servers I can afford with some phat in/out pipes to the Interwebz? And let the Linux/Docker/Kubernetes do their thing (I know, it's not as simple as that :) )?

I know when it gets to the thousands of users or anything servers are going to be split into different functions, DB's are going to have there own servers to load handle etc. Just curious though. Ways off from anything but always good to plan ahead. 

Also, I know we have AWS, Azure, DO etc out there. Besides going in house who do people prefer? (Loaded question I know :) ) I've been using AWS for some of my EC2 stuff. I have a feeling a large platform would be quite expensive to run offsite if it had a lot of traffic. What do you guys think?

Regards,

Scrub

Question regarding hosting/Docker/Kubernetes Click here
no image

Help Wanted

I'm designing a language for .NET Core, it's "almost" complete (no implementation yet), but I need to make some design decisions, and work on a few major topics.

The language is C#-like with enhancements, but the important is its semantics:

  • Nullability and mutability tracking in the type system.

  • Pervasive values, any class can be allocated in the heap or in the stack, and ownership tracking with move semantics.

  • Value ADTs and pattern-matching.

  • try-catch error handling based on values (typically ADTs).

  • Explicit differentiation of values from references with lifetime tracking.

  • Language built-in RAII-like resource management for external resources and automatic clearing of managed references.

  • Object-Oriented with strictly only interface inheritance, and implementation reuse by composition.

  • Structured concurrency.

  • Built-in native interop and unsafe code.

The idea is how all this features work together to make a middle level (lower level than C# but not native) and convenient language, so as to be applicable for high performance networking and web services, Indie games, low latency audio synthesis, signal processing, scientific computing, etc.

Now, the question is: would you want to help me in this project in your spare time? All online, open source, without pressures, and for free? :)

Help Wanted Click here
no image

Help with Asynchronous SPA

Good afternoon fellow redditors,

I have built a Web Forms ASP.NET website that is meant to work like a single page application and let the user navigate through the website without the need for a page refresh and with the least delay possible, for a better user experience. I used Web Forms because of past experience with it and for pure ignorance I thought what I had in mind was easier with it. Now I have an almost fully working web app that is mostly a bunch of forms and is updated though callbacks. I come here to ask those who have experience with Single Page Applications that work and update Asynchronously: what approach should I take to make my website work like I want it to. I have considered AJAX calls for every button, since they stop working when I load the page through AJAX. Should I do this, should I migrate like to ASP.NET Core and maybe implement some JavaScript framework, should I just ditch .Net at all and remake my website with something like Node.js?

I am sorry if I seem ignorant about the subject, it’s because I am still figuring it out and how everything works.

TL;DR: I have a Web Forms application, need to make it an Asynchronous Single Page Application, how should I do it? (note: rewriting the whole project is an option but obviously I would prefer not to)

Help with Asynchronous SPA Click here
no image

Best CMS for backend developers (does not have to be .net based)

I read a previous post on here about the CMS everyone uses most at work and umbraco seemed to be the most popular. I have been trying it out and I know the learning curve is high but I still struggle a lot with the front end aspect. I wanted to know if anyone suggested any others that are more tailored to people who lack front end skills. I have tried wordpress before as well but dont love it.

Best CMS for backend developers (does not have to be .net based) Click here
no image

ASP Core. Blue green deployment. What to do with static files?

ASP Core Api which has Angular 7 client app inside.

The goal to implement in the future Blue green deployment. However I do not know what the best practise regarding static files in Blue green deployment.

Of course when doing deployment I can copy static files from one wwwroot to another each time. But by my opinion it is better for this goal to have static files completely outside of app. I red that PhysicalFileProvideris needed to implement this.

App most probably will be hosted in Linux.

Is it ok, any posible issues with this approach?

ASP Core. Blue green deployment. What to do with static files? Click here
Monday, January 28, 2019
no image

Help to Disable WCF Authentication for TCP Binding

I have an old windows service I am just keeping on life support for now. It struggles at times when there is a high volume of WCF traffic and there is a need to get more speed in the short-term. Disabling WCF Authentication seems to be very promising (it's a LOT of chatter, so a ton of NTML Auth) but I have not had any luck identifying the right combination of settings on the client and server side to get it to work properly. Would someone offer suggestions or examples of working WCF config settings I could try?

Thanks in advance!

On the Server side:

<bindings>

<netTcpBinding>

<binding name="TCPBinding" closeTimeout="00:10:00" openTimeout="00:10:00" sendTimeout="00:10:00" listenBacklog="1000" maxBufferSize="10000000" maxConnections="1000" maxReceivedMessageSize="10000000">

<readerQuotas maxDepth="10000" maxStringContentLength="10000" maxArrayLength="10000" maxBytesPerRead="10000" maxNameTableCharCount="10000" />

<security>

<transport>

<extendedProtectionPolicy policyEnforcement="Never" />

</transport>

</security>

</binding>

</netTcpBinding>

</bindings>

On the Worker/Client side:

<system.serviceModel>

<bindings>

<netTcpBinding>

<binding name="TCPBinding" maxBufferSize="10000" maxReceivedMessageSize="10000"><readerQuotas maxDepth="10000" maxStringContentLength="10000" maxArrayLength="10000" maxBytesPerRead="10000" maxNameTableCharCount="10000" />

</binding>

</netTcpBinding>

</bindings>

<client>

<endpoint address="net.tcp://Server01:7977/App/Function" binding="netTcpBinding" bindingConfiguration="TCPBinding" contract="AT2.Batch.Interface.Controller.IService" name="Controller Service">

<identity>

<servicePrincipalName value="host/localhost" />

<certificateReference storeName="My" storeLocation="LocalMachine" x509FindType="FindBySubjectDistinguishedName" />

</identity>

</endpoint>

</client>

</system.serviceModel>

Help to Disable WCF Authentication for TCP Binding Click here
no image

How would you build a REST API in 2019?

My company is about to start on a large API project. We have a large legacy WinForms app, and we need to move the data access for it behind an API so that we can build out a modern web app and modernize our supporting services. I'm doing some preliminary research on best practices and so on... questions in no particular order, also interested in any other input or suggestions people have.

  • It seems like .NET Core is a given at this point, but how are its supporting libraries? Are there still any major pain points with EF Core?
  • Handling authentication? I assume JWTs are probably the standard, is all the tooling for handling them built in, or any libraries I should be looking at?
  • Libraries for helping with query params (search/sort/paging)? Would definitely prefer to avoid rolling our own if possible. I have some past experience with OData and wasn't a huge fan of it, hoping for something that's easier to use on the back end.
  • General back end architecture? Have libraries like MediatR become more standard or do most people still lean towards a pretty traditional service layer and data access layer?
  • Versioning? We'll have to deal with it eventually... anything we need to consider from the start?
  • Documentation? I'm guessing Swagger is the standard, how is the tooling around it in .NET Core?
How would you build a REST API in 2019? Click here
no image

Loading .resx at runtime

I'm working a request where the resx files are not included in the solution but loaded at runtime. I'm thinking it would look like how the appsettings.json files can be loaded at startup.

I haven't seen a solution that would let me load the localization text (resource file) at runtime vs at compile time. Does anyone have a suggestion of how this could be implemented?

Loading .resx at runtime Click here
no image

Problem with loading a binary image from the database inside a listview in asp.net

Hey guys, i need help with a simple thing.

I'm making an e-commerce in ASP.NET (it needs to be this language) and i'm currently having problem to make the product catalog. I'm using listview as a way to load the information from the database and i managed to get workthe load the text information (such as id and price) but i'm having problems loading the image.

The image is in byte format. I converted it to the database through c#. Here's how it looks https://imgur.com/8OGjXnX.

The main problem is that the image doesn't appear at all, just an icon. After so many tries for me, an icon, it's actually a progress haha. Icon problem > https://imgur.com/847HA6g

Here's my itemTemplate inside the listview: https://pastebin.com/rNFV5i4J

Here's my c# code behind it: https://pastebin.com/c7gFwdJw

After research i coudn't find a proper way to do it, since it loads as the information is received from the database. Sorry for any spelling mistakes, english is not my first language haha. Thanks

Problem with loading a binary image from the database inside a listview in asp.net Click here
no image

What are the best places\platforms for self-promoting in .NET ecosystem?

I'm looking for best places to promote yourself as a developer by writing tech stuff. Personally, I already have a mini-blog on medium, I know about dev.to. When I write an article\tutorial I share it within the reddit and so the knowledge spreads. But I also want to know about places where developers share knowledge specifically about .NET ecosystem. I'd like to be a part of the movement. Maybe there are some popular discord\slack channels around?

Thank you!

What are the best places\platforms for self-promoting in .NET ecosystem? Click here
no image

What is currently the fastest orm?

We’ve been using petapoco for many years now and are maybe out of the loop.

Which orm is currently the fastest, or the best to implement against a sqlserver.

What is currently the fastest orm? Click here
no image

.Net Core application currently has Windows Docker support. How can I convert it to Linux Docker support?

I have been playing around with containers the past couple of weeks and I have really been enjoying using Docker. I just found out about NginX and I decided that that was something I really wanted to utilize. Problem is, I need to be on Linux. Which it’s no problem for me to set up, but how can I set up my application for it when I’ve already set it up for Windows? Can I just rename the Dockerfile and create a new one with the Linux build info in it? Or is it not that simple?

.Net Core application currently has Windows Docker support. How can I convert it to Linux Docker support? Click here
no image

Asp.net DropDownList, limit text shown in list separate from the controls width.

Hey, I am working on adding some features to a custom user control that essentially uses a textbox + a dropdown list to mimic the functionality of a forms combo box, so that when a user selects an item the text is placed in the text box so that it can be further edited before being saved in the database.

Here is the basic setup for the control

<asp:TextBox ID="CTText" TextMode="MultiLine" Width="80%" Height="60px" runat="server"></asp:TextBox> <asp:DropDownList ID="CTDDL" runat="server" Height="21" AutoPostBack="True" Width="20" OnSelectedIndexChanged="CTDDL_NewSelection" OnTextChanged="CTDDL_TextChanged"></asp:DropDownList> <asp:ImageButton ID="BtnAddPanel" runat="server" ImageAlign="Baseline" ImageUrl="~/_assets/img/plus.png" OnClick="BtnAddPanel_Click" /> 

The issue I am trying to figure out is how to limit the text displayed in the drop list itself, there are some very long options and I would like to only display a substring of the first 100 characters or so to differentiate between selectable values but keep the value itself as the full text so when selected the full text gets added to the textbox.

I have found examples of how to do this for a Gridview by setting the text properties to evaluate the value and get the substring, however for a dropdown list it appears it wont be just that easy.

Text='<%# Eval("Content").ToString().Length > 100? (Eval("Content") as string).Substring(0,100) + " ..." : Eval("Content") %>' >

trying to figure out if I can adapt this approach without hacking about with the list itself in the backend code.

thanks in advance!!

Asp.net DropDownList, limit text shown in list separate from the controls width. Click here
no image

Question regarding Microsoft's documentation about .NET Core and inheritance

On this MS documentation page, they set up an interface IMyDependency and another class that implements that interface, MyDependency.

A few scrolls in it then says this:

IMyDependency ... must be registered in the service container.

and then proceeds to have a code sample of:

services.AddScoped<IMyDependency, MyDependency>(); 

I'm not understanding why you need to provide a link between the interface and the concrete class? I understand the concept of inheritance and I know the inheritance will work without this 'linking'. So what is the benefit of this linking?

Question regarding Microsoft's documentation about .NET Core and inheritance Click here
no image

[Question]

We have a very old application using .Net Framework 4 that we want to update and start using services instead of one monolithic application.
We ship the same application for every customer, often tho, we have custom code for customers. Up to know we have cloned the project and overriden the specific methods.

We want to create services using .net core web api. So my question is: to still support custom code but make it more managable, is it possible to have a "base" web api project implementing all the endpoints and use that inside another web api project as for example a middleware, so we can implement customer specific stuff inside the project that uses the middleware?
Say the base project implements GET "api/customers/", we want to change the behaviour for this endpoint heavily so we want to custom code only it. So we create the same endpoint on the customer project using the base project as middleware and simply write the custom code inside there so that get's called instead of the endpoint in the base project.

Is it even possible to use another .net core web api porject like that inside another? Does that seem like a good approach or do you have other ideas on how to implement this?

[Question] Click here
Sunday, January 27, 2019
The webdev Team