Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
wwb
Aug 17, 2004

Though looking at the roadmap / slides -- basically the theory is write a core, write platform-specific UIs -- does that just translate to a Mac Presentation Foundation and a Gnome Presentation Foundation at some point down the line? Or do they just buy Xarminian and get Xarminain.Forms?

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

Gildiss posted:

So just started work and could use a pointer to some good resources to pick up on C# and SSIS jazz.
Mainly concerned with the SSIS, as I have not worked with SQL much at all.

If you can do C# I would generally skip SSIS unless it is a db to db import -- SSIS is poo poo if you can code, especially for error handling and such.

wwb
Aug 17, 2004

It is 2014. Please leave
code:
 
in the last century.

wwb
Aug 17, 2004

Newf posted:

In favor of the css white-space: nowrap? What's the advantage?

That is one way though there are a number of CSS techniques one could use (ie -- min width) to get there.

The advantage is that you are no longer jamming presentation elements (HTML nonbreaking spaces) into your code and it is overall cleaner and easy to manage long term and it is doing the right thing.

wwb
Aug 17, 2004

Silverlight is dead but alive -- a lot of the technical basis -- basically componentizing the BCL and runtime -- for what they are doing in .NET core came from what they did to build silverlight funnily enough.

twodot posted:

There's nothing inherently wrong with doing this, it's just that Windows services is not really a target scenario for .NET Core. When you're thinking about .NET Core think about things like Windows Store apps (Phone and Client) or ASP.NET.

This and also the sorts of service apps they are targeting are the cloud based sort where you have multiple nodes and do rolling updates to get the same sort of effective update without downtime scenario.

wwb
Aug 17, 2004

You can definitely start coding towards the interface at least -- that is pretty well factored. For what goes on behind it I too would look at the auditor's requirements.

wwb
Aug 17, 2004

Mr Shiny Pants posted:

Why not just use something like SSH and SFTP it to the host? :(

If you are deploying applications this way you are probably retarded. Use a build server.

wwb
Aug 17, 2004

RICHUNCLEPENNYBAGS posted:

So, speaking as the only full-time dev at my workplace, I definitely do not want something with a complex formal build/CI process. What's the benefit for such small-time shops, really?

We have a private nuget server for in-house dependencies so I'll just keep a canonical git branch for any actual production release and it'll be referencing the right versions of dependencies.

Automated CI / build is vastly more important in a one man shop than a big shop for a few reasons:

* It keeps you honest and makes sure you don't skip a step. Which is really easy when nobody is even capable of looking over your shoulder.
* Keeps the bus factor a bit under control -- the best source control in the world is worthless if nobody can build / deploy the app effectively.
* As the only full-time dev do you want to spend your time babysitting deployments or writing features / quashing bugs?
* All the normal advantages apply beyond this.

wwb
Aug 17, 2004

We do almost all of our core prototyping in a TDD manner -- feedback loop is great, you get very workable examples out of it. A also really love it for exploring new frameworks and tools.

Haven't had a whole lot of success doing full out TDD on larger projects. The one that did have full out TDD became a pretty sad example of onion architecture gone wild to be honest.

wwb
Aug 17, 2004

@Ithaqua -- more like the project was designed to be a lot more bigger and pluggable than it was. And there were lots of layers of plugability you need to get that level of testability which makes things hard to follow. That said the app is running like a champ 5 years later so that is all good.

@crashdome -- my most successful testing has got things to the point where we know our side of the app works. So when it comes to debugging those nasty integration issues we can focus a lot better as we know one side of the equation is likely fine. Especially with outside vendors involved who want to throw your code under the bus because their code is of course "perfect" and "battle tested". Another side effect is if you can get good at simulating infrastructure you can make your code behave predictably when it fails, including firing off "this is wrong and this is what you need to look at" messages in the log.

I second the art of unit testing, great book and it helped me

wwb
Aug 17, 2004

Scaramouche posted:

Yeah, I have access to our SOLR/Lucene install (it drives the search on our site) but didn't want to mess around with setting it up for this. I wasn't looking for a perfect solution, just a better one than the IF...THEN chain that I had going previously. The database solution is relatively elegant for the amount of effort involved, and if I want to add/remove/change it's just a simple INSERT/UPDATE away. It falls down for complicated cases (multiple negative keywords), but for multiple positive keywords I can just add rows (e.g. Boxer, Boxing). I've actually already repurposed it for some other similar attribute name -> attribute value relationships (by adding a Type column) for about 100,000 products.

Is sql fulltext and option? That could get you there without messing about with SOLR.

wwb
Aug 17, 2004

I would strongly suspect network issues -- such as saturation -- here. I've seen this sort of thing and every time it traced back to either flaky network hardware or network saturation. That was a little more impressive in some of these cases but I'd suspect it would not take much to saturate one side of this open vpn connection. Unfortunately Sql Server's native protocol isn't the greatest at crossing WANs and tends to error out rather than retry a-la-http.

I would architect around the problem -- one thought would be to expose sql server's http interface and then have the app communicate with that. Http should be able to deal with network issues sql's binary protocol can't and you'd still get XML at the other end.

PS: why oledb? I'd use the native drivers as they might be more bulletproof there.

wwb
Aug 17, 2004

If you've got IIS on server B I'd just push the app over there and eliminate the network angle. Keep Fowler's 1st law in mind.

wwb
Aug 17, 2004

bpower posted:

Can I not have a spa within a larger asp.net site? The other nonangular stuff will still need their routes wont they?

We do this but more like http://www.example.com/offices/#hashRoute or http://www.example.com/furniture/#hashRoute than routing off query strings and such.

Even with angular you still need to build routes for the services. I'd check out attribute based routing at this point rather than handle it all in the routing config file.

wwb
Aug 17, 2004

bpower posted:

Ok I'm getting closer.

I can go directly to

http://www.blah.com/Office/?officeid=52#!/staff
http://www.blah.com/Office/?officeid=52#!/budget

So how do I create the dynamic links within the Angular views. I need to somehow have

<a href="Office/?officeid=52#!/staff"> Staff</a>

Is that right?

edit: Thanks wwb, I'll look into that.

Side note from a URL nazi: It would make me feel alot obetter if you got to http://www.example.com/office/52 -- that is easy to do, if you are using default MVC routing just change your officeId parameter to be ID. If not setup the parameter in your routes.

For angular -- presuming you are linking in the container it is pretty easy. You don't need to change the page -- ie https://www.example.com/office/52, just what happens after the hash. So you'd change to the staff view from the budget view. Now, you will need to track the ID number (52) but you'd already have to have that handled since the view is tied to a single office and you'd need to expose that number to angular to render the default view.

wwb
Aug 17, 2004

Lawyers, spyware, obscenities and also making sure it stands on it's head and is readable to the general public. Lets give these guys some credit for the work they are doing.

That jquery thing should be working to create query strings, I'd walk through it carefully with a js debugger and see what is going on.

wwb
Aug 17, 2004

Dromio posted:

Here's the simplest I can do, where the data passed is a complex javascript object:
code:
      $.ajax( {
        url: window._resources["load-siteproductpricing"],
        type: "GET",
        data: aJavascriptPricingContextWith6Choices
      });
I get querystrings like this: ProductId=51&Choices%5B0%5D%5BChoiceId%5D=25&Choices%5B0%5D%5BOptionId%5D=11&Choices%5B0%5D%5BOptionType%5D=width&Choices%5B0%5D%5BChoiceValue%5D=101.125&....

My MVC action recognizes this as a pricing context, but fails to hydrate it properly. So if I look at it in the debugger the action is called and passed a PricingContext, and PricingContext ends up with a ProductID of 51. But it has the 6 choices and those end up with ChoiceIds of 0 and OptionTypes of "" and ChoiceValues of "". It looks like the default model binding in MVC just isn't up to the task of handling these more complex types, unless I'm missing something simple.

At this point I'm tempted just to write a nasty javascript serialization routine that makes something stupid like a "|" delimited string, then split it back up manually on the server side. But it feels like the wrong thing to do and fraught with peril.

It kind of looks like it is doing the right thing -- productID looks right. Now, choices is fubar but I'm wondering if that is too complex so it gets json encoded? See http://api.jquery.com/jQuery.param/ for some info on what might be happening but there is a new "traditional" flag you might want to set. $.get() might also behave a bit better, that is what I've typically used rather than $.ajax().

wwb
Aug 17, 2004

Space Whale posted:

So I spent Friday getting teamcity working and now find myself wondering how to best leverage it. We can and do use azure deploy. I can also, of course, spin up my web app on the same machine that teamcity runs on.

Which would be recommended? For internal dev stuff I'm thinking on the server that's ten feet from me, and for UAT or show and tell with management, azure.

Also, what about MSBuild should o watch out for? Until now I've just ran a script if I played with java and used visual studio to debug or the click once deploy.

MSBuild is a pretty fugly XML language you can't completely avoid for .NET stuff as it is the basic language of .NET building -- everything else rides on top of it in some way. That said, it is tough to work with and to be honest I'm moving as much above and around it -- using anything from powershell scripts to tools like FAKE -- to make things more easily understandable and maintainable.

Our typical deployments are not as fancy as Ithaqs -- we usually use MSBuild to create the binaries and other artifacts and then robocopy to deploy the artifacts to the right places on the web servers. I don't think rebuilding the binaries at each tier is that much of a problem -- presuming you've got the same inputs and same process of building it is reasonable to presume the same outputs.

wwb
Aug 17, 2004

^^^ If you set things up right that doesn't happen. It is easy enough to configure things to look for a specific tag or rely upon chained builds. If you have that big a change in your environment like switching framework versions between cycles you are doing a bunch wrong.

wwb
Aug 17, 2004

RICHUNCLEPENNYBAGS posted:

Big git merges invariably break csproj files and it sucks. Do you guys have any strategies to deal with that?

The trick to avoiding big, painful merges is to not have big merges. Stuff like rebasing the feature branches off of master is a good place to start.

That said, I've done a fair bit of merging of things and I've never had that much trouble with the project files -- the modern iterations are pretty clean and most changes are not that troublesome. What git client are you using to do the merges?

wwb
Aug 17, 2004

Bognar posted:

I can't think of a time where I had a non-conflicting git merge break a .csproj file.

Me too.

I'd try using a better merge tool -- I have had some success with sourcetree. I also really like kdiff2 which comes bundled with tortoisehg.

wwb
Aug 17, 2004

RICHUNCLEPENNYBAGS posted:

Why would that make a difference if there are no conflicts?

It just ends up assuming closing tags and so on are duplicated between versions when it isn't necessarily true.

I'm not sure but I suspect seeing what is going on will help -- it sounds like someone is doing something retarded like switching line endings which is blowing things up. Have you looked at a diff before you merged?

wwb
Aug 17, 2004

I'm not sure how that is not possible -- you should always be able to grab the upstream changes.

Anyhow, I think hirvox hit the nail on the head -- the default git merge tool isn't helping you here.

wwb
Aug 17, 2004

Fiddler supports that sort of thing -- it has some request building functions and can replay har files and such.

HTTPIE is a command line utility but it works on windows too since it is python based.

wwb
Aug 17, 2004

^^^ Congratulations, you've isolated the problem. Ask ops if they are fronting the production server with anything, something is stomping on the request between your box and the server.

wwb
Aug 17, 2004

EssOEss posted:

What are the negative things you have heard about ReSharper?

Breaks F# code completion.

wwb
Aug 17, 2004

UberJumper posted:

So apparently after writing C# unit tests for half a week. I have apparently just inherited all responsibilities as lead test developer. The company is small (~20 people), and honestly even after saying "This is a bad idea" and i don't know anything about being lead test developer, they still put me in this position.

The old lead left on apparently bad terms, and there is absolutely no documentation. There is apparently a Jenkins server, that seems to be pulling from a SVN (we swapped to git a year ago). Apparently they just want to start from scratch when it comes to testing, and i am at a complete and utter loss. Does anyone have any tips for doing this kind of degree of testing for C#.

Greenfield is a lot better than undocumented brownfield so you've got that -- I would requisition a new server ( check out TeamCity if you have a budget ) and and get going there. Do you have an issue tracker? That is probably the 2nd most important thing after source control . . ..

wwb
Aug 17, 2004

Bognar posted:

I got tired of MVC's string parameters for links in views, so I made an HtmlHelper that uses expressions.

NuGet: https://www.nuget.org/packages/System.Web.Mvc.ExpressionLinks/0.1.1
Github: https://github.com/ckimes89/Mvc-ExpressionLinks

It's super alpha, so it just supports one overload of ActionLink right now, but I plan to add overloads for Url.Action, RedirectToAction, etc. To install it, use install-package System.Web.Mvc.ExpressionLinks.

Here's what you can do with it. Given a controller method that looks like:

C# code:
public class HomeController : Controller
{
     public ActionResult MyMethod(int id, string search)
    {
        return View("Index");
    }
}
You might normally use something like this to make a link in Razor:

C# code:
@Html.ActionLink("My Link", "MyMethod", "Home", new { id = 1, search = "butts" }, null) // have to use null htmlAttributes here because of weird ActionLink overloads
But that sucks. The controller and action names are just strings, so unless your refactoring tool is MVC-string aware you can easily screw things up. The same goes for the parameters since they're just an anonymous object, so changing a parameter name in the action method signature will break things silently.

But instead, using my library:

C# code:
@(Html.ActionLink<HomeController>("My Link", c => c.MyMethod(1, "butts")))
Now, refactoring tools will automatically pick up the usage of MyMethod, renaming parameters in the method signature doesn't cause you headaches, and you don't have to pass in null to the weird ActionLink overload when specifying a controller.

What do you guys think? Would anyone else use this?

I'm not trying to rain on your parade -- this is awesome stuff -- but IIRC the MvcContrib and their FluentHtml bits had this stuff integrated back in the MVC1 days. Now, I'm not sure if that library kept up with MVC because most of what it did got subsumed into the framework. Except for this sort of strongly typed stuff.

FWIW one of the issues with this was it was very expensive at scale but this probably matters less in the modern world of javascript rendered pages.

wwb
Aug 17, 2004

That might have been the case in some later versions of scaffolding. FluentHtml definitely had this as a dynamic, reflective implementation early on until it moved into the Mvc Futures project and died, we were using it before T4 was released . . .

wwb
Aug 17, 2004

Bognar posted:

I found a bunch of libraries that do something like this for getting the action names, but in my limited search I didn't see anything that extracted the parameter names/values from the expression. It really wasn't much code to implement this, so I would be more surprised if something didn't already exist doing the same thing than if it did.

I think it was in the MVC Futures then got pulled out but someone definitely did the same sort of lambada thing -- see http://eduncan911.com/blog/archives/type-safety-with-asp-net-mvc-futures.html for an example. Note the date.

Thanks for bringing this back to life. Strings are dirty.

wwb
Aug 17, 2004

Dietrich posted:

So my client has a solution with 121 projects in it, and through branching and merging the .sln file has developed some issues. Are there any tools out there that will analyze a .sln file and find problems?

The specific error we're getting is "Error parsing the nested project section in solution file."

I'm not aware of specific tools but one place to start might be trying to msbuild the solution file in verbose mode and see what it trips on.

Looking at the sln file might also work -- they aren't that wacky, sometimes merge artifacts are very obvious. Blame can also help.

wwb
Aug 17, 2004

RICHUNCLEPENNYBAGS posted:

Here's my question about this: why go to the trouble of a whole separate namespace with a ton of duplication for WebAPI, then have the WebAPI template include MVC?

In a nutshell, history and politics and requirements to maintain backwards compatibility. The MVC stack was mature when the guys doing the web API dove in so they wanted to do some things different even though the semantics were largely similar. The MVC group didn't want to break stuff so they ended up creating 2 parallel stacks with lots of similar terminology that is getting fixed in ASP.NET v5.

wwb
Aug 17, 2004

Yup -- TeamCity (another JetBrains product) comes with free dotCover support. The other options require getting licenses on the server but dotCover just works.

Note if you've got a lot of code it can add a ton of time to the build -- Lucene.NET would take 2+ hours with coverage versus ~10 minutes without it.

While I agree code coverage can be gamed, especially if you are using it as a stupid management metric, you can still get a ton of value out of knowing what you are testing and where.

wwb
Aug 17, 2004

chippy posted:

Yeah, I'm not expecting it to take too long. I know that Dapper is pretty performant and this isn't a lot of data to be inserting, the problem is that this application is used at a factory where it's run on a lovely network. mostly on terminals with poor wireless connections, and all supported by a copy of SQL Server 2008 Express running on lovely old hardware. All of which they are very resistant to improving if it involves spending any money. There are hundreds of these inserts flying around all the time and they do have performance issues already, so I have to be very careful with anything that might make it worse.

What you are describing basically is a micro-chasm of the public internet. I would think about pushing the communications layer to a HTTP-based API, that will do a lot better in spotty networking conditions than sending SQL down the line.

wwb
Aug 17, 2004

GrumpyDoctor posted:

Most of the people making plugins for this thing are novice programmers; I'm hoping that the response I got assumed that my question was "What's this IDisposable thingy?" rather than "Why do you people not appear to understand what you're doing?" But it's real annoying when your reward for not calling someone an idiot is getting called one yourself.

Could they be handling the instantiation / disposal of the plugin? If they are doing so they probably don't want userland, so to speak, disposing things . . .

wwb
Aug 17, 2004

Bognar posted:

Even if they were, they shouldn't make their public API objects disposable if they don't want them to be disposed.

You'd probably have to make IPlugin disposable if your code just sees collections of IPlugins to manage. Not a good way to make that non public.

@GrumpyDoctor -- OK they are just retards then.

wwb
Aug 17, 2004

Unfortunately there just aren't a lot of great .NET CMS options out there. I gave up and let the web hippies use wordpress or whatever they wanted to smoke and provide http services for the front end to consume.

wwb
Aug 17, 2004

RICHUNCLEPENNYBAGS posted:

Umbraco seems to be popular and uses MVC.

Popular != great.

Basically the economics of .NET with expensive developers, expensive hosting and barriers to entry killed it in this area. lovely PHP-based apps that could run on $1/mo web hosting plans won the war there for better or worse.

wwb
Aug 17, 2004

I'm not so sure about that -- the content types don't give a poo poo about running on a good stack vs a bad stack and they also are loath to pay for decent hosting. On the other hand they have a hard-on for the massive plugin markets you see for wordpress or drupal because they can drag and drop them in and get the widget they want and such. Add on top of this that you'd really start thinking twice about building a site for a pure content play in 2014 -- why not just publish to medium and instantly get airtime without investing in building sites?

Adbot
ADBOT LOVES YOU

wwb
Aug 17, 2004

Looking at your request in that thread I would start with redmine -- it is a bit focused on being an issue tracker but they grew a pretty badassed wiki in the process. The main advantages is they do have an API that can be useful and it features built-in "dump this wiki as a PDF" features. The platform has pretty good extensibility so you can probably bolt on what you'd need.

As for how hard could it be -- the basics are generally easy but things get real squirrelly real fast. Especially if you factor in non-technical content managers doing things, needing the thing to function across dev, QA and production. And then if you want to get loopy and batshit you need to start thinking about custom components (aka plugins). Server-side is tricky but doable with IoC. The real fun is client-side -- how do you have a page with 42 individual components that don't know about each other and all wanting their own custom javascript? How does that come together? Who owns the html head section? Etc, etc. We got pretty close to solving most of this on the last CMS we built but we still couldn't keep up with the Wordpresses and Drupals of the world.

That said, if you are doing a site that is really about one thing that needs some limited CMS functions -- IE edit pages and maybe provide editable text blocks and anything more complex is custom programming -- the baseline toolkit you get with ASP.NET is pretty solid and goes a long way towards providing the functions you'd need.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply