« first day (2259 days earlier)   

12:00 AM
the short answer is, you've probably got a method that returns decimal and you trying to return a nullable one.
 
has anyone used a webclient or similar to talk to an ADFS secured API?
 
@MichaelEdenfield Thank you for your answer and has fixed!
I passed the model on the Index and this was from a previous code! I realised this when I opened my eyes and had to track the error
@MichaelEdenfield However, I am sorting out a different type of error! Multiple types were found that match the controller named 'Home'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter.
I think there is a conlflict between the names of the controller in my MVC project and The API
 
 
1 hour later…
1:22 AM
Oh snap! I didn't know you can get Jetbrains products to use for free as a student. Dude!
 
@hilli_micha no you need to get a license
 
Well, yeah, but they'll let you get a license for free as a student.
 
really I did not see that on the side
that must be something new
 
Yup, I just did it.
 
Wish I knew that
 
1:32 AM
I'm actually trying Resharper, hands-on for the first time now.
 
still have my student email
it is good for doing code
 
Yeah, it's GREAT for clean up and keeping consistent with basic stuff it seems.
 
yep and refactoring
the code snippets get screwed up but eh
 
I can't wait to be able to really dig in and refactor this old legacy code I've got to work with..
 
ya well that might be a pain to refactor
it will give you good hints to make the code read easier once you start using linq more
 
1:38 AM
Fortunately, the sections of the software that really need linq, already use it.
I think it automatically updates variables as I change them, previously I had to click that little lightbulb that came up, and that thing only worked like 50% of the time for me..
 
@juanvan Thanks. It looks like a cool and friendly place here.
 
Ya usually is
 
Yuck, one thing I've noticed, by default it will strip down basic type declarations to implicit and leave my less common ones as explicit.
To this point, we've always done explicit type declarations.
 
you mean having a backing field?
 
Sorry, no, please correct my vernacular if need be, for example, previously it's been Dim word as String = "These are some words" and Dim dtObj as DtObject = new DtObject()
By default, when running 'Clean Code' in Resharper, it'll change that to Dim word = "These are some words" and Dim dtObj as DtObject = new DtObject()
It will change the basic data type, remove it but leave my custom/not-basic classes alone. Bums me out a little.
 
2:21 AM
ya it does use best practices to how code would be easier to read
and less typing
 
Yeah, I have noticed that quite a few people will go the implict route in C#/VB.NET, using var and not declaring data types.
I've always declared data types, it seems more natural to me.
 
ya and is easier to read if you don't know what is being produced on the Right side
 
3:06 AM
I always use types, I never use var in C#
it just seems... unhelpful
but really I code to whatever the standard is in the codebase
 
 
4 hours later…
7:19 AM
ohayou
 
Hi , I want to run an project . But I amgetting this error
An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll
How can I remove this error and run this project ?
 
7:32 AM
Try building to another architecture.
 
yes, you build it targeting x86 but assembly comes from FW64
probably
 
I am running 64 bit os .
 
not OS
 
What do you want to mean by FW64 ?
 
So, I'm trying to post some JSON to a Ruby ReST service, and it keeps failing on anything that contains "non-English" characters (like 'É', etc.). The devs on their end claim I'm sending UTF-16 characters, but I'm 99% sure I've transcoded everything to UTF-8 prior to sending it. Fiddler seems to agree. Is there anything specific I can do to guarantee I'm using the correct encoding?
 
7:42 AM
there is clash between the assembly which causes exception and the targeting platform of your project
 
Using Flurl at the moment, but RestSharp and a "raw" HttpClient yield the same results.
 
Example; Properties->Build->Platform Target is x64 and the assembly is compiled 32-bit.
 
What is assembly ?
 
the dll you add to the references
 
I have added 32 bit dll to Syswow64 bit folder and copied 64 bit dll to system32 folder .
My platform target is any cpu .
 
7:48 AM
32bits to 32 folder, 64bits to 64bit folder
 
But the doc says to do it as like below :
 
ok at least you have a doc :) which dll are you referencing to your project?
 
8:09 AM
I have not explore the code .
How can I know that ?
 
Morn all
 
it morning already ?
 
Hi All
Can anyone help me to hook delete file event of windows ??
 
what do you mean?
 
let me give you full desc for my issue.

i have my work space {file repository}.
When user try to delete file or folder from my repository then my custom message will popup.
 
8:23 AM
delete using your app, right ?
 
am not sure how you would do that
maybe keep a record of all files, get current files compare against any deleted
 
you can try to use the file system watcher class if you want to be notified when something has changed inside folder
 
nop normal delete.
like going on to that location and press delete key or shift + delete key.
@Proxy file system watcher will give me notification after file is deleted. i want notification before file deleted.
 
i don't think is posible
you can listen some events AFTER a file is deleted
but not before
 
well you will have to work a bit more then
 
8:26 AM
I have done some research on that.
let me share with you.
I have try to hook keyboard. it will not work for me.
 
@War are you around ?
 
@Mathematics
What you say ?
 
it's very important AND you have a few files ? try to open them all :D
user can't delete them if your app keeps them open
 
That was good idea for keep my file busy so no one delete that.
Thanks @BudaFlorin.
 
2
Q: How to capture watch folder deletion events

kandenI have a file watch directory named FileWatch C:\Users\MyFolder\FileWatch\Test The FileWatch folder is the watch directory. My application is receicing all events which occur below the FileWatch directory. However if I delete the FileWatch folder itself, no file system event is generated. I...

what Proxy said
 
8:29 AM
might work, but you will go to Hell for this
 
he need to stop the delete command
or assign the folder to another user :P
 
well you can fake it...when a file is added updated copy the file to your folder....that keeps a backup copy
 
one more things i want to ask is that.
how i make my repository more secure.
 
then if deleted move it back
or dont give users delete permission to that folder
 
even better !
 
8:31 AM
@PratikRatanpara what do you mean ?
 
if i remove permission from my folder then i am also not able to update that folder again.
actually my application is file sync application
 
so, time by time new file is added or updated file also downloaded from server. so remove rights is not good for me.
 
@RoelvanUden /o/
 
you can assign diff permission to diff users
 
8:36 AM
OK OK Thanks to all who spend some time on my issue.
Thanks a lot all of you.
I just go with { keep my file busy so no one delete that }.
 
@PratikRatanpara Your issue is difficult. Very difficult. You cannot prevent a user from deleting a file from the file system in any normal way. You could write a C++ MiniFilter that captures the operation and manipulates the behavior, but if the MiniFilter is not running (e.g. your application is turned off) you still have a problem next time it starts up. Idem for simulating a hard disk through Kernel drivers. The only way to prevent the user to delete loose files is to make everything virtual
 
opps @RoelvanUden i dont have any idea about it.
 
@PratikRatanpara you don't have ANY idea about it Oo
 
You're the developer. Isn't it your job to get an idea about the problem?
 
ok that gave me an idea...write a program that moves the file to your file directory and create shortcut to the actual file. That way when they delete the "file" they are actually deleting a shortcut to the file
 
8:39 AM
It still doesn't prevent anyone from deleting the file.
 
it depends of course what files are
 
To flat-out prevent someone from deleting files is nigh impossible.
 
I suspect they work from a folder/ directory all the time
 
It's much more reasonable to have a monitor that acts on deleted files to fix the situation.
 
yeah I suggested a backup folder with watcher on actions
 
8:40 AM
0
Q: OData is generating wrong URL or is it me using wrong keyword

MathematicsI have a query like this, https://example.com/_vti_bin/exampleService/exampleService.svc/Categories? $filter=Products/any(x:x/Status eq toupper('DELETED'))& $select=ID,Products/Status,Products/Title& $expand=Products but it's not filtering dataset based on status = deleted and returns products...

 
@Ggalla1779 I don't even know why someone who barely has any idea about file systems is essentially writing a file system extension. It makes no sense to me anyway.
 
haha I know but then that's the rub
 
@Ggalla1779 you know that but still... grrr I will ignore that
 
Life is full of chances
 
I mean, wouldn't you start with the design?
 
8:42 AM
@Ggalla1779 I am pretty sure it's not full of chances
 
You'd pretty quickly figure out "Hey I can't prevent deletion of files"
And adapt the design.
 
I would have a think about it, then code something... rethink and then scrap or tweak
dont we all do that
 
Indeed. I'm actually doing a file sync app too, and design was by far the hardest part. I scrapped quite a few concepts.
 
I did one in about 2009, for prints being shipped out to printing company
 
I just love it. when someone with no knowledge of topic gets soo much attention and when I ask a valid question, I fail to get any attention...
 
8:44 AM
it worked like a charm
 
help our lost soul then :P
 
What was your question?
 
I think I need to work on my public engaging skills
 
lol
no your a good developer, accept you have none!
 
8:46 AM
@Ggalla1779 posted my question just couple of minutes ago... I can still see it on my screen, see I told you guys, my questions are invisible xD
 
@Mathematics This is not helpful at all. You're asking, indeed, a legitimate question. But it's a question that requires a very specific skill set that, I think, most of us don't have. @War might, but he's not on (yet). So yes, why would I bother answering "I don't know", it's a waste of both our time.
 
oops
 
File sync I do know about, so I can talk about it. :P
 
I have never used odata
 
I just used the basic stuff.
 
8:49 AM
@RoelvanUden I understand and agree with that, but still my public engaging skills still need more work
 
sorry thats way above my head,
 
@Ggalla1779 what's that
 
your question
 
oh, basically OData gets the url, converts it into linq, then EF converts linq into SQL query
 
so EF/Linq is adding the is null
 
8:52 AM
maybe it's me not using it correctly
$filter=Products/any(x:x/Status eq toupper('DELETED'))&
this in url creating problem
even if I remove toupper...
 
try taking out toupper see what is produces
 
^ I knew you gonna say that xD
 
wanna see if thats whats causing the null
 
@RoelvanUden how is your writing going?
 
@Proxy Decent. I've got 3 chapters now, toying a bit with how I want to have ch4 go. It's a crucial part before I drop the characters into action, and it needs to be done right :3 A little hard... :D
 
8:56 AM
i see, thought you had written some more in the meantime :P
 
I've got most of the outline of where I want it to go, new side characters, how the story is to unfold further, but ch4 will set a crucial set of events that needs to be done just right.. it's honestly a little hard :P
 
Do you have a title
 
I should get something out at Christmas :D
 
i see well inform me when your done. Hope to read a bit more of it
 
thanks
 
8:58 AM
Will do :D
 
I am running a project in C# .
But when I want to run this project , I am geting this error
An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll
 
are you writing your own lyrical magical girl horror novel Roel?
what about the inner except @Sagor
 
What do you want to mean by inner except ?
@misha130
 
the exception should have more in depth details
for instance on what line
what class
what image
the stack trace
what it had for breakfast
 
@misha130 No, no, there will be no transformation scenes or keeping your identity secret.
 
9:05 AM
etc
well I had no idea what you are writing but I guessed pretty close
 
Additional information: Could not load file or assembly 'SecuSearchMx.NET, Version=1.0.4050.30872, Culture=neutral, PublicKeyToken=9f22e542cd78d9d7' or one of its dependencies. An attempt was made to load a program with an incorrect format.
 
as the nanoha fan you are
 
It's nothing like it, really.
 
ok man
 
Not sure if you got the link
 
9:09 AM
I am reading
your writing is pretty good, it makes me like imagine that I am the main character
I don't usually give out compliments but hey this is really well written
sort of reminded me of norwegian wood somehow
 
War
morning all
 
Thanks a lot! I was aiming for that feeling. Honestly feels a little embarrassing to have people read stuff you wrote.
 
yea I get that
 
murakami @misha130?
 
yea
 
War
9:11 AM
@Mathematics @RoelvanUden bring me up to speed ... what's up?
is it that OData question from above?
 
i think that's his best book (from those that i have read)
 
I will read over crimbo Roel...cant relax to read it in work
 
@misha130 , this is the error .
Additional information: Could not load file or assembly 'SecuSearchMx.NET, Version=1.0.4050.30872, Culture=neutral, PublicKeyToken=9f22e542cd78d9d7' or one of its dependencies. An attempt was made to load a program with an incorrect format.
 
War
@Mathematics that should do it.
0
A: OData is generating wrong URL or is it just me using wrong keyword

WarI believe the problem is in the query. Form the url you are saying something like ... // get me categories https://example.com/_vti_bin/exampleService/exampleService.svc/Categories? // where any product is deleted $filter=Products/any(x:x/Status eq toupper('DELETED'))& // return the category i...

 
@SagorAhmed BadImageFormatException I think usually means the architecture of the loading process and of the assembly to be loaded don't match. Try running corflags.exe name-of-dll and see what it says
 
9:24 AM
anyone used mongodb with C# and can tell me why this wont work
          return await _collection.DeleteOneAsync(d => d.Id == id);
 
If it's an unmanaged dll it'll be compiled in either 32-bit or 64-bit mode, and only a matching process can load it. .Net applications can run in either, but it's chosen when the application starts
 
'corflags.exe' is not recognized as an internal or external command,
@TomW
 
> This tool is automatically installed with Visual Studio. To run the tool, use the Developer Command Prompt (or the Visual Studio Command Prompt in Windows 7). For more information, see Developer Command Prompt for Visual Studio.
 
C:\Users\Sultan Ahmed>corflags SecuSearchMx.NET.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.

corflags : error CF002 : Could not open file for reading
 
Well what do you want from me, I promise you that corflags works
 
9:33 AM
What is this error
corflags : error CF002 : Could not open file for reading
 
I guess it couldn't open the file for reading.
 
Where should I copy this dll SecuSearchMx.NET.dll ?
in 64 bit pc ?
 
Anyway that's one way to provide evidence for what I think is the case, alternatively if the lib has documentation then refer to that
 
C:\Windows\System32>corflags SecuSearchMx.NET.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool. Version 3.5.30729.1
Copyright (c) Microsoft Corporation. All rights reserved.

Version : v2.0.50727
CLR Header: 2.5
PE : PE32
CorFlags : 8
ILONLY : 0
32BIT : 0
Signed : 1
Is this 64 bit dll ?
 
Hm, it looks like it's AnyCPU stackoverflow.com/questions/270531/…
So that's not the problem. Not what I was expecting to see
 
9:39 AM
@War that's an awesome idea, but I am getting this back..

Term 'Products($filter=any(p:p/Status eq 'DELETED'))' is not valid in a $select or $expand expression.
 
War
it might be better to turn the query on its head then
https://example.com/_vti_bin/exampleService/exampleService.svc/Products?
$filter=Status eq toupper('DELETED')&
$select=Category/ID,Status,Title
something like perhaps
you'll have to play with it, i'm not sure what you are trying to achieve or of the details of your odata model setup
these things can be tricky without understanding the model
 
@War thought about it before, but for some reason Products don't have categories as navigation property yet
thanks for trying, I will keep looking
oh btw I am using OData 3
 
@TomW , Then what other problems for this problem ?
An unhandled exception of type 'System.BadImageFormatException' occurred in System.Windows.Forms.dll

Additional information: Could not load file or assembly 'SecuSearchMx.NET, Version=1.0.4050.30872, Culture=neutral, PublicKeyToken=9f22e542cd78d9d7' or one of its dependencies. An attempt was made to load a program with an incorrect format.
 
War
@Mathematics how can Categories have Products but Products not have at least 1 category?
sounds like a broken / poorly defined relationship between those entities in your model
 
9:59 AM
@War I know it sounds broken, I will park it for now
Thanks for having a look :)
 
o/
 
@JARRRRG /o/
 
hello
this is the last day at this company
 
/o/ run... \o\ ... panic ... run /o/
 
Hi! I'm writing a client for an API, and I've some doubt about model design. It's possible to request only part of the data of an entity, would it therefore make sense to want to represent both a regular 'null' value and an 'unknown' value? Kind of like Nullable<T> but also for reference types.
I'm sure there's reading material out there, but I'm not quite sure which search terms to use :)
 
10:13 AM
I use NullObject pattern a lot.
 
War
@Mathematics what about this ...
https://example.com/_vti_bin/exampleService/exampleService.svc/Categories?
$filter=Products/any(x:x/Status eq toupper('DELETED'))&
$select=ID,Products/Status,Products/Title&
$expand=Products/any(p:p/Status eq toupper('DELETED'))
 
@ntohl that's not quite what I mean. For example, LinkedFoo would be null when there is no linked foo, or it could be 'unknown' when the data was not requested from the API.
 
oh
 
Basically I'd like to avoid null representing two things
 
How I imagine, the response of a request would look like an XML or something with parts of the data. If there is no node in the XML with the given name, than it is unknown, but when it's given, but null, it isnull=true
 
10:19 AM
@ntohl exactly :) do you know if that concept has a name, something I can look up?
 
trying to come up with a good search keyword, not successful yet.
 
@War let me try
 
e
Hi all
I would like to add checkboxes to every row of a checkboxfield
How can I do that?
 
War
Great ... deploy succeeded, after testing a load of stuff is broken, so I get the branch from TFS ... it doesn't build.
Ok I figured, maybe the merge didn't quite work ... perform a merge between that branch and the child branch the code came from "0 changes"
why does the child branch build then!!!
@Kikus by adding a checkbox field to your row and putting a check box in it
 
@Stijn the closest search were "null vs unknown in xml fuzzy" and "null vs occurs in xml"
 
10:35 AM
What does the object CheckBoxField represent? a column?
 
War
@Kikus whatever you want it to
 
I added a CheckBoxField to my gridview
   CheckBoxField field = new CheckBoxField();
        field.HeaderText = "Exporter ?";
        gv.Columns.Add(field);
now how can I access the rows corresponding to the checkboxfield column in the code?
 
hi there, I appreciate that this isnt the right room for docker questions but I am a csharp developer who is looking to use MVC Core and Docker together. Anyone here have any experience with docker? I'm having some issues on my VPS
 
I've had issues with it not working :)
 
War
@Kikus ah finally some reference that might imply the technology you are using ... this appears to b either winforms or wpf
 
10:39 AM
webform
 
@ntohl I think XML calls that nil, not null
just to be awkward
 
@TomW LOL
 
:D
 
It's not working for me either
:/
 
@War Term 'Products/any(p:p/Status eq 'DELETED')' is not valid in a $select or $expand expression.
 
War
10:48 AM
hmmm
dunno if you can filter on a child collection like that then
2
Q: oData WCF Data Services Filter Child Collection

user1514042I have an array of customers, each customer has a collection of orders. the query below returns customers and their orders and works as expected: ~Customers?$expand=Orders Now I want to get the existing customers but filter their orders by Order.Amount > 100 (I'm happy for the customers havin...

seems to imply that should work
ah ok
my bad
try this ...
https://example.com/_vti_bin/exampleService/exampleService.svc/Categories?
$filter=Products/any(x:x/Status eq toupper('DELETED'))&
$select=ID,Products/Status,Products/Title&
$expand=Products&
$filter=Products/any(p:p/Status eq toupper('DELETED'))
maybe it just needs breaking out in to a filter expression
odata can be a bit wordy this type of thing for some reason (odd considering we are building url and you'd want the url to be as short as possible
tbh, i prefer to say expand=Things($filter=stuff)
feels more natural tbh
 
what is this ? $filter=Products/any(x:x/Status eq toupper('DELETED'))& > :O linq ?
 
War
@BudaFlorin it's OData ... basically a means to do LINQ queries over http
 
@War what's different then we tried before it
 
War
@Mathematics is it working?
 
@War it wasn't
 
War
10:52 AM
ok what's the error now?
oh hang on a minute
that results in us specifying the same filter clause twice
dam
wonder if the order of events changes the question
 
@War I don't think it will matter
 
War
trouble is you are asking for a set of categories
so any filter is used to apply a where clause ot the base query
 
@War 1 second
it sort of works here, let me retest it
 
War
What Jen is saying here is basically your problem ...
2
Q: oData WCF Data Services Filter Child Collection

user1514042I have an array of customers, each customer has a collection of orders. the query below returns customers and their orders and works as expected: ~Customers?$expand=Orders Now I want to get the existing customers but filter their orders by Order.Amount > 100 (I'm happy for the customers havin...

oh its a many to many
ah ha
that changes my understanding of the model
ok lets rethink this and start simple
https://example.com/_vti_bin/exampleService/exampleService.svc/Categories?
$select=ID,Products/Status,Products/Title&
$expand=Products
so that should get you all categories and from those pull the ID, and then expand in to products and select Status and Title
can that be simplified?
$select=ID,Products($select=Status,Title)
can we do that?
 
yes, 1 seonc
before I try it... it could be related to lazy loading ? I disabled it @EF
@War not working
 
War
11:03 AM
is this to be bound to a UI ?
 
War
like in a nested grid or something ?
 
I have little hope, it's not working here...
 
War
you could break this out in to multiple queries
 
I am going to give up now :(, PM is chasing
going to park it for now
 
War
11:07 AM
yeh looks like its this problem ...
16
Q: OData $filter with items in a $expand

Null PointerI have given some web services to access informations. The first thing that i have tries to expand a node . And i have done that successfully with following code http://www.domain.com/ODataService/WorkService.svc/CaseStudies?format=json&$expand=ServiceOfferings Now i want to filter ServiceOf...

 

« first day (2259 days earlier)