locked
Visual Studio ASP.NET Web Forms Site and GitHub RRS feed

  • Question

  • User2131847472 posted

    Hi, I have a project to do that require me to push my ASP.NET Web Forms Site to GitHub but right now I am having some problem. I use a .gitignore that takes out /bin and /packages from the project because from what I understand it's not needed. When I commit to Git I commit The "Websites" file that is only missing the /bin and the "Projects" file that only contain a ".vs" file and a "*.sln". When I checkout that branch on an other computer the nuget are all dead and there is no reference anymore. Am I doing something wrong? I can restore the nuget but I get a ton of error to some things missing like "optimization" and other thing like that.

    Friday, June 23, 2017 12:40 AM

All replies

  • User1967761114 posted

    Hi Sl-lAD0W,

    According to your description, in default, the folder packages and bin won’t commit.

    You said there seems lost files, I suggest you could run the following command before commit.

    git add -a

    When others pull the code, there will no packages and bin, VS will auto restore them when compile.

    If you still has error, could you give the GitHub Address to me, I will try it.

    I also suggest you could use the default .gitignore file, see the following content.

    ## Ignore Visual Studio temporary files, build results, and
    ## files generated by popular Visual Studio add-ons.
    
    # User-specific files
    *.suo
    *.user
    *.userosscache
    *.sln.docstates
    
    # User-specific files (MonoDevelop/Xamarin Studio)
    *.userprefs
    
    # Build results
    [Dd]ebug/
    [Dd]ebugPublic/
    [Rr]elease/
    [Rr]eleases/
    x64/
    x86/
    bld/
    [Bb]in/
    [Oo]bj/
    [Ll]og/
    
    # Visual Studio 2015 cache/options directory
    .vs/
    # Uncomment if you have tasks that create the project's static files in wwwroot
    #wwwroot/
    
    # MSTest test Results
    [Tt]est[Rr]esult*/
    [Bb]uild[Ll]og.*
    
    # NUNIT
    *.VisualState.xml
    TestResult.xml
    
    # Build Results of an ATL Project
    [Dd]ebugPS/
    [Rr]eleasePS/
    dlldata.c
    
    # DNX
    project.lock.json
    project.fragment.lock.json
    artifacts/
    
    *_i.c
    *_p.c
    *_i.h
    *.ilk
    *.meta
    *.obj
    *.pch
    *.pdb
    *.pgc
    *.pgd
    *.rsp
    *.sbr
    *.tlb
    *.tli
    *.tlh
    *.tmp
    *.tmp_proj
    *.log
    *.vspscc
    *.vssscc
    .builds
    *.pidb
    *.svclog
    *.scc
    
    # Chutzpah Test files
    _Chutzpah*
    
    # Visual C++ cache files
    ipch/
    *.aps
    *.ncb
    *.opendb
    *.opensdf
    *.sdf
    *.cachefile
    *.VC.db
    *.VC.VC.opendb
    
    # Visual Studio profiler
    *.psess
    *.vsp
    *.vspx
    *.sap
    
    # TFS 2012 Local Workspace
    $tf/
    
    # Guidance Automation Toolkit
    *.gpState
    
    # ReSharper is a .NET coding add-in
    _ReSharper*/
    *.[Rr]e[Ss]harper
    *.DotSettings.user
    
    # JustCode is a .NET coding add-in
    .JustCode
    
    # TeamCity is a build add-in
    _TeamCity*
    
    # DotCover is a Code Coverage Tool
    *.dotCover
    
    # NCrunch
    _NCrunch_*
    .*crunch*.local.xml
    nCrunchTemp_*
    
    # MightyMoose
    *.mm.*
    AutoTest.Net/
    
    # Web workbench (sass)
    .sass-cache/
    
    # Installshield output folder
    [Ee]xpress/
    
    # DocProject is a documentation generator add-in
    DocProject/buildhelp/
    DocProject/Help/*.HxT
    DocProject/Help/*.HxC
    DocProject/Help/*.hhc
    DocProject/Help/*.hhk
    DocProject/Help/*.hhp
    DocProject/Help/Html2
    DocProject/Help/html
    
    # Click-Once directory
    publish/
    
    # Publish Web Output
    *.[Pp]ublish.xml
    *.azurePubxml
    # TODO: Comment the next line if you want to checkin your web deploy settings
    # but database connection strings (with potential passwords) will be unencrypted
    #*.pubxml
    *.publishproj
    
    # Microsoft Azure Web App publish settings. Comment the next line if you want to
    # checkin your Azure Web App publish settings, but sensitive information contained
    # in these scripts will be unencrypted
    PublishScripts/
    
    # NuGet Packages
    *.nupkg
    # The packages folder can be ignored because of Package Restore
    **/packages/*
    # except build/, which is used as an MSBuild target.
    !**/packages/build/
    # Uncomment if necessary however generally it will be regenerated when needed
    #!**/packages/repositories.config
    # NuGet v3's project.json files produces more ignoreable files
    *.nuget.props
    *.nuget.targets
    
    # Microsoft Azure Build Output
    csx/
    *.build.csdef
    
    # Microsoft Azure Emulator
    ecf/
    rcf/
    
    # Windows Store app package directories and files
    AppPackages/
    BundleArtifacts/
    Package.StoreAssociation.xml
    _pkginfo.txt
    
    # Visual Studio cache files
    # files ending in .cache can be ignored
    *.[Cc]ache
    # but keep track of directories ending in .cache
    !*.[Cc]ache/
    
    # Others
    ClientBin/
    ~$*
    *~
    *.dbmdl
    *.dbproj.schemaview
    *.jfm
    *.pfx
    *.publishsettings
    node_modules/
    orleans.codegen.cs
    
    # Since there are multiple workflows, uncomment next line to ignore bower_components
    # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
    #bower_components/
    
    # RIA/Silverlight projects
    Generated_Code/
    
    # Backup & report files from converting an old project file
    # to a newer Visual Studio version. Backup files are not needed,
    # because we have git ;-)
    _UpgradeReport_Files/
    Backup*/
    UpgradeLog*.XML
    UpgradeLog*.htm
    
    # SQL Server files
    *.mdf
    *.ldf
    
    # Business Intelligence projects
    *.rdl.data
    *.bim.layout
    *.bim_*.settings
    
    # Microsoft Fakes
    FakesAssemblies/
    
    # GhostDoc plugin setting file
    *.GhostDoc.xml
    
    # Node.js Tools for Visual Studio
    .ntvs_analysis.dat
    
    # Visual Studio 6 build log
    *.plg
    
    # Visual Studio 6 workspace options file
    *.opt
    
    # Visual Studio LightSwitch build output
    **/*.HTMLClient/GeneratedArtifacts
    **/*.DesktopClient/GeneratedArtifacts
    **/*.DesktopClient/ModelManifest.xml
    **/*.Server/GeneratedArtifacts
    **/*.Server/ModelManifest.xml
    _Pvt_Extensions
    
    # Paket dependency manager
    .paket/paket.exe
    paket-files/
    
    # FAKE - F# Make
    .fake/
    
    # JetBrains Rider
    .idea/
    *.sln.iml
    
    # CodeRush
    .cr/
    
    # Python Tools for Visual Studio (PTVS)
    __pycache__/
    *.pyc

     

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    Friday, June 23, 2017 1:45 AM
  • User2131847472 posted

    Thanks for the quick answer. So here are the step I did.
    1-Created a ASP.NET Web Forms Site.
    2-Took the "Projects" folder and the "Websites" folderthat only contain the site that I created. 
    3-Took the gitignore file you gave me in your answer and put it in the same folder as the other 2 folder
    4-Commited and pushed those things to git. So on my github interface I see 2 folder and 1 gitignore file on my commit.
    5-Downloaded that project
    6-Unzip it
    7-Open Visual studio 2017 and use the open project/solution option
    8-Get the ".sln" file that is in the "Projects" folder
    9-I get that error on build : 

    Severity Code Description Project File Line Suppression State
    Error The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" could not be located. C:\Users\Simon\Desktop\GRYB-PFE-Simon\GRYB-PFE-Simon\WebSites\GRYB_Admin\Web.config 118

    10-I can get that error to go away by installaling that Nuget but then there is like 20 error that comes up for the other Nuget.

    Is there something I don't understand?

    Friday, June 23, 2017 2:13 AM
  • User1967761114 posted

    Hi  Sl-lAD0W,

    According to your description, that’s so hard to give your correct suggestion.

    You said there still has 20 more errors, might there still missing some assemblies with your project, I’m unsure why.

     

    If you have any other questions, please feel free to contact me any time.

    Best Regards

    Even

    Friday, June 23, 2017 5:15 AM
  • User2131847472 posted

    Here is the result of what I am downloading from GitHub. https://ufile.io/oxgmq ; I tried with packages and without but the only way I got it to kinda work was with the /bin in the git repo. If you want to download the file and try to import it. It's the zip I downloaded from my Git repo.

    Thanks again.

    Sunday, June 25, 2017 7:53 PM
  • User991499041 posted

    Hi SI-IAD0W,

    I'm not sure why this doesn't work for you. In case it helps, here's a typical .gitignore file.

    *.suo
    *.user
    _ReSharper.*
    bin
    obj
    packages

    Here's a pretty comprehensive example from github:

    https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

    Regards,

    zxj

    Thursday, June 29, 2017 7:04 AM