|
I'm looking into MEF and getting pretty confused with the versioning. I'm seeing things that say MEF came with .NET 4 and MEF 2 comes with .NET 4.5, but I also see the MEF 2 NuGet package which contains a portable implementation. Is this a case of having the "full" MEF 2 with .NET 4.5 and a lightweight MEF 2 subset on NuGet?
|
# ? Mar 24, 2015 13:04 |
|
|
# ? May 19, 2024 09:16 |
|
22 Eargesplitten posted:I read the OP, I see Skeet and Richter recommended for books. I'm used to Java and C++, with somewhere between an undergrad sophomore and junior level of understanding. So I don't need to have the difference between a parent class and an interface explained to me. But I still need something aimed at a relatively low level. Which of the two would you recommend (or others)? Skeet's book might be better? It's targeted at people who already know the basics.
|
# ? Mar 24, 2015 13:58 |
|
epalm posted:Mind if I steal this from you? Or, if I do it myself by setting SuspendExecutionStrategy to true/false in the constructor/dispose, is that all or is there more to it that you've stumbled across? All yours. I'd have to go find the Azure project that we have have that Transaction wrapper in, but I don't remember there being too much happening in the constructor. I think we also had some code that changed some per-request settings in the data layer, but that was project specific. C# in Depth is a top-notch book for anyone with a beginner or above grasp of C#. Highly recommended. Bognar fucked around with this message at 15:00 on Mar 24, 2015 |
# ? Mar 24, 2015 14:58 |
|
Bognar posted:All yours. Brilliant, sent you a PM. When you find it, that's the email address to use. Thanks!
|
# ? Mar 24, 2015 15:25 |
|
Inverness posted:I'm looking into MEF and getting pretty confused with the versioning. not quite; .NET 4 and 4.5 both have "MEF 1", although the 4.5 version has more features and bug fixes. "MEF 2", aka Microsoft.Composition, is the standalone package, which can also run on .net 4 and 4.5, as well as on system.runtime/PCL platforms. MEF 2 isn't a subset so much as a rethink. it adds as well as removes features.
|
# ? Mar 24, 2015 20:55 |
|
I downloaded the Windows 10 SDK and started screwing around with it. And that's basically all I have. It does work on phones... kinda, but I'm having issues with my PCL storage library so I can't log in at the moment with the emulators. But it should have nearly the same interface across the two devices. They are getting rid of the split projects and instead are pushing more adaptable ux controls.
|
# ? Mar 24, 2015 23:42 |
|
It's pretty funny to see updates on various MSDN blogs and have one of the first comments be a link pointing out the XNA 5 voting page with over 20k votes. I guess Microsoft is just going to keep pretending it doesn't exist. The least they could do is open source XNA 4 so that the MonoGame people could benefit.
|
# ? Mar 25, 2015 13:20 |
|
Newbie question here, but how come this won't work for me?code:
I've been reading up on the solution/ links posted here but can't seem to get it to work no matter what I do. tunah posted:Remember to call Dispose on the icon when your application is exiting. Actually, I'm already calling it before the exit button is clicked. Should it be elsewhere? code:
VVV That looks amazing! VVV TheEffect fucked around with this message at 16:38 on Mar 25, 2015 |
# ? Mar 25, 2015 16:31 |
|
More Windows 10 SDK stuff:
|
# ? Mar 25, 2015 16:32 |
|
TheEffect posted:Newbie question here, but how come this won't work for me? & is a string concatenation operator in VB.NET. Did you mean to use AndAlso?
|
# ? Mar 25, 2015 16:38 |
|
That looks great. Except for the lack of padding around text which makes me
|
# ? Mar 25, 2015 16:38 |
|
GrumpyDoctor posted:& is a string concatenation operator in VB.NET. Did you mean to use AndAlso? I have no formal VB.Net training, only C++ and very little at that. That was exactly what was needed. Thank you!!!
|
# ? Mar 25, 2015 16:40 |
|
TheEffect posted:I have no formal VB.Net training, only C++ and very little at that. That was exactly what was needed. Thank you!!!
|
# ? Mar 25, 2015 16:49 |
|
I'm kind of a "try it and break it until you figure it out" kind of guy. So far I'm almost nearly done with writing a fairly impressive, in my opinion, file push / file remove program that let's user's choose a file or a directory to push/remove and let's them specify where it should go, without any training in vb.net at all. I guess that's elementary for most of you guys but I'm kind of proud of myself. Although to be fair I should've Google'd around a bit more on that last question since the answer was so very simple, and an intro tutorial probably WOULD'VE covered something like that. Edit- So on that note, for a slightly more advanced question, how come "My.Computer.FileSystem.CopyDirectory" doesn't copy the directory that's selected like MSDN implies, but rather the CONTENTS of said directory? How can I get around this? TheEffect fucked around with this message at 00:49 on Mar 26, 2015 |
# ? Mar 25, 2015 17:00 |
|
I've got a really, really basic question that is a bit about personal style perhaps, or best practice. If I have a method that's going to be used to say, update a person's details, what is the best approach: 1) include the details in the signature of the method as parameters OR 2) use some kind of an purpose-made object to hold all of the possible update fields? 1. code:
code:
Try not to get too hung up on my specific example's details, but more the general idea of whether there's a number of parameters that is just "too many" and you should refactor out the details you need into a class that can be populated and then sent as a parameter.
|
# ? Mar 26, 2015 06:23 |
|
GrumpyDoctor posted:& is a string concatenation operator in VB.NET. Did you mean to use AndAlso? Hahahahaha how do people use this loving language
|
# ? Mar 26, 2015 06:30 |
|
fleshweasel posted:Hahahahaha how do people use this loving language A lot of people (myself included) use vb.net. We're not weirdo's/idiots.
|
# ? Mar 26, 2015 07:17 |
|
The Wizard of Poz posted:I've got a really, really basic question that is a bit about personal style perhaps, or best practice. If I have a method that's going to be used to say, update a person's details, what is the best approach: 1) include the details in the signature of the method as parameters OR 2) use some kind of an purpose-made object to hold all of the possible update fields? Yes, the second approach is something most developers tend to naturally discover at some point in their programming life. It makes many scenarios easier and all calls do not necessarily need to be changed just if the fields on the object change, which is nice. It also enables polymorphic behavior - maybe at some point you will want to provide a UpdateLegalPerson structure that subclasses the basic UpdatePerson structure. There are some downsides, though - if you add properties to this object but forget to update the call sites or the method contents, you could have asymmetry in data production and consumption. But the tradeoff is generally worth it for anything nontrivial. At the end of the day, such design decisions need to be handled on a case-by-case basis, taking into considerating not only the code but also the purpose of the code and its foreseeable future evolution and maintenance. Both approaches are valid, certainly.
|
# ? Mar 26, 2015 08:12 |
|
The Wizard of Poz posted:I've got a really, really basic question that is a bit about personal style perhaps, or best practice. If I have a method that's going to be used to say, update a person's details, what is the best approach: 1) include the details in the signature of the method as parameters OR 2) use some kind of an purpose-made object to hold all of the possible update fields? Second one, just make sure you are using a dedicated viewmodel for updates, and not a model that might expose some fields you don't want updated as it may be possible is certain circumstances to update them (bad automapper usage etc).
|
# ? Mar 26, 2015 11:02 |
|
The Wizard of Poz posted:I've got a really, really basic question that is a bit about personal style perhaps, or best practice. If I have a method that's going to be used to say, update a person's details, what is the best approach: 1) include the details in the signature of the method as parameters OR 2) use some kind of an purpose-made object to hold all of the possible update fields? I used to use #2 a lot, but I mostly just stick to long method signatures now. The main reason is to reduce errors when coming back and updating the method. If you need to add a parameter to a method but you're using a parameter object, you have to find all of the places you're the parameter object to update it to add the new parameter. This is error-prone since there's no guarantee you'll actually change all of the usages. However, if all of your parameters are explicit in the method, the compiler won't let you build until you fix every single one. The usual counter-argument to this that I hear is that you can make the parameters required in the constructor of the parameter object. To me it seems like you've just moved the problem from the method call to the parameter object constructor at that point, but this approach can be useful if you're passing a lot of the same information down to other methods. EssOEss posted:At the end of the day, such design decisions need to be handled on a case-by-case basis, taking into considerating not only the code but also the purpose of the code and its foreseeable future evolution and maintenance. Both approaches are valid, certainly. Also this.
|
# ? Mar 26, 2015 14:26 |
|
Say I wanted to get a string of all characters at the end of a path starting with "\" and going until the end. I'm looking at the string functions and can't find any easy way of doing this. Could anyone offer a hint? Edit- I guess I would use Split() and return the last element of the array? Nope- "One dimensional array of 'String' cannot be converted to 'String'. LiterallyAnything fucked around with this message at 16:54 on Mar 26, 2015 |
# ? Mar 26, 2015 16:35 |
|
Brady posted:Say I wanted to get a string of all characters at the end of a path starting with "\" and going until the end. I'm looking at the string functions and can't find any easy way of doing this. Could anyone offer a hint? Something like this? code:
|
# ? Mar 26, 2015 16:53 |
|
zokie posted:Something like this? That's returning everything after the first "\".
|
# ? Mar 26, 2015 17:01 |
|
I thought that was what you wanted...
|
# ? Mar 26, 2015 17:15 |
|
Brady posted:Say I wanted to get a string of all characters at the end of a path starting with "\" and going until the end. I'm looking at the string functions and can't find any easy way of doing this. Could anyone offer a hint? This works for me and returns "\file.txt" code:
VVVVVVVVV GI_Clutch fucked around with this message at 17:20 on Mar 26, 2015 |
# ? Mar 26, 2015 17:16 |
|
Can you use Path.GetFileName?
|
# ? Mar 26, 2015 17:18 |
|
Scuzzywuffit posted:Can you use Path.GetFileName? Will this work if it's not a file, but a directory instead? Unable to test right this moment but I'm gonna try this and GI_Clutch's solution when I can. Thanks guys.
|
# ? Mar 26, 2015 17:49 |
|
Brady posted:Will this work if it's not a file, but a directory instead? Unable to test right this moment but I'm gonna try this and GI_Clutch's solution when I can. Thanks guys. The docs explicitly state that you get an empty string if it's a directory.
|
# ? Mar 26, 2015 17:54 |
|
Yes. It appears to just grab everything after the final slash. It doesn't even need to be a valid path or anything. You can throw anything you want at it and it just grabs the last thing.code:
|
# ? Mar 26, 2015 17:54 |
|
No Safe Word posted:The docs explicitly state that you get an empty string if it's a directory. I think that's talking about the "directory or volume separator character", which I'm assuming means '\' or ':'. It should work even without a file extension, since I think it's technically legal to have a file without an extension.
|
# ? Mar 26, 2015 18:13 |
|
TheEffect posted:I have no formal VB.Net training, only C++ and very little at that. That was exactly what was needed. Thank you!!! Off the top of my head the &/&&/AndAlso and |/||/OrElse are probably the two biggest 'gotchas' about VB.net as compared to how other languages work. Actually bitwise operators too have a few quirks, maybe brain up on them: https://msdn.microsoft.com/en-us/library/wz3k228a.aspx The other big change is how variable declaration is done, but that's mostly syntactical and you probably won't even run into it unless you're doing a bunch of List (of or LINQ style one line statements.
|
# ? Mar 26, 2015 19:24 |
|
Brady posted:Say I wanted to get a string of all characters at the end of a path starting with "\" and going until the end. I'm looking at the string functions and can't find any easy way of doing this. Could anyone offer a hint? You don't really say what this is for, but since other's were going with directory/file examples, maybe this is what you're looking for? code:
|
# ? Mar 26, 2015 19:27 |
|
I'm looking for some help regarding shared projects. Here's how our Subversion repository is laid out: /tags /branches /trunk Shared1 Shared2 Shared3 Product1 Product2 Product3 Product4 ... Product9 The Solution file for each product has project references to the shared libraries (..\..\Shared1\Shared1.csproj and similar). Right now, if we build Project9, it will always reference the very latest of all shared libraries. We sometimes create a tag for the entire trunk when releasing a version, but usually the product executable is given a version string containing the revision of trunk it was built from. We don't fix old versions. If there is a bug to be fixed, it will be fixed in the next build and the customer will upgrade to the latest version. This has been working just fine, but we need to make changes due to ISO certification. So here's where I would like to hear any opinions. A solution containing all projects needed to build is great, in my opinion. But let's say we now need to run much more QA before releasing a new build. Product1 will want to reference a shared library at a specific revision, not the very latest. Maybe we should build nuget packages of all the shared libraries? What happens if we want to step into code which is in one of the shared libraries, can the source code be included in the nuget package? Won't it be really tiresome to fix a bug in a shared lib if we no longer use project references? And if we want to keep using project references, maybe we should choose another layout for the repository. Where each project/library has tags, branches and trunk. Like this: Product1.sln ..\..\Shared1\tag\1.0\Shared1.csproj (or similar) ..\..\Shared2\tag\1.3\Shared2.csproj (or similar) But then, building Product1 for the first time will require going into each shared project and making sure we get the tag that the solution references. Sorry for this wall of text. We are trying to come up with how we want things to work in the future but none of us have experience with this.
|
# ? Mar 26, 2015 23:27 |
|
tunah posted:What happens if we want to step into code which is in one of the shared libraries, can the source code be included in the nuget package? The way we have it set up within the VB/C# team at Microsoft is that, for each binary DLL, we upload its symbols to our company's internal symbol server. Also the symbols contain a TFS command to fetch the source. That way VS can automatically pull up the correct symbols, and can automatically pull up the correct source code. (I have no idea how this magic is accomplished...) By the way, I've not seen it done with NuGet, but my first thought reading your post was "Use NuGet!". It seems like the best way to represent a dependency on a specific version of a DLL. ... The way we do it is that each "independently maintained release" has its own branch in source control. Thus, Visual Studio 2013 RTM / Update1 / Update2 / Update3 go in branch called "D12Rel", and Visual Studio 2015 RTM will eventually go in a branch "D14Rel", and VS2015 CTP1 through CTP6 were all versions along the way in a single branch called "DP14". (If there's a bug in VS2013 then we can tell customers to upgrade to the latest VS2013 update, which is why VS2013 and all its updates go in just one branch: Update1 doesn't need its own branch, for instance. But we can't tell them all to upgrade to VS2015 which is why VS2013 has to be kept in its own branch). We actually have large enough teams that each shared library (or set of libraries) has its own similar branch structure. Thus, the Roslyn team (VB/C# compilers) have one branch for the version of Roslyn that will go into VS2015RTM, and another branch for the latest ongoing development. That way, the main product branch DP14 / D12Rel / D14Rel doesn't need its own copies of the Roslyn source code. It merely gets "FCIBs", "Foreign Checked In Binaries", where we copy the output DLLs from the Roslyn branch into a folder called "ExternalAPIs" in the main product. quote:Won't it be really tiresome to fix a bug in a shared lib if we no longer use project references? Yeah, I guess. But it's a fact of life. If you need to independently service old versions of your product (rather than just telling customers to buy the newest version), then you have to make it harder on yourself. So: if we really needed to fix a bug in an old release of our product, we'd sync up to the latest version in the branch for that release. And if it was a bug in the VB/C# compilers, then we'd also need to sync up to the appropriate version of the Roslyn source code. We don't have one "canonical" .sln file. A developer working on one bug might have a SLN which includes a hodge-podge of related projects.
|
# ? Mar 27, 2015 00:50 |
|
What is your ideal/required process for versioning and QA?
|
# ? Mar 27, 2015 01:07 |
|
NuGet is one of those typical Microsoft "I will do magical poo poo behind the scenes for you but not tell you what I did so if you have even one person in your team who is not anal retentive OCD*, you will be in a world of poo poo in no time." technologies. Works great 99% of the time but that 1% of the time you're spending a day forced to figure out what it did which defeats the purpose of using it. It's probably nice for pulling in 3rd party libs but I wouldn't recommend it for your own stuff (we tried). Also if you can show me how to set up this symbol server magic quickly I'll blow you. I've never gotten that to work rebliably in a reasonable amount of time spent. Keep it simple, use externals if you're on svn or otherwise its equivalent (I hear git sucks for this, sorry!). Only release from tags and with all externals pointing to tags. Use commit hooks to enforce this if possible. *I'm bitter because I'm the OCD guy who gets to clean up the mess.
|
# ? Mar 27, 2015 02:22 |
|
I'm using nuget for internal package management and I like it. There's some cloud service that offers the servers for you; I forget what it's called. Just write a script to make a package, IMO.
|
# ? Mar 27, 2015 03:40 |
|
nuget is not magic and you will waste more and more time if you refuse to use it, since everything's coming to rely on it maintaining build scripts and nuspec files requires at most a small chunk of one engineers time. setting up a symbol server took us about a day and it works consistently
|
# ? Mar 27, 2015 03:46 |
|
Adhemar posted:NuGet is one of those typical Microsoft "I will do magical poo poo behind the scenes for you but not tell you what I did so if you have even one person in your team who is not anal retentive OCD*, you will be in a world of poo poo in no time." technologies. Works great 99% of the time but that 1% of the time you're spending a day forced to figure out what it did which defeats the purpose of using it. It's probably nice for pulling in 3rd party libs but I wouldn't recommend it for your own stuff (we tried). Also if you can show me how to set up this symbol server magic quickly I'll blow you. I've never gotten that to work rebliably in a reasonable amount of time spent. Ha! 1% only? Only a day to fix a mess? Sounds much better than all the years I've spent not using it to me.
|
# ? Mar 27, 2015 05:37 |
|
|
# ? May 19, 2024 09:16 |
|
Is there somewhere I can find a tutorial for making a generic shop website in C# .NET MVC with a database?
|
# ? Mar 28, 2015 14:05 |