It seems Visual Studio doesn't recognize .NET Core global.json which list src and test as the projects in the solution. Without the famous .sln file, each project in the solution can be opened individually by opening associated project.json. Is there a way to open a solution which load the two projects?
Related
I have upgraded Visual Studio 2022 from 17.1.4 to 17.1.5.
When I open the solution, the main project (ASP.NET Core) remains unloaded. When I try to load the project I get the following error:
The expression "[System.IO.Path]::Combine(C:\pathtoproject, \net6.0)" cannot be evaluated. Illegal characters in path. C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets
How can I solve this problem?
Try to delete all files in "/Bin" and "/Оbj" folders across Solution. Also do a "Clean solution" before build.
Download .NET SDK (6.0) and make repair. After restart your PC
.NET SDK LINK
Right click on Solution, there you will find an option for "Load All Projects", click on that option and it will load all the projects, you can also unload the project by clicking on "Unload the projects"
How do I open I a Visual Studio Code folder in Visual Studio 2015?
If I open it as a "Web Site", it tries to treat the node_modules directory as part of the project's normal JavaScript files and hits an error when the path exceed the maximum path length.
But I can't open it as any other project type unless I first create a project of that type and then move all the VS Code files into that folder.
Should I be trying to open it as a web site?
Or should I create a new project and then copy the files + folders into it?
Is there any advantage to having it as a project?
If I do create a project, it makes it difficult to work together with someone who is just using VS Code?
And if I use a project, which project type should I select?
Finally folder view has arrived in VS 2017 :)
You can find more details in here.
Currently there is no way to open a folder directly with Visual Studio.
Why? Because Visual Studio and Visual Studio Code only shared their name, not the idea behind it. To extend Jenny O'Reilly answer:
Visual Studio Code is a folder oriented editor
This means VSC has the same Point-of-View to your Project as the File Explorer.
Visual Studio (not Code) is a solution oriented integrated development environment (short IDE)
Instead every Project in Visual Studio needs a *.sln Solution-File as Root Component. From this point Visual Studio looks at your Project. An example would, if you copy File in your Project Folder, they wouldn't be recognized from Visual Studio. You have to add them first to your sln File, to see them. It also allows the developer to combine multiple projects (*.csproj,..) into one single Solution to build.
This means the idea behind these two editors is completely different.
Visual Studio (not code) Project-types for Web
There are Node.js Tools for Visual Studio
This will provide Node.js built-in project templates
Visual Studio 2015 comes with TypeScript templates
Workaround 1
A workaround would be a Blank Solution in which you set up your Visual Studio Code Project.
Workaround 2
Another trick would be the answer to this question. You can open your Project Folder as a Website Project.
File -> Open Website -> File System and choose the folder
Update
As you mentioned, there will be errors because Visual Studio tries to build the solutions. For the next few readers of this response, the work around for this (as John Pankowicz writes in the comment) is:
Right-click Web Site in Solution Explorer -> Property Pages -> Build -> Uncheck "Build Web Site as part of solution"
Update 2
(Thanks to JC1001 for this update)
The next version of Visual Studio (Visual Studio "15") will support opening a folder. This is mentioned in the Visual Studio Blog.
Also like in Visual Studio Code, there will be a prompt command for opening Folders. Right now you can use this in the preview version:
devenv /command “file.openfolder FOLDER_PATH”
In the future you will be able to use:
devenv FOLDER_PATH
Opinion
Personally I wouldn't recommend Visual Studio (not code) for HTML/Website projects without server-side-development, because I don't see any features. Even the intellisense suggests to me sometimes bad HTML Code (it's not the IDE's fault).
After all web projects are still text files. You can easily control group projects like this with Version Control. Visual Studio Code even provides an integrated Git support.
Visual Studio Code does not create "project files" that you can open in Visual Studio 2015. Basically, when you open up a Node website in Visual Studio, you need to re-create the folder structure in VS2015 and create a "project file".
I haven't seen any better ways of doing this, but will be happy when we can open a folder just as easilly as we can with VSCode
I'm sure it's not the best way but..
Open an existing .sln with notepad, change the names, save as [name of your project].sln.
Open with Visual Studio.
My 2015 Visual Studio Pro crashes every time I remove a reference from any C# project targeting .NET 4.0. Is there a fix for this?
Microsoft Visual Studio Professional 2015
Version 14.0.25123.00 Update 2
Microsoft .NET Framework
Version 4.6.01055
Addition and removal of references from the project file can also be done using any text editor and editing the .proj file. Each .proj file is an XML file storing the project configuration. Just remove the reference and save the file. (A possible work-around)
The problem you mentioned don't seem to be a general issue. Visual studio may also crash for some unknown host system or project configurations.
We have a solution that contains some projects. The projects have references to other projects outside the solution. In Visual Studio, the build fails as the dependent projects are missing from the solution while using msbuild, the build succeeds.
It appears that msbuild is using the path to the projects' dependants to recursively build the dependencies. This seems to be the difference between the msbuild behaviour and the Visual Studio behaviour.
If I am right in this assumption, is there a way of turning off this recursive build behaviour? We want consistent behaviour between build server and Visual Studio 2012.
I've created a game for an assignment in Visual Studio 2012 and the university I'm at uses 2010 and it won't open! It mentions something about NET Framework 4.5. How can I convert my project so it will open in 2010?
It takes three step:
Step 1
Open solution file (.sln) in a text editor and change
Microsoft Visual Studio Solution File, Format Version 12.00
to
Microsoft Visual Studio Solution File, Format Version 11.00
Step 2
Open application configuration file (App.config) in a text editor and change
sku=".NETFramework,Version=v4.5"
to
sku=".NETFramework,Version=v4.0"
Step 3
Open project file (for C# language .csproj) in a text editor and change
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
to
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
Now enjoy your project in VS 2010 !
You may only need to open the project in Visual Studio 2012, and go to the project's properties page.
On the Application tab, locate the Target Framework setting, and change it to .Net Framework 4.
After that, you should be able to open it in Visual Studio 2010.
Also see Converting VS2012 Solution to VS2010, but so far I haven't had to do any conversions on VS2012-created projects to open them ins VS2010 - but YMMV.
[EDIT]
I just tested this again (to be sure) by creating a .Net 4.5 project in VS2012, and verified that I couldn't open it in VS2010. Then I opened it in VS2012 again and changed the framework version to .Net 4.0. After that I could open it in VS2010.
Note that I didn't have to make any other changes. However, this is on a computer with VS2010 and VS2012 installed, so it's possible that installing VS2012 might do something with VS2010 to make it work...
I have done this at work
Open .sln file with notepad
Change the two lines below
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
To
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
and hey presto the solution now opens in VS2010
You can create a new project in Visual Studio 2010 and then right click in the solution explorer > Add > Existing item. To pull through all of files in your 2012 project.
Either create a new solution in VS2010 and add all existing files from your VS2012 or compare the .sln file to a .sln file freshly created with VS2010. At the top you'll see some version information that should be changed. Also compare the .csproj files and change any version information accordingly and the target framework.
Missing library or framework could also cause this problem. For example, if you want to open a MVC4 or Silver Light project but you don't have these libraries installed at your PC.
Open .sln file and Change Format Version to 12.0 to 11.0