Automated Web Reference Switching in C# project with NAnt - c#-4.0

Problem: I have a C# 4.0 project with web references in Visual Studio 2010. I have two sets of web references, but I do not want to use them simultaneously. I want to be able to automatically remove all my current ones, add all the new ones, and then do the equivalent of 'update web reference' on each of them. I'm having a difficult time even finding where to start.
After searching around, I've found NAnt, which looks like it may be able to accomplish what I'm after (with the wsdl command), but I'm in unfamiliar territory.
Question: Is NAnt the right tool for this job? Will I be wasting time if I learn to use it? Is there a simple solution that I'm just not seeing? I'm more just looking for some guidance than a hammered out solution.

If anyone's interested:
After doing more research, I think I'm going to use some combination of
MSBuild,
How to call MSBuild from C#,
and
How do I automatically update a web reference at build time?
I'll update this answer with my solution when I'm done.

Related

Keep old VS project when migrating to new controls suite or not?

The project I’m working on is revamping an existing web portal.
Migration from the old controls (Infragistics) to a new suite (Telerik) is part of the revamp.
Would you recommend to keep the old Visual studio project and put the new controls in or starting a new VS project altogether?
It depends on how much you are using the third party controls and what portion of your site it is. If it is a small portion it may be better to continue with the existing project. If you have very heavy usage of the third party controls that you are removing on each page a rewrite may be easier.
If you are looking at possibly rewriting using a new project you may also want to consider the technology that you are using as well. For example if you were using ASP.NET Web Forms before, maybe it would make sense to use ASP.NET MVC now.
I believe the best answer to your question is that you need to evaluate what you are using and the amount of work that each approach will require and determine what is best for your specific scenario.

Resharpening from the command line

I would like to use the ReSharper Adjust Namespaces feature on a number of solutions. I would like to automate this process by creating a command line application that uses the ReSharper API.
I looked at the ReSharper OpenAPI, but it seems to be geared towards using the ReSharper API from within an active Visual Studio session. I want to be able to use the ReSharper API from the command line.
Is this possible?
You are right: the open API is generally geared towards use within VS. While using it outside of VS is theoretically possible, it is technically challenging and may or may not work depending on your usage scenario.
There's no reason, however, why you shouldn't be able to adjust namespaces across several solutions right from within Visual Studio - of course, this would require to actually load each solution into the shell before performing manipulations. As things stand, this approach is your best bet.

Convert codeSnippet to Resharper Templates .Is there a utility for this?I

I love resharper it's fantastic. I wanted to post this in the resharper forum but for some reasons when creating an account it fails.Anyway back to my questions.
I have many codesnippets and I would like resharper to see them.Still today you are stuck apparently if you using resharper settings you cannot view them.
As anybody by anychance created an utility to convert them to resharper templates?
I dont know how to create live templates and even if I did i would have to create 100s of codesnippets manually which I am not going to do.
Any suggestions?
There's no such utility that I'm aware of although it shouldn't be too complicated to create one. I have created a feature request in ReSharper issue tracker to allow direct import of any VS snippets to live templates. Hoping it can be implemented one day.
It should be noted however that merely importing VS snippets to ReSharper templates is only a half of the story: VS snippets provide quite a poor choice of variables in templates whereas ReSharper exposes a rich set of macros which allow deploying templates in a more intelligent manner.

Does anyone have experience with modifying Sharepoint Applications?

I am currently working on a call log project. The boss wants me to use Sharepoint as a base, so I set up a virtual machine with an instance of MOSS 2007. I downloaded microsoft's call center template and installed it. I have been playing around with it for a little while now and it seems pretty simplistic. How can I modify this template (or extend it?) to suit my needs? I would also like to know how it works so if the need arises I could create my own application, so any help will be greatly appreciated here.
Thanks!
edit:
I am going to go out on a limb here and say that the aspx files I have found inside this folder:
C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\
have their code-behind already compiled so there will not be much I can do in terms of seeing how the application functions this way. Am I correct here?
I developed several sharepoint features and webparts. And yes, it's a real pain in the a**.
On your Sharepoint Server look at the Directory
C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\1033
There should be the masterpages and CSS Stylessheet you're looking to modify.
SharePoint development can have a steep learning curve and the product seem to fight against you. This is particularly if you're used to ASP.NET and are used to all the freedom that gives. It's quite a large and sometimes complex product with its own framework and way of doing things. That why I strongly recommend doing some serious reading in conjunction with going in and trying things out with existing applications. A few points:
Support
The primary reason is because you could easily end up with an unsupported installation if you change the file system without realising the impact. This will cause serious problems if it is necessary to install service packs or upgrade to a future version. There is usually a way to deploy updated code to SharePoint without needing to go down this path.
Getting results
Another reason is that unless you know what you are doing, hacking around with little knowledge will usually result in a lot of head bashing and few results. Errors can occur that make little sense or changes that you make won't take affect.
The SharePoint way
Finally, you will seriously waste time trying to get things to work if you don't know the 'SharePoint way' of doing something. Knowing 'the way' can save you so much time and integrate with the product nicely, but if you don't know about it prepare for pain! This includes topics from custom code through to CSS and master pages, through to deployment.
I hope this hasn't put you off as it is possible to enjoy the challenge the product provides and there is some very cool stuff you can do with it. For more reading there are several questions on Stack Overflow about getting started with SharePoint development (this is just one).
My experience with MOSS development has not been pretty. IMO, it is not built for application development or custom code. There are many other portals that fit that need well. For the built in collaboration tools, it is a great tool. Going beyond that, it fights you the whole way.
At least that has been my experience.
What Alex said!
Building a call centre application should be very possible with SharePoint. Personally I'm not a fan of the Microsoft templates but they may help giving you ideas on how to build something like that.
I don't know what your app is supposed to do exactly but by building a few web parts and leveraging the oob lists and workflow features you (or a somewhat experienced SharePoint developer) should be able to create something quickly.
You should not let people with negative experiences throw you off. Like it or not, SharePoint is going to stay and once you get over the learning curve it can be very effective as an application platform.
I can see how installing SharePoint can be a pain if you've got no clue what you are doing but it's a server application; a little learning should be expected.

Migrate from VS2005 to VS 2010 directly

Our project is currently developed in C#2 , VS2005.
We were thinking of migrating to VS2008 and C#3.
Do you think it might be a better idea to move directly to VS2010 instead?
We do not plan to release the new version till the end of next year.
Is there any advantage in moving from vs05 to vs08 and then moving to vs10?
thanks!
Well this post implies you can, but certain features of certain projects might get broken:
When you upgrade certain solutions from VS2005 to VS2010, the solution explorer layout can become broken. Some files move up the filter hierarchy. In our large solution, a hundred or so files ended up in the root of solution explorer.
It only seems to affect solutions where the solution explorer filter nesting is more than one deep, the files are not compiled (like headers), and they're excluded from the build in some configs.
Though an answer indicates it was fixed:
We have verified that the header file now gets placed under subfolder rather than directly the header filter. The fix should be available in the next public release of VS2010 (Beta2).
To answer your other point. One advantage of going via VS 2008 is that you can make that migration now (assuming you don't want to risk beta software) and start using the features of C# 3 straight away.
Visual Studio 2010 Beta 2 comes with a "Go-Live" license, so if you are ok dealing with beta software, then why not? I have tried it at work myself, while the other developers continue on 2008, but I have to be careful with the project files, to not check in changes, etc.... I don't use it all the time, yet, because it's a memory hog, but other than that performance is a lot better.
There are also a lot of features that are worth the upgrade. The text editor is in WPF now and scales nicely with a ctrl-click and I find I use it a lot. There are a lot of new addins being built to integrate with the UI because the new framework for the code editor exposes a new addin model that is much easier to develop against.
Being able to split windows across multiple montiors in a more flexible way is great.
If you go for the "Ultimate" versions, there are a ton of new architecture and modeling tools and tools for exploring code. I love the ability to generate a sequence diagram from some method and use that while I am reading some unfamiliar code. Works great.
The list goes on really, I have barely scratched the surface, so yeah move on if you want to learn how to use the new stuff, and no one is stopping you, go for it.

Resources