How to unload project in Xamarin? - xamarin

I can't find any method to unload project in Xamarin!
My solution was very big and some project can't loaded in Xamarin.
So I want to unload it,they are just some Test Project.

The only way I could find to do this is to leave the project in the solution but actually remove it from your build configuration.
Right click on your solution > Preferences > Genereal > Build > Configurations and un-check your project.
This way the project can stay on the solution but the compiler will not try to compile it.

Projects cannot be unloaded from a Xamarin solution.

The way I "unload" projects from Xamarin is to delete the .sln file from disk. This is a poor method but I think it works for your case since this is a test project.

Xamarin Studio 4.2.4 added this functionality.
Release notes:
Added new Project Unload command, which can be used to disable a project in a solution. To unload a project, right-click on the project in the solution pad and click on Unload. An unloaded project will remain disabled until it is explicitly loaded using the Reload command.
Source: http://docs.xamarin.com/releases/studio/xamarin.studio_4.2/xamarin.studio_4.2/

I'm not 100% sure what you mean by "unload," but you can remove a project from a Xamarin Studio project by right mouse clicking on the project in the solution explorer and select "Delete."
You should then be prompted on whether or not you want to "Delete from Disk," "Cancel," or "Remove." If you select "Remove," the project will be removed from your solution, but will still be left on your hard drive.
You can add the project back in at anytime by right mouse clicking on the solution and selecting "Add Project." If you point XS at the .csproj file it'll show back up in your solution.

I have found that going into the terminal and removing the project folder there like so
rm -rf /Projects/project_to_destory/
And then opening xamarin studios, click on the project you just deleted and it will ask if you want to remove the reference to the project and click yes. The project is now removed

In Visual Studio 2017 you can easily right click on the project and select Unload Project and you reload it by the same way.

Related

Visual Studio not running / debugging code anymore

I am using Visual Studio 2019 with .NET extension .
Everything was working fine, i.e all my C# codes and projects were executing fine on F5 when suddenly the options went dead . I am farely new to Visual Studio and cant seem to get my head around this problem . If anyone can suggest anything , it would be of great help.
Basically,
Go to project properties -> Build Tab. Then click Advanced button on the right bottom corner of the pane. Change "Debug Info:" to "full" and click OK.
If it is like that, then change it to "full" like below:
Visual Studio not running / debugging code anymore
Please try these suggestions:
Suggestions
unload your current project by right-click on your project-->Unload your project and then close VS Instance, enter your project path, delete .vs hidden folder, bin, obj folder and then restart your project again.
Then Upload the project, right-click on the project-->set as startup project to test.
reset VS settings by Tools-->Import and Export Settings-->Reset all settings
disable any other third party extensions under Extensions-->Manage Extensions
restart your VS and then rebuild your project
try to create a new empty default project and then test again whether the issue persists, if so, you should try to do a repair in VS Installer, if not, I think the issue is related to your project itself.
same issue in VisualStudio Code, with Dotnet5 API angular MVC application
for me it was the generated main.js file in wwwroot folder. deleted the folder and ran ng build --prod again and got a new one with current code.

Visual Studio .Net Target Framework Version is grayed out

I am using Visual Studio 2015 to open a C++ CLI project and I want it to target .NET 4.5. My installed .NET version is 4.7. But I cannot edit the project's target framework because it is grayed out.
I have tried to directly edit the project's file in notepad but I couldn't find where the target framework is defined.
Below is part of the screenshot of the .vcxproj file
To complete Hao Peng's answer.
Right click on project.
Select "Unload Project"
Right click on unloaded project.
Select "Edit *.vcxproj"
Modify the "TargetFrameworkVersion" tag from "v4.7" to "v4.5"
Save and close the file
Right click on unloaded project
Select "Reload Project"
This feels a bit hacky; nevertheless, it worked for me. I moved from 4.5.2 to 4.5. YMMV.
In Visual Studio, in Solution Explorer, select your project. On the menu bar, open the Project menu and choose Unload project. This unloads the project (.vcxproj) file for your project.
In my case, I had this issue, while doing migration from .netframework to .net core.
I have multiple projects in my solution, of which base project was created with output type as Class Library and Target framework is set to '.net5.0-windows' by a tool and the other projects are created as '.netstandard 2.0'. Though the dependent projects are configured correctly in .csproj, the option in the properties is grayed out.
However, when I changed base project targetframework to '.netstandard 2.0' then the Target framework has all installed '.netstandard' versions for rest of the projects.

Project Settings disappeared in Visual Studio 2013

Today I was add a new SETTING into the VS2013 Project´s Properties page (at Design Mode) and I see that ALL settings had disapeared! My Settings page is clean (the settings called through "my.settings.xxxx").
But, when I run the application in DEBUG or RELEASE mode the system functions normally - and I reference a lot of "my.settings" in there!
How can I solve it? I´m affraid of SYNCHRONIZE and clean the DEBUG/RELEASE files too!
Help me! Thanks!
I found a solution!
1- Go to Project Solution Explorer.
2- Click in the symbol to SHOW ALL FILES
3- At the My Project folder, simply delete the Settings file.
4- Go to the Project´s Properties page and select Settings.
5- In the middle of the screen will appear a message to Import Settings.
6- Done! VS had imported all the project settings (from where, I don´t know exactly).

Configuration With Same Name Already Exists

I have a solution with 10+ projects (VS2010 SP1). I have the following configurations defined in the solution:
Debug
Debug-QA
Release-UAT
Release-Production
This allows me to easily setup specific settings for each deployment scenario. However, for some reason I can't get things setup as I'd like. Please see this screenshot:
Notice the highlighted projects/configurations. I am unable to create a "Debug-QA" configuration for these projects (by selecting <New> in the cell for that particular project). When I try to add a new "Debug-QA" configuration to the DataUtility project, for instance, Visual Studio yells at me:
This configuration could not be created because a solution configuration of the same name already exists.
I know it does! I'm trying to add the configuration to the project! What am I missing here? I want all projects to have all 5 configuration. I have the same problem when trying to match up (create) platforms (for instance, adding an "Any CPU" platform to the DataUtility project).
Make sure you're using the drop down list from the grid (not the one at the top of the dialog), and do not check the "Create new solution configurations" checkbox when adding your new project configuration.
Here's a workaround if already checked the Create new solution configurations checkbox:
Open Explorer and navigate to the location of the solution for the project that is missing platforms.
Move the solution .sln file to a temorary location where Visual Studio won't locate it.
Open the .csproj file for the project that is missing platforms.
Click the Solutions Platform dropdown.
Click Configuration Manager...
In the table, Click the dropdown in the Platform column for the project and select , to add a new platform.
Click OK.
Repeat adding new platforms as needed.
Save the project.
Return the previously moved solution file back to where it was.
Reopen the combined project solution.
source: https://developercommunity.visualstudio.com/content/problem/972/adding-a-platform-when-one-with-the-same-name-alre.html
The above solution didn't quite work, but I did find a solution on a forum that worked. Described below is to set the builds to x64 for each project that was set to "Any CPU", but the steps would also work for x86.
Open the main solution. Unload each project with a conflict (not
remove).
Leave the solution open.
In Explorer, navigate to the
project folders and open the csproj file in Visual Studio.
In this
screwed up project, navigate to Build->Configuration Manager.
If
needed, "Add New" and set it to x64 and save.
Right-click the
project and set the build architecture to the new x64.
Save this,
but when you close the project in VS, do not save to the solution.
That's unnecessary.
Repeat for each project with a misaligned architecture.
Finally, in the original solution with all the offending projects,
reload each project.
Open the Build->Configuration Manager for the solution. Then, one by
one, reset "Any CPU" to the desired platform, in my case x64.
Save the changes for the solution and rebuild all. You should be OK,
now.

Why is TFS ignoring a project in my solution?

I have multiple projects in our solution that is in our TFS 2010 repository. I've added about 5 new projects to this solution in recent days.
I have found that for one of the projects, that the project file itself will not check-in to TFS. All of the artifacts contained in this project are working fine; they are checked in and I can see them in the Team Explorer. But I cannot see the project file in Team Explorer, nor is their an icon next to the project in Solution Explorer that would indicate its checked in status.
Also, clicking on any of the TFS related option in the context menu in Visual Studio results in those options being applied to the file contained in the project, not the actual project itself.
Can this be remedied or do I have to create an entirely new project and add all of the artifacts from the old project back into it?
Your project doesn't have appropriate Source Control Bindings! With the solution open, you'll need to go to File -> Source Control -> Change Source Control to view the bindings for your projects. The failing one probably will show an "Unknown" or not binded status. You can then use that dialog to correct the binding and check in the project file.
Appended Alternate Solution -
Navigate to the Team Explorer -> Source Control and manually add the files using the "Add Items to Folder" menu item.
You can try following steps
1 Unbind the project in "Change Source Control" dialog
2 Refresh project to update source control status
3 Right click the project and click Add the Project to source Control in solution explorer
I was faced with the same issue but the solution is slightly different than those mentioned so far. My project's contents were checked in but the project itself was not. The project's bindings were valid.
In the Team explorer's Source Code Explorer, the project files were greyed out. After a get-latest, TFS opened the Merge Conflicts screen where I could choose to keep the local copy.
After this, the project was part of TFS.

Resources