Here, the folder contains two files through which I can access the code of the project in visual studio: Program.cs & ProgrammingAssignment3.csproj
When I open the Program.cs file there is no Solution Explorer, which helps in accessing different custom classes.
Even if I tried adding it from the View window:
It doesn't show anything inside it.
I also tried Tools < Options < Projects and Solutions but there's no changes.
But here when I open this .csproj file:
The solution explorer is shown and also the classes.
But unfortunately, as I need program.cs file for my work, I can't use the .csproj file. And this not just for this project but every other too. Please tell me how should I get appear the Solution explorer in the program.cs file so that I can write code easily by accessing the classes. I don't mean I've problem with the .csproj file, I want the solution explorer to get running in program.cs file.
The class (.cs) is in your project (.csproj), and the project is always in a solution (.sln). The solution isn't accessible when its part of your Unity project.
If you open the project file directly from the file explorer you can edit the class program.cs from there.
You could also open the script from Unity itself and it brings you there too.
check if you multiple installation for VS
go to environment varaible and remove if you have duplicate entiries of old one
follow below steps:
tool Menu-->Import Export Setting--> Reset All setting --> Next ---> No Just reset my setting --> Next--> general development setting --> finish
it should fix the issue
Related
So basically I'm trying to create a simple console application. However, whenever I create one instead of seeing the usual run button I am instead greeted to a button that says attach so I read through forum after forum and I found out that I need an OBJ and a Bin folder. So I looked through my solution and found that I have no bin or obj folder created. So I tried to make a new solution however in this new solution again there is no bin or obj folder. I honestly don't know what to do anymore. Here are some images:
Make sure you are actually creating a solution in Visual Studio. The straightforward way to do that is to use File / New / Project... in the menu. Then you will likely have a dialog box, and there you need to find Console Application - C#. Then type your project and solution name - it's ok if they're the same name. Then save. That's all.
Do not use the menu to open Program.cs or other files in your solution, once your solution is created. Use the Solution Explorer, and click on the file you want to see. If you don't see the Solution Explorer, use View / Solution Explorer in the menu.
Later, when you want to reopen your solution, use File / Open / Project/Solution... in the menu, and open your solution file, whose name ends with .sln Or even easier, look in File / Recent Projects and Solutions.
You will likely want to add more source files to your projects very soon, so I'll tell you how to do that too. In the Solution Explorer, right click on the project (not the solution), and in the popup menu, point at Add and then New Item... to get a dialog, then choose Class - C#. Type the name of the file while keeping the extension .cs, and then Add it.
The process should look something like this:
It's probably likely that there is an issue with dotnet on your path variable. Go to your system variables and add C:\Program Files\dotnet\ to path. It should fix the issue if you had the same problem as me.
You may have been building a console app that can run on .NET Core and you just don't have the NuGet packages installed. Then you need to either install the appropriate packages or create a console application (.Net Framework)
I have developed an C#, ASP.NET web application in a Windows 7 machine using Visual Studio 2012. Now i had imported the entire project into VS 2017 running on windows 10 machine, and when i try to enter the debugging mode to analyze my code it shows the following error:
I guess the project configurations are conflicting hence it throws this error.
Any suggestions??
The same error happens when Visual Studio solution has selected the wrong Startup Project. The bold project is the designated startup project.
Go to the Solution Explorer > Right click on the correct project and select "Set as StartUp Project" in the context menu.
I also got this error. I ultimately got to know that I was not selecting .sln file.
In VS, you should select .sln file and it automatically loads the complete project structrue is what I learnt.
Selecting .sln file worked for me
These errors are mostly because you are not selecting the .sln or solution file. In your solution explorer tree, double click the solution file and then build and run.
This runs contrary to a users intuition that simply opening a file and running it would work. Consider it a poor user interface. Jet Brains Rider, for instance, does not have this issue.
Change Targeting Platforms with the Configuration Manager and Build the project then try to debug it.I hope this will help you.
Don't export the project folder. upload the .sln file.
It will work.
DLLs cannot be ran/debugged directly. You have to specify host application in the
Configuration Properties>Debugging>Command and then let it load the DLL by itself.
You will most likely need to copy the DLL to the directory searchable by the host application e.g. its root or ./plugins folder.
In the Configuration Properties>Build Events>Post-Build Event>Command Line simply enter something like:
copy "$(TargetPath)" "$(HOST_APP)\plugins"
The Startup Item needs to be a .exe file. It's looking at BusinessLayer.dll because BusinessLayer is currently the Startup Project.
First, build the solution. Then, set the Solution Explorer to folder view and find the .exe in one of you project's /bin folders. Right click on it and set it to the Startup Item.
Finally, click the play button in Visual Studio top bar.
EDIT: Basically the same as Thomas' answer, but I'm pointing out that the "correct project" is the one with the .exe file. I would have commented on his answer, but I have less than 50 rep right now.
I recently started using Git with Visual Studio 2015 and I'm trying to modify the properties of an installer project. The issue is that it won't let me because the project isn't checked out and I don't see an option to check out the project with Git through Visual Studio. The only place I even see the mention of the words 'Check Out' is under branches and it's grayed out.
I'm having the same problem in VS2015. It seems to be an issue with the Installer Project extension. For some reason Visual Studio doesn't detect when you attempt to change the Setup Project file (with YourProject.vdproj), and doesn't automatically unlock it for you. I had the same problem with TFS, but in that case all you had to do is manually unlock the file, by right clicking on it. I've just migrated to Git, and the problem is still there, but now you can't unlock the file by right-clicking on it (since there is no explicit check-out in git).
I'm still looking into the problem, but the only solution I've come up with now, is making a quick manual edit of YourProject.vdproj in Notepad. Visual Studio WILL recognize that edit, and unlock the file for you. After that you can continue to use IDE to make changes to the Installer project.
Unfortunately, the problem comes back once you check in your changes, and try to modify the file again. You will once more have to manually edit it to force Visual Studio to unlock it for you.
EDIT: After spending a few hours on this, I finally came up with a proper fix, which I verified works on a few in-house projects. Here are the steps:
Open your solution file in notepad, and delete the following section: GlobalSection(TeamFoundationVersionControl)
Open the solution containing locked Setup Project in Visual Studio.
Go to Tools > Options > Source Control > Plug-in Selection, and pick 'None' from the dropdown.
Click Yes to the dialog that warns you the project will be closed.
Open the solution again, you will be prompted to permanently remove
source control bindings from the projects. Click Yes to that.
You can now go back to Tools > Options > Source Control > Plug-in
Selection and pick Git again.
At this point the problem is fixed, and you will be able to modify
your Setup Project without any issues.
I found that removing bindings is clearing the values of the following tags from the project files:
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
Apparently SAK stands for 'Should Already Know'.
Here is a workaround I found,
Mark the project installer in the Solution explorer, And click "Save" (not save all).
For me it did the trick.
If it's still didn't help try to reopen VS and try the method again.
Cheers!
Open a command line, go to where you need to check it out, then issue the git checkout command? http://git-scm.com/docs/git-checkout
Like Eternal21 I encountered this problem when trying to modify an Installer project, this was in a VS2013 (rather than VS2015) project though and I could not see a GlobalSection(TeamFoundationVersionControl) in the solution file. However the following steps worked;
Go to Tools > Options > Source Control > Plug-in Selection, and pick 'None' from the dropdown.
Make the change required to the Installer project
Go back to Tools > Options > Source Control > Plug-in Selection and select Git again.
(and the Solution did not ask to be closed).
You need to create a new empty repo on your Git server first, then clone it to a folder on your local computer.
After that you will be able to add your project and check it in by adding it to the local folder.
I was able to work around this problem by simply editing the vdproj file (setup project file) manually in Notepad++ (you can use any text editor), making some temporary changes into it (type a character and backspace) and saving the file. This effectively checks out the project from GIT. Now you can come back to Visual Studio and make whatever changes you want.
I was able to use dotNETs suggestions and edit the vdproj file. Simply adding a character and removing didn't work, but making an actual edit did. Doing so triggered the check out for GIT. In my case I was attempting to change one of the Detected Dependencies exclude property to false and was able to do so while editing the vdproj file. Once I saved it then reopened Visual Studio the check was displayed on my installer and the change was already applied. I was able to make additional changes while checked out.
Once finished and I checked it in, I could no longer edit and needed to manually edit the file again to check out.
Or maybe access it's data via reflection somehow ?
Thanks
EDIT: I'd like to know if there's a way to do it without reading it as an XML.
Like a ms library that supports it, so it'll work for any kind of project and any kind of vs version (2005, 2008, 2010 ... ).
The *.csproj file is really just an XML file. You can open it just like any other XML file and treat it as such as well. Realize that any changes made to it, though, will require reloading the project.
Also, remember, there is no *.csproj file once the application is compiled/deployed.
Yes, you can open it in a text editor, or from Visual Studio
Right click on a project
Unload Project
Right click on the unloaded project
Edit project
Right clicking the project and selecting the properties option gives you a GUI to change some of the settings in the project file. Also, when you right click a file and change it's properties it causes a change in the project file. If you want to do anything very serious, like add custom build steps, you have to do it by hand in a text editor like notepad++. It's just an XML file. If you're familiar with MSBuild the proj file has many similarities to a build script for MSBuild.
I have a project which is under source control via Star Team in VS 2008. I added another project to my solution for an installer, configured it, tested it, etc. Now, when I go to check in my solution with the new installer, I get the following warning:
The project that you are attempting to add to source control may cause other source control users to have difficulty opening this solution or getting newer versions of it. To avoid this problem, add the project from a location below the binding root of the other source controlled projects in the solution.
There are with options to Continue or Cancel.
My project directory looks like this:
/Proj1/
Proj1.sln
/Proj1/
.cs files
.csproj
/bin/, etc
/Proj1_Installer/
Proj1_Installer.vdproj
/Debug/
/Release/
Is there something fundamental I'm missing?
The files for the new solution should be in the same location as the projects you already have from source control. For example if you have existing code from source control
Source\
Project1\
program.cs
Proejct2\
program.cs
then you need to put your new project in the same folder and project1 and project2
Source\
Project1\
program.cs
Proejct2\
program.cs
NewProject\
"add the project from a location below the binding root of the other source controlled projects in the solution" If you decide to add it to the "MyProjects" folder on your drive, then others won't be able to get it from source control.
I suggest if this is how your physical folder structure actually is, verify the solution file using notepad and check the paths. Maybe it's referencing it using
..\..\Path1\Path2
instead of
.\Path2
My problem was that my debug and resource folders were being put into source control. Visual studio wants to generate these every time the project runs, so they shouldn't be placed in SC.