2 dev computers, 1 C# solution using TFS? - c#

I work on a team using TFS to manage a C# project. I have 2 development computers, a high end desktop and a laptop.
Ok, the TFS server is located many states away. The other developers are around the globe. I work out of my house. I really didn't think I needed to include this when I said "I am on a team"... Guess I was wrong. I also have no ability to make any changes to the TFS Server and no one outside of my office will change anything anywhere to help me do this.
I work on both. When I switch from one to the other, I have to remember to copy the files (which I often forget or don't have time to do).
I thought I could put the source files on OneDrive/DropBox and edit them there. It worked fine for one computer, but the other said:
"The solution appears to be under source control, but its binding information cannot be found. Because it is not possible to recover this missing information automatically, the projects whose bindings are missing will be treated as not under source control."
Any idea how I might fix this (doesn't anyone have ideas on this???) - or other ways I might solve this?
I just like the idea of working on my desktop, but being able to grab my laptop and run when I have to.
Links to existing answers are appreciated, but I couldn't figure out what to search on that addressed this (although I am sure it has been asked before.)
Thanks!

Trying to use a share for your local workspace is going to be something that runs into little quirks all along the way.
I would recommend using the Shelve feature. You would Shelve from one computer, then unshelve from the other. It basically takes your chosen changes and moves them onto the server such that you then can unshelve them onto the other computer. It is a way to save your changes to the server without checking them into the project. You have your own shelvesets that don't effect the main branch.

Alternative : Use Git
TFS : Map your project which is in TFS into any folder on your local. And check it in when you develop. And in other computer, press Get Latest button by clicking right click of your mouse to solution.
EDIT:
If you want to use TFS, go TFS Express without download or setup.

Why you need to copy the files instead of just use TFS checked in and get latest version?
This will guaranty you have the latest version of code on both machine without problem.
Please also checked in your projects and solution files into TFS, and you don't miss anything.
If you think it will affect others, you can have your own branch to working on.

The solution I have so far (not ideal, but works) is to use OneDrive (or DropBox - I just use OneDrive since it has more storage). On the laptop, I downloaded the entire project. All the TFS flags are set for the laptop, but the desktop can see them just as well. I can code on the desktop, and as long as I hit "save all" before I leave, I can race out the door with my laptop and work remotely, with all the current code.
The drawbacks of this approach are:
1) When I open the project on the desktop - it complains since all the TFS references are for the laptop. But only when I open it.
2) I have to use the laptop to get current and push changed files. Not a big deal.
3) I can't really work on both the laptop and the desktop at the same time - but don't really care since I don't need to and that wasn't the goal anyway.
The benefits:
1) I don't have to remember to copy from one location to another, check for changed files, etc.
2) As long as I have my laptop, I can work. No need to check in code, shelve code, or play any other silly games in order to keep them in sync.
3) I can race out last minute and always know I have all the code in whatever state it was in.
In the long run, I would still like a slightly better solution. I am guessing that I could tell OneDrive not to sync the TFS folders/files on each machine and then that would eliminate the message I get when I start on the desktop, but at this time, it's not worth the effort to figure out how to do this (although, if you know, feel free to comment.) But overall, I am now quite happy.
Fletcher
Since I always have my laptop when at the desktop, but the opposite is not true, this works for me.

Related

Building a UWP app coded in xamarin.forms in release mode results in Internal compiler error: Specified cast is not valid

I've something really annoying happening im my code.
I've built an app in Xamarin.Forms after battling for months with the framework just to find that when I'm now done, I cannot build my app in release mode to deploy it to the Store.
The app works well in debug mode, but does not build in release mode in the UWP project. I have been struggling to find a way to build my app in release mode for 5 days. but no matter which solution I see in all the forums and the stackoverflow questions I encounter, this error won't even blink.
The error which the IDE shows when I build the app in release mode is:
Internal compiler error: Specified cast is not valid.
It does not tell me anything more than that. The IDE doesn't give me any additional error message. I have struggled for days applying solutions I find to similar to this online, but nothing works.
I have updated IDE
Updated all packages
Deleted custom renderers on the UWP project
I went through every portion of code to find where I may have made a bad cast
I tried all I could find online, but nothing works.
I usually don't ask questions on forums unless it becomes critical.
If I don't get any solution, I'll be forced to delete this project and waste the months of coding I did, and abandon Xamarin for ever and move to Flutter which has a better reputation when it comes to tooling.
First of all, please don't fume so much. We understand you are frustrated, but Caps Lock just doesn't help to make us take it more seriously. Also I know Flutter is the new "cool guy in town", but it also has its set of issues. Cross-platform development is not simple and Flutter does support only two platforms, while Xamarin.Forms have a wider reach, which is bound to bring a bit more complexity.
My first suggestion would be to change the build output more verbose in Visual Studio Options, because that could uncover the actual issue here. When it comes to release mode, the problems usually come from types which are used for reflection but the compiler does not see as used and hence throws them away. Usually these errors show up at runtime however. In your case I would suggest a few following things:
First and foremost - try to delete bin and obj folders in your project. That might help, as they sometimes get cluttered with older libraries and create conflicts.
If you have been building with a source control like Git (I hope you did), I would suggest going back to some early commits and then try to build release mode there. If the project builds, jump forward to some newer commit and try again. If it does not, try an even earlier commit. The goal of this is to pinpoint when in time was the error introduced, which should significantly help you in searching where the problem comes from.
If you didn't use any source control - first remember to do so next time. However, this time you will have to do it "the old way". Create a new project and slowly as little code from the original project, trying to do release build at each step. Hopefully this will allow you to find the culprit code and then you will be able to fix it in the original project
You can definitely post your findings here and we will be happy to help you further - like pinpointing the actual problem in the code file once you narrow it down.
I suspect your problem is coming from auto-generated XAML, so definitely make sure to focus on the .xaml files adding them one by one.

Visual Studio 2017 C#: How to create an Installer that can provide continuous updates

I've been trying to find an answer to this for weeks. Hopefully you are able to help me out! :)
I've got a C# application. It has multiple classes and multiple Forms. The forms also have images on them in PictureBoxes.
These images are all stored in an Assets folder inside the bin folder i.e. /bin/Assets.
When developing, I run the application in Debug mode.
I have looked on YouTube and all areas of the internet to find how to create an installer for my application. I see a majority of posts about ClickOnce deployment, which looks like it's what I want. The issue is that the ClickOnce wizard asks you where to install the application:
I do not have a server to host the application on (I have tried examples I've seen such as \localhost\myfolder\myApplication) I do, however, run my own website through a NameCheap host where I could provide a link to the application for users to download. I'm not quite sure how to set this up though.
I do not want the users to install from a CD
I don't know how to do the File Share method
This is the first obstacle. Regardless of what I choose, I cannot get the setup to work. I think the big issue is that I can't find how to include my Assets in the project and I don't know where to install the application.
The next obstacle, is that when users download my application, I would like to be able to push out an update, and have them have the update automatically (or only need to restart the application to get the update). I do not want them to have to re-download the application every time there is an update, as there are updates several times per week.
Again, I believe ClickOnce handles this but since I cannot even get to this step, I am not sure.
So, in the end, this is the use-case:
User is able to download the application from a website. Once application is downloaded, all further updates to the application are pushed automatically or only require a restart of the application to obtain.
I have gone through all the documentation on ClickOnce as well. Specifically this link. My issue is on #4.
I hope you are able to help, thank you!
Sharing the installer should not be an issue you could simply do that through Dropbox.
You can host your Updater on Dropbox as well but anytime you have new Updater replace the old one so the web link remains same and that it is because you need to know the the Updater link in advance to put it in the original installer.
You mentioned that you have a website through NameCheap, I believe you could use that instead of Dropbox here is a youtube links that might help.
https://www.youtube.com/watch?v=PEXcWln2Fe8
https://www.youtube.com/watch?v=rUNQphoGVwQ
I personally don't use ClickOnce but I use A Microsoft Windows Installer and I develop my own updater. ClickOnce is easier use for you at this point but later in future, you could explore other ways.
Wish my answer is clear if not just let me know,
Good luck

Broken ASP.NET UI

I am developing an ASP.NET MVC 5 application for a while now.
After an update that changed a lot the database structure, the UI has gone crazy. I think this is a IIS issue since it is only on the client's machine and I am not able to replicate it, but I don't know where to start looking for it.
I have tried to restart everything, but with no resolve.
This is going on for days and I am out of ideas.
As it can be seen in the picture, the CSS is not working correctly, the pictures are not showing and the Resource data (for switching the language) is crazy.
I don't know if the update did something or not, but it shouldn't since I changed the models and controllers only. I did delete some screens, but this shouldn't impact.
If I deploy it on a fresh machine there is no problem.
I know this question is really ambiguous, but I have looked into the cshtml files are I could't find errors and I do not know what info / code to give. I can update if someone can help.
Update:
Thank you for all your responses. Sorry for my late one. I didn't expect answers so fast. Here is how it looks on mine:
The bigger problem is that I do not have access to their server. I am working with somebody else on the phone and they send me pictures.
UPDATE 2:
It didn't work with CTRL+F5 and clearing browsing history (I didn't thought about this since it is the same on two laptops they are using to access the app). They are not allowed to install other browsers than Mozilla and Internet Explorer. They are using Mozilla by default. Opening the app in Internet Explorer improved the situation. The Resource works and the CSS is improved, but the pictures still aren't showing.
This is how it looks on IE:
They use a laptop as a server and access the app on 2 other. It is a temporary solution until a server will be bought.

Visual Studio 2008 C#: Auto-Increment Version numbers

From what I'm seeing online, it seems the only thing in VS that auto-increments the Version numbers is if it's a website. For applications, it seems you either manually have to do it or you have to have a post build event and call a function or small app to do it for you. But, that's only what I'm seeing when I google it and when I've tried messing around with it myself. My questions are:
Can an application auto-increment the version number on a successful build without having to do the afore mentioned? Like a checkbox hidden deep in VS or something?
If no, is there a way to Publish an application rather than it being published as a website?
If it can, is that even the write way to go?
I know I've seen some instances where you can use the install package to increment the number, but my boss would like to start seeing how many times we build the applications so he can show to our customer the work being put into the application. If anyone can help me, that'd be great. Hope you all are having a good day. Thanks.
my boss would like to start seeing how many times we build the applications so he can show to our customer the work being put into the application.
Why not just publish your change logs and/or bug/feature database?

C# 2010: Deploying Multiple Apps..Need Sure Fire Way To Update

For starters I have whored myself out to the Internet in general as far as search is concerned. Got nowhere and am pretty Google proficient. Maybe I missed something..Enough of that.
As mentioned above C# 2010 (3.5->4.0 running on Win7x64 but would like the app to be fully compatible with XP/Vista). Dealing with XP(w/SP3) to Vista/7 clients. Working on an app that will allow my company to more easily connect to their local desktops via RDP. My app is awesome as far a usability, but eventually, my programming will catch up to me, bend me over, and do me hard.
I am looking for a sure-fire way to update the main app. I am deploying a secondary app to pull this off (app downloads updateApp from developer website if xml file has newer version, updaterApp updates main app; main app updates the updaterApp--if needed).
Looking for reinforcement or better ways to accomplish this as the app depends on admins + (possible) SQL + AD + SMB + SSH auth.
Things I have run into:
http://themech.net/2008/09/check-for-updates-how-to-download-and-install-a-new-version-of-your-csharp-application/ (at this point, what I like)
http://digitalformula.net/technical/c-self-updating-application-without-clickonce/
http://www.eggheadcafe.com/articles/pfc/selfupdater.asp
So that's what I am looking at. Would love to find the right solution with details/great code/examples. I am MOST WORRIED about admin access in Vista/7 on the 'Program Files' directory look forward to the discussion. Hope all of the info is here. Thank you so much in advance!
What about clickonce?
I read good and bad things about ClickOnce. One of these days I will sit down and figure out how it works. For now I went with update code inside the main application. Its pretty kewl. It starts a new thread to download and run the MSI package. I found it here.
http://themech.net/2008/09/check-for-updates-how-to-download-and-install-a-new-version-of-your-csharp-application/
Hope that helps someone looking to spin your own. I liked this approach because I did not have to create a second program.
Use clickonce
.net has this built in, we use it for our LOB apps, works fine.

Categories