0

I am working on a project that requires me to build a .dll file in .NET framework 4.x I know this would be super easy if I were to use Visial Studio. But I have set my mind on using VS Code as my IDE. In theory Visual Studio "only" automates the creation of all sorts of metadata and references. So I figured it should be possible to do these things manually. Correct? Can anybody direct me to where I can find how to do that?

I am working on Windows 10.

2

2 Answers 2

1

Because Code isn't adept at managing a project file (.csproj) - nor should anyone have to - you can actually use the dotnet.exe CLI to create the project and target .NET Framework instead. The only requirement is that .NET Core SDK needs to be installed, even if you use MSBuild because the new SDK-style project requires different targets.

  1. Run: dotnet new classlib -o MyLibrary
  2. Run: code MyLibrary
  3. Open MyLibrary.csproj in Code
  4. Change the line <TargetFramework>v4.5</TargetFramework>

Now you can run dotnet build or msbuild build, and even set up build and test tasks in Code. By default, Ctrl+Alt+B will run a build task, or prompt to create one from a template if none exist yet.

Now you can simply add files without modifying the .csproj file. I participate in many OSS projects that use technique and can easily switch between VS, Code, or even non-IDEs like vim.

0

It would require from you to type a lot of code and files that are otherwise automatically scaffold (generated) when you create a new project in Visual Studio. Even though VS Code is supportive for .NET framework coding (with the C# plugin), I would advice you to use Visual Studio (the community version would suffice). It has much better support for any .NET framework development.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.