I am supposed to take over a project which is MVC based. in the source code folder, I see all the required files except the sln file. Is there a way to generate the sln file for MVC project? Will it work as expected?
If your project has the .csproj file, then open the .csproj file with Visual Studio, then when you close VS it will ask you to save a .sln file.
Related
I have a .NET Core 3 project in Visual Studio 2019. When I copy and paste a file, through Windows Explorer, into the project folder, Visual Studio automatically includes the file into my project, which I do not want to happen. Is there a setting to disable this feature?
Starting from VS 2017 project format in .NET has changed. You need to add <PropertyGroup> tag at the top of your .csproj file:
<PropertyGroup>
<EnableDefaultItems>false</EnableDefaultItems>
</PropertyGroup>
Here is the complete answer to your question:
In Visual Studio, why are all files automatically part of my C# project?
Well, you can modify the known project file (.csproj for c# project), by customize the items include path that satisfied your include files specifically.
For more details, you can check these out:
https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-well-known-item-metadata?view=vs-2015&redirectedfrom=MSDN
Understanding a csproj assembly reference
Including content files in .csproj that are outside the project cone
Enjoy and deploy with confidence!
When creating new projects with .net-core (dotnet new -l F#), the projects are created with a project.json file and no fsproj file. However, it is my understanding that an fsproj file is needed in order to get intellisense.
Are there any tools for generating an fsproj file from a project.json file?
I am interested in a solution that works both in Linux and Visual Studio as I use both equally for fsharp.
If you open project.json in Visual Studio 2015 with update 3, it will create an xproj file for the project.
I'm not aware of a way of doing this in linux.
However, as far as I know you don't need an fsproj file to get intellisense.
I found projekt useful for creating and manipulating .fsproj files. However, it will not automatically convert your project.json for you.
Error 5 Copying file Uploads\People\bzbu0pdh.png to obj\Release\Package\PackageTmp\Uploads\People\bzbu0pdh.png failed. Could not find file 'Uploads\People\bzbu0pdh.png'. 0 0 SampleProject.Web
I get this error when I try to publish my project from Visual Studio 2013. I'm pretty sure this is an unwanted file.
I tried creating a file with the same name and putting it in Uploads\People and included that in project. It didn't help either.
Browse to that directory in Visual Studio and you'll see that VS believes there to be a file there. you can right click and exclude it from the project and VS will update the project file for you.
I currently work with projects using VS2010, but my colleagues use VS2012 and one of my colleagues updated the bin folder for an SVN repo and changed files that affected my intellisense. I've tried creating a new MVC 4 project and overwriting the following files:
System.Web.Optimization.dll
System.Web.Razor.dll
System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll
System.Web.WebPages.Razor.dll
WebGrease.dll
But unfortunately, my intellisense still isn't working. Are there additional files that I should be taking into account?
I created an ASP.NET MVC project in Visual Studio 2012 on my laptop, did a bit of work on it without issues, then checked it into source control. I've checked it out on my main desktop machine (a completely fresh Git clone), and it won't compile stating that various references are missing (one of which being entityframework.dll). Looking back on my laptop, those DLLs are in my project's "bin" folder (which I didn't add to source control for obvious reasons). On my laptop, if I rename my bin folder, then I get the same compile errors. Am I incorrect in not committing certain DLL files that are in my bin folder? Surely those DLLs should be copied into the bin directory at compile time?
The desktop probably can't find the folder to copy from.
You should add the references using NuGet (if you aren't already) and include the packages folder in source control. (or enable package restore)
You should look as to where the library references are stored in your project file. If the project is referencing copies in your bin directory then you have your project setup incorrectly.
You should maintain a libraries directory in your source control tree that id checked in like any other dependency.
The bin directory should be output only.