|
Does anybody know a way to check the architecture of a DLL consistently? http://msdn.microsoft.com/en-us/library/system.reflection.module.getpekind%28VS.80%29.aspx
|
# ? Oct 17, 2011 17:54 |
|
|
# ? Apr 26, 2024 23:42 |
|
Rocko Bonaparte posted:Does anybody know a way to check the architecture of a DLL consistently? I am particularly interested in a way to overtly tell if a DLL was built with the "Any CPU" target. All I can figure is I can dumpbin the DLL on a 32-bit OS, and then against on a 64-bit OS. If the target architecture changes to be compatible, then it must be capable of both. This is a bit of a pain in the rear end though, given I'd have to run this on large directory trees. http://stackoverflow.com/questions/495244/how-can-i-test-a-windows-dll-to-determine-if-it-is-32bit-or-64bit
|
# ? Oct 17, 2011 17:56 |
|
Rocko Bonaparte posted:Does anybody know a way to check the architecture of a DLL consistently? I am particularly interested in a way to overtly tell if a DLL was built with the "Any CPU" target. All I can figure is I can dumpbin the DLL on a 32-bit OS, and then against on a 64-bit OS. Just a heads-up... with Win8, there's going to be a new kind "AnyCPU32bitPreferred". http://stackoverflow.com/questions/7508965/what-does-the-prefer-32-bit-compiler-flag-mean-for-visual-studio-11-managed-ap (sorry... I can't find official MS documentation on this just yet)
|
# ? Oct 17, 2011 19:49 |
|
I had seen the Stack Overflow thread previously. It looks like all the solutions there don't account for the "Any CPU" type. I think all those solutions will choose the target architecture whenever an Any Cpu DLL comes along. I haven't heard of Module.GetPEKind() so I'll try to write a little utility with it to see what it can do for some known targets. Thanks.
|
# ? Oct 17, 2011 20:59 |
|
ljw1004 posted:Just a heads-up... with Win8, there's going to be a new kind "AnyCPU32bitPreferred". Will VS11 let us Edit and Continue with 64 bit projects?
|
# ? Oct 17, 2011 23:00 |
|
Rocko Bonaparte posted:Does anybody know a way to check the architecture of a DLL consistently? I am particularly interested in a way to overtly tell if a DLL was built with the "Any CPU" target. All I can figure is I can dumpbin the DLL on a 32-bit OS, and then against on a 64-bit OS. If the target architecture changes to be compatible, then it must be capable of both. This is a bit of a pain in the rear end though, given I'd have to run this on large directory trees. Use Corflags
|
# ? Oct 18, 2011 01:16 |
|
I'm a bit curious about the cleanness/stability of a sort of technique/mini design pattern I've been using recently. I basically figured it out on my own when dealing with multiple OnPaints, so I have no idea if it's common & useful or terrible. I mostly use it as way to try to keep any new UI controls I make as independent as possible. I needed to modify a 'generate excel' dialog to take range parameters, and we have a custom range selection control, so I made a static method in a factory class to take a Delegate and max Range as parameters. Code looks something like this: http://pastebin.com/6udUV6Hv Is this good/bad/slow? Is there a cleaner way to do it? Lhet fucked around with this message at 04:02 on Oct 18, 2011 |
# ? Oct 18, 2011 03:53 |
|
I'm running into a weird error regarding rebinding a gridview after editing the data source that it pulls from. After editing the gridview in another panel and hitting the save button, the gridview's data is repulled from the database, but in Chrome and IE8 on the server (but NOT on localhost) the gridview defaults to edit mode with the changed data item as the selected row for editing. Edit: Figured it out, had to set EditIndex = -1; Uziel fucked around with this message at 20:15 on Oct 18, 2011 |
# ? Oct 18, 2011 19:53 |
|
I am trying to bind some TextBox.Text values to an object, so I'm doing the binding like this:code:
code:
Am I doing something really dumb here or is this just not possible with a TextBox? Note that I have the same problem with other non-string types (float, decimal, etc). Maybe I just change all of those controls to up down boxes and the backing fields to decimals? Help?
|
# ? Oct 20, 2011 04:36 |
|
I'm having a bit of trouble getting data binding working in WPF, using the MVVM (model view viewmodel) pattern. I'm basically building a zoom bar, so the combobox needs to change the zoom when a new value is selected. However, zoom can happen in different ways (resize, scrollwheel, etc) that will change the value to something not in the combobox (either in between values or bigger/smaller). So when that happens I need to add the appropriate value and refresh with it selected, (and remove it when it's gone). I implemented it with Winforms just fine, and doing the same thing without data binding would be simple, but I need to learn the whole data binding thing. I've pasted the important pieces: http://pastebin.com/9i1CZjFw I'm not sure if I'm missing something important in the viewmodel/constructor, or if I just haven't found the right syntax for the xaml.
|
# ? Oct 20, 2011 04:40 |
|
Today the VB/C# team released a public CTP of our project codenamed "Roslyn" -- which is about opening up the guts of the compiler to third-party tools. [VB] http://blogs.msdn.com/b/vbteam/archive/2011/10/19/introducing-the-microsoft-roslyn-ctp.aspx [C#] http://blogs.msdn.com/b/csharpfaq/archive/2011/10/19/introducing-the-microsoft-roslyn-ctp.aspx edit: and rewriting the compilers from scratch. They used to be written in C++. We're now writing them in VB and C# respectively. ljw1004 fucked around with this message at 06:21 on Oct 20, 2011 |
# ? Oct 20, 2011 06:13 |
|
ljw1004 posted:Today the VB/C# team released a public CTP of our project codenamed "Roslyn" -- which is about opening up the guts of the compiler to third-party tools. That's awesome and I can't wait to get home and try it out. I love you guys.
|
# ? Oct 20, 2011 10:29 |
|
What is the recommended way to kick off a background task in an ASP.NET app? What I'm going for is this: user performs a search and makes some selections from their search results. User clicks a button which then fires off a long-running process on the server. When the process has completed the user gets an email with an attachment containing the results of the long-running process. What I've got is an empty ASPX page that opens in a separate window, kicks off the long-running process on a thread pool thread and some JavaScript that just immediately closes the window. It works, but feels kludgy. Is there some other, best practice way of accomplishing this?
|
# ? Oct 20, 2011 16:31 |
|
Hey ljw1004, do you know if VS11 let us Edit and Continue with 64 bit projects? (asks the SharePoint dev )
|
# ? Oct 20, 2011 16:41 |
|
Horse Cock Johnson posted:What is the recommended way to kick off a background task in an ASP.NET app? I would have you ASP.NET app write to a database the details of what needs to be run. I would create a Windows service that polls the database every second or so and spin up a thread from the thread pool to perform the long running process.
|
# ? Oct 20, 2011 17:17 |
|
Horse Cock Johnson posted:What is the recommended way to kick off a background task in an ASP.NET app? You can make the client side of that less kludgy by using AJAX (probably via jQuery or equivalent). In MVC you'd have an action that returned an XmlResult or JsonResult to confirm that the process has started; not sure what the equivalent is in WebForms.
|
# ? Oct 20, 2011 18:14 |
|
gariig posted:I would have you ASP.NET app write to a database the details of what needs to be run. I would create a Windows service that polls the database every second or so and spin up a thread from the thread pool to perform the long running process. If you are going to do that, a console app running as a scheduled task is a much better option for a number of reasons. First, philosophically, services should, well, serve and not poll. Second, a simple command line app is vastly easier to debug and test. Third, when something goes wrong it is easier to re-run the command line task. Now, if you want to go the service route, you should probably look at a message queue. NServiceBus is a pretty decent option here.
|
# ? Oct 20, 2011 18:23 |
|
gariig posted:I would have you ASP.NET app write to a database the details of what needs to be run. I would create a Windows service that polls the database every second or so and spin up a thread from the thread pool to perform the long running process. I absolutely agree that having something external to the web app is the correct answer to this problem. Thing is, the server on which this app runs resides within the Pentagon so we have very strict parameters as far as what we can do on it and what we can't. Whatever the solution is it's going to have to be implemented within the web app itself.
|
# ? Oct 20, 2011 18:27 |
|
Might want to check this out, Horse Cock Johnson: http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx
|
# ? Oct 20, 2011 18:50 |
|
ljw1004 posted:Today the VB/C# team released a public CTP of our project codenamed "Roslyn" -- which is about opening up the guts of the compiler to third-party tools.
|
# ? Oct 20, 2011 18:52 |
|
EDIT: beaten.
|
# ? Oct 20, 2011 18:54 |
|
boo_radley posted:Hey ljw1004, do you know if VS11 let us Edit and Continue with 64 bit projects? (asks the SharePoint dev ) Sorry, that's not my area.
|
# ? Oct 20, 2011 19:51 |
|
ljw1004 posted:Sorry, that's not my area. OK, thanks. I appreciate the reply.
|
# ? Oct 20, 2011 20:02 |
|
ljw1004 posted:Today the VB/C# team released a public CTP of our project codenamed "Roslyn" -- which is about opening up the guts of the compiler to third-party tools. The newest compilers with the async changes aren't built on this platform, right? Is the plan for the compiler release after that to be on the Roslyn platform?
|
# ? Oct 20, 2011 20:49 |
|
Smugdog Millionaire posted:The newest compilers with the async changes aren't built on this platform, right? Is the plan for the compiler release after that to be on the Roslyn platform? Async CTP - installs on top of VS2010 Roslyn CTP - installs on top of VS2010 (and the two CTPs co-exist okay!) Dev11 - the next version of VS will have Async built-in, but won't have Roslyn built-in. We haven't yet announced a plan for when Roslyn will become part of VS.
|
# ? Oct 20, 2011 20:56 |
|
Sub Par posted:I am trying to bind some TextBox.Text values to an object, so I'm doing the binding like this: try this code:
|
# ? Oct 20, 2011 21:10 |
|
Horse Cock Johnson posted:What is the recommended way to kick off a background task in an ASP.NET app? You could easily invoke the page hit with just javascript something like jquery and make it not open a window.
|
# ? Oct 20, 2011 21:21 |
|
I'm just hoping Roslyn finally lets us do ILmerge type stuff with WPF applications. I hate releasing programs which are 1 mb of .exe and 30 mb of .dll's.
|
# ? Oct 20, 2011 22:30 |
|
Sprawl posted:try this Works. Thanks! New question. I have a DataGridView whose datasource is bound to a BindingList<MyObject>, where MyObject implements INotifyPropertyChanged. Everything works great. I'd like users to be able to select a row in the DataGridView though and click a button to edit that row which necessitates accessing the correct MyObject from my BindingList. Is it safe to assume that my BindingList will always have its set of MyObjects in the same order as my DataGridView? So I could do: code:
Sub Par fucked around with this message at 03:58 on Oct 21, 2011 |
# ? Oct 21, 2011 03:22 |
|
Dietrich posted:I'm just hoping Roslyn finally lets us do ILmerge type stuff with WPF applications. I hate releasing programs which are 1 mb of .exe and 30 mb of .dll's. Roslyn is for the opposite end of what you think it is. They aren't giving access to let you mess with the compiler output, they're helping you mess with the input (i.e. your code). The biggest feature of Roslyn is that it gives you access to the Abstract Syntax Tree the compiler generates, which you can easily use for things like static analysis or refactoring. The Roslyn CTP looks really cool, I'm going to have to try playing with it soon. Unfortunately, it's got the usual CTP constraints, and there's a pretty big list of unimplemented features (if it doesn't gracefully ignore them that will be problematic for most of the code I'd be interested in trying it on). Are there likely to be any updates to the CTP with further language feature support? And is there some legalese somewhere that defines what exactly re-distribution & production use mean? As a side note, ASTs combined with Linq queries makes for an amazing combination.
|
# ? Oct 21, 2011 04:28 |
|
Zhentar posted:As a side note, ASTs combined with Linq queries makes for an amazing combination. On that note, is there an official story for conversion to System.Linq.Expressions expressions from Roslyn's parser output? That would be really neat.
|
# ? Oct 21, 2011 10:10 |
|
I've probably been looking at this to long, but how would I go about, essentially, reading from a tree structure and creating a new class hierarchy from it, breadth first? It gets hairy because the tree I need to create needs to all be a rigid and known hierarchy, but the tree I'm reading from only defines portions of said hierarchy, and can have nodes of undefined data thrown in at random intervals. I had a recursive DFS approach working fine before, but finding/reading two lines of this technical document means I have to change it to a BFS. One approach I've though of is to have a two queues, one for the tree I'm reading and another for the tree I'm building, of parent nodes. So as I'm reading the child nodes on the one tree, I'm attaching them to the parent nodes of the tree I'm building. The only issue with this is I'm not sure how to determine when to dequeue items from the parent queue. Any ideas or better suggestions?
|
# ? Oct 21, 2011 14:51 |
|
What do you mean exactly by 'create a new class hierarchy?' Are you writing a utility to generate code based on what you're reading from this tree? Also can you go into more detail on why it must be BFS rather than DFS?
|
# ? Oct 21, 2011 16:33 |
|
Orzo posted:What do you mean exactly by 'create a new class hierarchy?' Like it needs to be in a pre-defined, asymmetric structure, so I can't have more lists of lists basically. quote:Are you writing a utility to generate code based on what you're reading from this tree? Also can you go into more detail on why it must be BFS rather than DFS? Depends on what you mean by generate code. The whole class hierarchy is known ahead of time, it's a standard out of my control. I've already got all the various classes (via a code generator) written out. I do however need to generate a concrete structure, validate it and pass it off to another application based on god knows what other people feel like sending us/the other tree. It needs to be BFS because various 'children' need to access data in higher level nodes, and it would just be a huge headache trying to account for each individual case of null exceptions and/or to do lazy initialization because there are something like ~400 classes in the structure and no way to generate it via T4 Templates or something. Also for other cases I'm sure I'm as yet unaware of. Though I think I've got a solution by having a queue of Tuples instead of just the node, so I can associate the number of children with the parent (via a counter running on the other tree). If someone knows of/can think of a better approach I'd be happy to know.
|
# ? Oct 21, 2011 18:11 |
|
Just because something needs to access data in the parent doesn't mean you can't use a depth first search. You just need to do it preorder rather than inorder (visit the root nodes before recursing). See http://en.wikipedia.org/wiki/Tree_traversal
|
# ? Oct 21, 2011 18:25 |
|
Orzo posted:Just because something needs to access data in the parent doesn't mean you can't use a depth first search. You just need to do it preorder rather than inorder (visit the root nodes before recursing). See http://en.wikipedia.org/wiki/Tree_traversal The data they need access to isn't in the parent it's variable branches over and above. So on the example tree on that page, C might need data from I.
|
# ? Oct 21, 2011 18:35 |
|
Oh okay, I misinterpreted 'higher level node' as 'ancestor'
|
# ? Oct 21, 2011 18:44 |
|
ninjeff posted:On that note, is there an official story for conversion to System.Linq.Expressions expressions from Roslyn's parser output? That would be really neat. Not possible yet I'm afraid. Roundabout idea: if you had an AST of an expression, then you could construct a new AST which was "return (Expression<Func<int>>)(_ => AST)". Then run it through the Roslyn compiler component to get an in-memory assembly. Then execute this assembly to get the expression-tree out of it. Unfortunately this falls down because the current Roslyn CTP doesn't yet implement the "expression-trees" bit of either VB or C#. That is in the pipeline, though. Unfortunately it also falls down in more interesting cases because the compilers don't support the conversion of statements into expression-trees: they can only turn expressions into expression-trees. If you'd like to see statement-lambdas be turnable into expression trees -- then let us know! We're looking at future (post-Dev11) ideas in our language design meetings. A good way to communicate your wishes is through UserVoice: http://visualstudio.uservoice.com/forums/121579-visual-studio/category/30931-languages-c-
|
# ? Oct 21, 2011 23:29 |
|
Zhentar posted:And is there some legalese somewhere that defines what exactly re-distribution & production use mean? I'm afraid us engineers aren't allowed to help anyone with legalese -- if we say the wrong thing it counts as legally binding on MS. And I'm afraid we also haven't announced any plans for further Roslyn CTP updates. (I can tell you that an updated AsyncCTP is in the works though! for better Phone and Silverlight5 support.)
|
# ? Oct 21, 2011 23:39 |
|
|
# ? Apr 26, 2024 23:42 |
|
ljw1004 posted:Not possible yet I'm afraid. Thanks for the reply! It certainly would be cool if the compilers could generate statement expression trees. I'm imagining stuff like generating SQL procedures from code, or sending code to be executed on another machine (security concerns notwithstanding, of course). Not sure if I have a personal need to do that on the projects I'm working on right now, so I won't make a UserVoice post, but it's great to know that this kind of stuff is being considered.
|
# ? Oct 21, 2011 23:42 |