« first day (2183 days earlier)      last day (2768 days later) » 

12:02 AM
Hi-Ho!
 
12:31 AM
@hsimah ask away, but I'm not super familiar with it, only used it a couple of time
 
I have two sets of data that I am caching. One is a directory structure and the other is file content. The file content will get quite large, and I want it to be the first to be flushed if the server reaches memory limit.
I don't even know if it is a feature or what it would be called so I am finding it hard to research
 
is redis a framework?
 
it's a an in-memory data structure store
for caching and database-like storage
 
I am playing there 'game'
 
12:49 AM
4 AM and i am tired to google :D anyone here online know of a way to get the Identity of the new SQL record i just made using C# Entity Framework ?
meeeeeeeeh :| Forget it i just use the EmailAddress instead of ID, Much easier :D Since it's unique too anyway so no different for my work xD ( Except I can't use .Find on it anymore lol )
 
 
3 hours later…
4:06 AM
 
 
4 hours later…
7:49 AM
good (ugt) morning
@Pedram after save, the id will be in the id field
 
Morn all
 
8:18 AM
Yo mates, is it possible make Decimal store 12.1234 values?
nvm i was doing it correctly using decimal.Round.. EF was rounding it from 4 to 2 ^^
 
War
8:40 AM
glad I could help there @QuietNaN
I feel like that contribution I made was really worth the effort
 
war a question
i have an app and stored data of the app in mysql db
within a user sana with pass ***********
if i publish my app can people access the data?
 
8:57 AM
heyho guys
 
Who can tell me. What is the result of test1 and test2?
 
@GLeBaTi Maybe you can explain to me why this (gist.github.com - For Easy Code Pasting - see top right) is so hard?!
 
thanks :)
 
@War btw, when you have Money datatype in SQL, do you round it to 2 decimal places? or it is only rounded when Billing is being processed?
 
9:11 AM
Morning. Any one got experience creating installers for Office Add Ins (with VS 2015)
 
@GLeBaTi well it first of all won't compile
@Dave Not really, but if you are looking for a free installer project check this out
 
@Nerdintraining this is not real code
 
IT's a add on for VS 2015 to create intallers
 
I have that, thanks @Nerdintraining
the issue is more about creating the installer as it needs registry updates etc. I found a MS tutorial but it didn't work, but I get no error message etc
 
@Dave Anoying that one can't find any tutorials on how to use it right?^^
 
9:13 AM
Well, there seems to be only a little documentation for that installer, but the tutorial here msdn.microsoft.com/en-us/library/cc442767.aspx is close enough that I could my way through but it's so difficult to fix something which gives no clues as to why it fails :(
 
@Dave I am a bit lazy to read through the articel, if you are using the Installer-Projekt addon, you could add registry keys over that.
 
er? I'm not asking you to read it, just showing that I found a tutorial :)
I know how to register the keys... I've done that...
 
@GLeBaTi A x = new B() won't compile. but i think i know what you wana do. the same thing happens anyways
 
Then you already know more than i do :D
Never really used the registry befor
@GLeBaTi Run it in the compiler and find out urself :P
 
9:40 AM
Hi, does anyone have recommendations on logging frameworks to use for .NET Core libraries and applications? Microsoft.Extensions.Logging? LibLog? softwarerecs.stackexchange.com/questions/36663/…
 
War
@Tagc log4net
 
@War So using Common.Logging within libraries and then the Log4Net Common.Logging bridge within .NET Core console or ASP.NET Core web applications?
Or Microsoft.Logging.Extensions and a Log4Net bridge for that?
 
War
@Tagc Common.Logging ??? what's that ?
log4net doesit's own thing, just add the package from nuget and use it
 
Common.Logging is an abstraction layer over several log providers, including Log4Net
You definitely don't just want to use Log4Net by itself because that forces all consumers of your libraries to use that specific framework
 
War
I wrapped it up in my own interface
 
9:51 AM
Common.Logging is (I believe) fairly similar to Microsoft.Extensions.Logging, but the latter is newer, supported by Microsoft and probably the better choice if we were to go down that route. But there are other routes like using LibLog for logging within libraries - just trying to see what other .NET Core developers are doing
 
War
so all consumers simply need an implementation of that not log4net
 
Ah, fair enough
 
War
I pretty much do that with every package i pull in
 
user6438653
Sup @War.
 
War
uh ... sup @shad0wk
 
9:53 AM
Just to understand better, you create something like a separate ILog.cs file within each of your projects that defines ILog?
 
War
No I have a common core set of interfaces in a shared assembly
 
I get you
 
War
it adds 1 dependency on consumers not all the dependencies I choose to use for my internal stuff
it also means unit testing is a piece of cake
 
user6438653
What?
 
user6438653
1 min ago, by War
uh ... sup @shad0wk
 
War
9:55 AM
@shad0wk That's not a chocolate bar
 
user6438653
What? I was saying hi...
 
@War are your projects targeting .NET Core?
 
o/
 
user6438653
Sup @scheien \o
 
Anyone know of a resource where I can see changes to the c# language over the years
that should whats new and whats been replaced
 
@shad0wk The usual stuff, refactoring. :) What are you up to?
 
War
@Tagc some are some aren't
 
@scheien \o
 
War
the most notable is my distributed socket server framework
 
hey @Nerdintraining
 
10:12 AM
hmm its would be so handy...knowing what to drop or change as you move up frameworks
 
War
that uses sockets to communicate with clients and other instances of iteself
 
@War but you've been able to use this approach in your .NET Core projects?
 
War
but it also exposes webAPI endpoints
 
user6438653
@scheien Nice, yeah i'm going to need to do that soon on >> I'm making an html5 game, skyfight.herokuapp.com. I was making a C# app WinMod, but it's going to take a while.
 
War
@Tagc It's been a while since I wrote any logging code tbh ... I have so much abstraction now I just ask ninject for an ILog and it deals with the rest
and even that's just a ctor param
so I don't interact with ninject either any more
but all my projects work fine and log things fine and audit trail everything they need to and expose either WebAPI REST or OData endpoints
 
user6438653
10:14 AM
My game doesn't do much yet.
 
user6438653
Who did this:
 
user6438653
2016-10-07T10:13:03.073738+00:00 app[web.1]: Player 'awesomium' has joined the game.
 
War
@shad0wk so was I lol
 
I saw that. Didn't do much after I entered a nickname.
@shad0wk I did.
 
War
lol
 
10:15 AM
@War your project doesn't happen to be open-source does it?
 
user6438653
Yeah I havent got the client side graphics sorted.
 
:)
 
War
@Tagc uh sorry no ... I am planning a blog about it though once I am happy with my front end framework
I might at that point open source pieces
 
Ah, fair play
 
War
Trouble is I am currently using my web stack as a back end to an international middleware platform
 
user6438653
10:17 AM
I see the page was reloaded a few times, lol:
 
War
we are currently adding as many of the fortune 500 companies as we can get on to it
@shad0wk what's with all the logs man?
 
user6438653
There.
 
War
don't be offended ... was just wondering why you thought they might be of interest here
 
user6438653
Someone reloaded the page lots, that's all.
 
War
people do shit like that
usually means something is playing up
 
user6438653
10:19 AM
Yes, I just found it kinda funny.
 
user6438653
Sorry :(
 
user6438653
I think I shall go.....
 
War
lol ... ok
0
Q: Complex dto based result sets with EF and MS SQL server

Warok lets say I have a collection of these ... public class ReferenceLookup { public string InvoiceNumber { get; set; } public CompanyReference Buyer { get; set; } public CompanyReference Supplier { get; set; } } I need a collection of these as results where any of the pieces exist ....

 
10:37 AM
is it bad idea to have Computed Column on SQL (TotalPrice) which is not persisted?
it also will be used in reporting in future
 
War
no that's what its there for
 
or it is better to turn on Persistence
 
War
but it does depend on usage
 
so it will be Computed on insert
 
War
yeh that would help reduce load if the value is needed a lot or in large sets
 
10:40 AM
if the two columns which are used in Computation are decimals
Computed value will be stored as decimal right?
 
War
how about you try it
 
anyone there?
 
War
no
 
@War Checked, i have UnitPrice(SmallMoney) * Quantity(Int32) and Computed datatype is Numeric, is it possible to make it Money?
 
War
@QuietNaN the SQL type money technically shouldn't be used any more ... the way it handles the last 2 decimal places is not right for a decimal monetary system like we have today
I'm sure I recall reading that somewhere
 
10:46 AM
@War hm didn't know that, do you have any links of post where i can read about that?
better to use numerics?
 
War
257
Q: Should you choose the MONEY or DECIMAL(x,y) datatypes in SQL Server?

Wayne MolinaI'm curious as to whether or not there is a real difference between the money datatype and something like decimal(19,4) (which is what money uses internally, I believe). I'm aware that money is specific to SQL Server. What I want to know is if there is a compelling reason to choose one over the...

 
Y just found that post ^^
thanks
@War So standard will be to use decimal(19,4) right?
but this guys is correct:
SQLMenace said money is inexact. But you don't multiply/divide money by money! How much is 3 dollars times 50 cents? 150 dollarcents? You multiply/divide money by scalars, which should be decimal.
 
11:07 AM
I use decimal.
 
War
11:24 AM
@QuietNaN decimal is the right value to use ... typical when dealing with money you go 2 decimal places ... taking say usd, BGP, EUR as typical example currencys you have .00 and there is no such thing as a fraction of a penny / cent
if however you are expressing something like a unit price
I buy 1000 sheets of paper for 1 dollar ... each sheet is valued at 0.1 cents
I can't ever buy 1 sheet of paper so on an invoice I use decimal(x,2) to define the invoice values but the breakdown (not expressed as money) could be fractional
@QuietNaN does that make sense?
 
How can I display An error page stating that Permission Denied when the non admin user accessing admin pages. int MVC asp.net
-1
Q: Admin Authorization in MVC

VenkatRJVI have created a cookie which contains userID in it.. C# FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1, "UserID", DateTime.Now, DateTime.MaxValue, true, s.EmpID, // userID FormsAuthentication.FormsCookiePath); // Encrypt the ticket. string...

 
12:13 PM
Anyone else developing projects based on .NET Core and ASP.NET Core and mind sharing their approach to logging in them e.g. logging frameworks used, instantiating loggers (constructor DI?), etc.?
 
@Tagc define "loggers
Like log4net, splunk?
 
Yeah, that sort of thing
Things like LibLog, Microsoft.Extensions.Logging, Log4Net, Serilog, etc.
 
im back
 
War
@Tagc was my approach no good for you?
@Failsafe that's what I suggested earlier
 
12:24 PM
I'm just trying to get a broad range of possible solutions from different people first
 
War
@Failsafe OMG ... when did they add that?
 
You can really only use logging frameworks that are in nuget
 
But I don't think that would work for me
 
War
might have to retire my log4net stuff if this can do what I want
 
everything else may not work
@Tagc why not it's native logging
 
12:25 PM
This sums up my situation: stackoverflow.com/questions/39916559/…
 
War
@Tagc wrong way to solve a problem imo
find something that meets your requirements and roll with it
 
So you are using log4net
 
I am for my "old" (.NET Framework based) code
 
@Tagc Most things in core revolve around DI
which is really just including the repository in the constructor of a controller
 
I like War's idea of injecting loggers in constructors, but since I already use MEF for constructor DI and ASP.NET Core uses a separate DI system, it would cause me problems
 
12:27 PM
If you want logging the best way to do it is to do
 
War
@Tagc and what about it doesn't solve your problem?
 
public MyClass(ILogger myLogger)
 
War
^ that's how I do it ... but I inject my own ILog interface
 
This is the way core works now
 
War
basically a wrapper round Log4Net
 
12:28 PM
yea
 
Is that ILogger defined in Microsoft.Extensions.Logging?
 
yes but it can be any repository you want
 
@Tagc....have u made your own role provider in web.confiure
web.config
 
public MyClass(ILog4NetRepo myLog)
@Sudhanshu web.config doesn't exist in Core
 
I'll upload the web.config I use in one of my ASP.NET Core projects
One sec
 
12:29 PM
Interesting how you use a web config when it was deprecated
 
@Tagc i am also working on the mvc project
 
Ah, it was? That might be why
 
and i have done it by using role provider
so i can tell you about mvc
 
I copy-pasted a bunch of files from my .NET Framework projects to my new projects
I guess web.config was one of those and that's why it's not picking up the Log4Net config I have in it
 
War
config in core is all json files now
 
Solves one puzzle. I'll delete that file
 
War
just convert the xml in to json
 
You can not just copy paste into the new project
 
War
then you can load it
 
ASP Core is a totally different project structure
 
War
12:31 PM
^
 
Actually no, it generates web.config
 
Impossible
 
I literally just tried it
Create a new ASP.NET Core web application in VS2015
It generates web.config file
```
<?xml version="1.0" encoding="utf-8"?>
<configuration>

<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->

<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
 
War
yeh it does but it's not used for the project configuration its used for web configuration only
the two things are separated now
 
Ah
 
War
12:33 PM
project configuration is done in json (that configures the host basically)
web.config then configures the hosted "web" parts
but you can use json to do that too
basically you have choices now
that said ... if you are building your app with say ... owin, it would make sense to ditch the web.config file
have the json deal with it all
 
Not really sure what OWIN is
 
War
:facepalm:
 
It's a middleware framework
 
War
using core but never heard of owin ... wow
 
I've heard of it
I just don't really know what it is
It's probably not something I require for what I'm doing
 
War
12:36 PM
it's pure magic :)
 
But yeah, this is one way of using Log4Net in ASP.NET Core apparently dotnetliberty.com/index.php/2015/11/09/…
But I'm wondering if I should change how logging is done within my class libraries. Right now my class libraries use Common.Logging and create loggers like this: private static readonly ILog Log = LogManager.GetLogger<UsbCommunicationService>();
 
So you wrap log4net in a ILogging wrapper
 
Well Common.Logging acts as the abstraction. But should I inject ILog into the constructors of classes within my class libraries?
I believe that's what War does
although he uses his own implementation of ILog
 
War
yeh mines just a wrapper so i'm not forced to use any particular logging framework
 
public class MyClass : Controller
{
	internal ILogger<Log4Net> _myLog;

	public MyClass(ILogger<Log4Net> myLog)
	{
		_myLog = myLog;
	}

}
probably something like that
 
War
12:39 PM
I could easily just rip out log4net and drop something else in there if i needed to
 
No definitely not that. That would force my class libraries to depend on one specific logging provider (Log4Net)
 
War
@Failsafe nope ... my version of ILog basically looks like the ninject version of ILog
basically the same
just live in differnet namespaces
as I like the way log4net works I figured I'd follow that structure and create a type that basically just does pass through calls
in a way i'm sort of using log4net directly
 
using ILog is the best bet, though you have the choice between rolling your own (like War does) or using one defined by Microsoft.Extensions.Logging, or Common.Logging, or going the LibLog route, etc.
So much choice :\
 
War
I put it there not because I needed to but more out of habit ... abstract everything just in case
 
That was an example of DI not code you should copy paste
 
War
12:42 PM
public class MyClass : Controller
{
	internal ILog<MyClass > _myLog;

	public MyClass(ILog<MyCless> myLog)
	{
		_myLog = myLog;
	}

}
^ pretty much how mine looks
 
NInject knows how to provide an instance of ILog<MyClass>?
 
War
then I use a ninject rule that returns a Log<MyClass> that is just a passthrough wrapper for log4net
it uses the log4net log factory to build the log4net log and passes it in to my logs ctor
then I return my log
 
Problem is I use MEF for all my stuff (I need most of my class libraries to be discovered dynamically as plugins) and I'm not sure if MEF can do something like that
 
War
probably over engineered tbh, but it does mean all my code doesn't depend on log4net
 
Although maybe it can by providing a custom ExportDescriptorProvider...
Hm
 
War
12:44 PM
and I can replace a real log with a testlog for unit testing
@Tagc MEF imo is basically just DI based on a IPlugin type base interface set
as I understand it anyway
I once wrote an irc client like that
had my own simplistic take on MEF
 
MEF can runtime add dll-s
 
War
allowed me to dynamically extend the client with plugins
 
Yeah
It's what it's good for
 
You don't have to restart client/server to add new dll
 
War
I even had it allow me to write blocks of c# and use those as plugins
that was neat
 
12:47 PM
nice
 
War
yeh I didn't have to restart
 
But as ASP.NET Core uses its own DI system, and my classes expect to be loaded using a MEF DI system, it can be problematic to try to discover and dynamically load my plugins from an ASP.NET Core app
 
War
I could just go to a menu and it ould scan a folder for plugin types
then you'd click a plugin and it would load what's in the package
 
Yeah I use it for that too. Loading plugins by looking at DLLs in a folder
 
War
could be menu items or just open an mdi window
pretty basic stuff
 
12:48 PM
good stuff
 
War
@Tagc My workflow system is a WebAPI app that allows the user to build a business process from dll's not referenced by the system
 
Specifically, adding references to Nuget packages that contain MEF exports, and then creating a MEF container loaded with parts scanned from assemblies in the same directory as the executing assembly
 
War
it can then execute them
The stuff i'm doing at the moment allows me to receive any blob of data in any format from a http request and then run a business process on it
the key goal ... importing invoice data in to our system from any source
that's all total dynamic ... doesn't require MEF
I can even pause and resume business processes (I thought that was a neat feature to add)
so far this has been about 1 weeks work ... I have some awesome ideas for the UI on this
 
Sounds good
 
1:03 PM
@War pause a business process? Persisted with recover?
that process is like a call stack on CLI?
that would be neat.
 
War
1:15 PM
as in I can stop a business process at any point and save its stack to the db
then later execute the process from that point onwards
I can also run the same process say 20 times and if 5 of them fail, fix the problem and resume that 5 at any point
took a bit of complex "out of the box" thinking but it came together quite nicely in the end
 
@War that stack is like the one on the picture> ilspy.net/images/screenshots/build199_viewingil.png, or custom?
 
@War Sounds like you're working on a system much like the one I used to work on a few years ago.
 
1:31 PM
@War, are you using redis?
The saving of the stack is a pretty good idea
 
War
I'm not saving anything C# ... just raw data, enough that allows me to rebuild the type tree for the process
 
1:47 PM
So, you're not saving the entire state?
 
@Nathvi yeah. I thought the same
 
When you say rebuild the type tree for the process... I'm not sure what that means
@War
 
I don't have a question, I just want to take this moment to mention that string interpolation is amazing. $"ftp://{site}/{Path.GetFileName(sourceFile)}" feels like the best kind of magic.
 

« first day (2183 days earlier)      last day (2768 days later) »