1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Visual Studio 2012

Discussion in '3rd Party Support' started by sec_goat, Aug 30, 2013.

  1. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    I am having a couple issues using VS 2012 with the ServUO project.
    First of all it will start telling me I have duplicates of files in all my folders. So far If I remove the folders and re-add them to the project this fixes the duplication, but this is a long and tedious fix.

    Next it appears that on occasion VS 2012 will truncate some of y CS files. Everything will be running smoothly then all of a sudden files will start telling me they expect ; and }. when I go look at these error locations, it appears half the cs file is missing. These are files that i have not touched and if i look at previous versions of the file they are fin and in tact.

    Any ideas?
     
  2. GameSage
    Offline

    GameSage New Member

    Joined:
    Mar 15, 2013
    Messages:
    23
    Likes Received:
    5
    Have you tried cloning from the repo and testing with a fresh setup? I have not ran into any issue like the one you're having but it almost sounds like your repo is incomplete for some reason.
     
  3. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    Turns out that I did add some incomplete files and just didn't notice. But i still have phantom duplicates!
     
  4. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Next time you get duplicates, try closing VS and open the solution again. Tell me if it still shows them. Pretty odd issue. :/
     
  5. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    Yep., duplicates still. It is looking like a git issue maybe merging the csproj files incorrectly and making duplicate entries. Still looking into this a little further to see if I can pinpoint it and stop it from happening.
     
  6. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Are you using a git addon for VS? How are you using git on windows?
     
  7. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    Git bash. I've been using git for a couple years this way and all as been fine.
    Wierd thing is I never had this problem until I started using VS 2012.
     
  8. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    What files are being duplicated? Ones that are currently open?
     
  9. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    It's hard to tell, on my laptop only the new files I added are duplicated, when I pull to my desktop it looks like everything is duplicated.
     

    Attached Files:

  10. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Ah, so it's doing this after you commit/push/pull. You should revert the changes to your solution file. I believe we have it locked in the ServUO repo. We use a universal solution file that includes all source files within a directory. Sounds like VS is adding it's own entries for new files you add from within VS. Thus the solution is loading the file into the solution once because it's within the directory, and again because the new entry VS added. Compare the solution files and you'll see what I mean.
     
  11. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    Indeed! so the original csproj file only has

    Code (C#):
    1. <ItemGroup>
    2.     <Compile Include=".\**\*.cs" />
    3.   </ItemGroup>
    4.   <ItemGroup>
    5.     <Content Include=".\**\*.txt" />
    6.   </ItemGroup>
    However my csproj has like 4k lines of entries for specific file names.
    How do I make it so that it does not change? should I rectify the issue then remove the csproj from git tracking? You said you had your locked down some how?
     
  12. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Yeah, you could remove it from being tracked by git. Or simply avoid committing changes to that file. I don't believe git supports file locking. If you revert the file, does it fix your issue?
     
  13. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    Indeed it does!

    So if I take git tracking out of the equation how do I get VS2012 to stop adding files to the csproj file? or do I just need to re-write the csproj file evertime?
     
  14. sec_goat
    Offline

    sec_goat Member

    Joined:
    Aug 26, 2013
    Messages:
    110
    Likes Received:
    14
    OK I have this thing solved, it's just a workflow issue:

    I am used to adding and removing files directly inside the project in Visual Studios. I am not sure if this is strictly a VS2012 thing, but as ong as I add and remove files and an OS level instead of a VS level everything remains copacetic.

    Thanks for your help Insanity!
     
  15. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    Not a VS issues. It's an issue related to the special solution file we use. It's made to read everything, instead of include each and ever file. This allows one to drop a new system in, open the solution; and the system be there in the project.

    Your solution works, unless you're creating a new class. You'll still have to roll back changes that VS will do to the solution.

    Honestly, VS shouldn't add the same file (same path and all) twice to the same project. Not sure why it even allows it...
     
Similar Threads: Visual Studio
Forum Title Date
General Discussion Visual Studio 2013 quit working... Mar 17, 2016
Tutorials HOW TO: Run a ServUO Server and View / Edit with Visual Studio Sep 11, 2015
3rd Party Applications Visual Studio Code Jun 22, 2015
3rd Party Discussions Visual Studio Community 2015 FREE(no joke) Nov 13, 2014
Windows Support Errors Visual Studio 2013 Apr 7, 2014
General Discussion Visual Studio Apr 3, 2014
3rd Party Applications use Visual Studio Express 2013 for Windows Mar 20, 2014