1,397 questions
0
votes
1
answer
29
views
Building a C# project multiple times for every configuration
I have a C# project with few dependencies, and a list of build environment properties (dev, staging, prod). I am trying to build the project multiple times per env in a separate folder and with a ...
4
votes
2
answers
101
views
Why does dotnet restore on a .sln ignore `DownloadContentFiles` tasks in .csproj projects?
I have an .sln referencing a single .csproj. Inside the .csproj I download static dependencies into ASP.NET's wwwroot:
<Target Name="DownloadContentFiles" BeforeTargets="Restore&...
0
votes
2
answers
112
views
VSTO Outlook Add-in: SDK-style Project Works with Direct Install but Fails with WiX MSI
Problem Summary
I have a critical issue with my SDK-Style generated VSTO Outlook add-in when deployed via WiX MSI installer. The same VSTO files work perfectly when installed directly (double-click ....
1
vote
0
answers
34
views
Run a Target in csproj with Microsoft.Net.Sdk after update from .NET 4.8 to .NET 8.0
I hope there is a simple answer to my question. I have updated a .NET 4.8 project to .NET 8.0. Now my project file is diffrent. That's clear. But how can I start my target now?
In .NET 4.8 I had one ...
0
votes
1
answer
66
views
csproj : Dependency selection based on target framework
My .NET project targets both .NET 6 and .NET 8, in my csproj file I have:
<PropertyGroup>
<TargetFrameworks>net8.0;net6.0</TargetFrameworks>
...
</PropertyGroup>
Then, ...
103
votes
28
answers
114k
views
Error NU1105 Unable to find project information - The project file may be invalid or missing targets required for restore
All of a sudden, I am getting the following errors for 3 projects in a solution:
Error NU1105 Unable to find project information for 'C:\code\example\src\libs\example.I18n\example.I18n.csproj'.
The ...
119
votes
14
answers
128k
views
Cannot find command 'dotnet ef' [duplicate]
I am using .NET Core 2.0 on Arch Linux / Visual Studio Code and am trying to get EF tools to work, but I keep getting the error:
cannot find command dotnet ef
I've just about looked everywhere and ...
-1
votes
1
answer
43
views
Mysterious forced .csproj elements for Blazor components (App.razor)
Since I put my App.razor's @code into an App.razor.cs file, Visual Studio stuffed this crap into my .csproj file. Removing it gives these compile errors:
Here's the contents App.razor, just in case:
...
189
votes
6
answers
127k
views
How do I get .NET Core projects to copy NuGet references to the build output?
I'm trying to write a plugin system with .NET Core, and one of my requirements are to be able to distribute the plugin DLL along with its dependencies to the user for install.
However, I can't figure ...
3
votes
5
answers
9k
views
<ImplicitUsings> in .NET8 project, any vulnerabilities?
Using the upgrade-assistant provided by MS, i'm trying to upgrade my projects from .NET 6 to 8.
I have noticed this being inserted at the top of my project files : <ImplicitUsings>enabled</...
1
vote
1
answer
4k
views
Target both .NET Framework 4.8 and .NET 8.0 in SDK project?
I have an application that is an addin to another larger application developed by another company (i.e. I have no control over the parent application). The parent application is updating to .NET 8.0 ...
0
votes
0
answers
47
views
Publish Error in ASP.NET MVC - Could not find file 'bin\*.xml' during deployment
Problem
While publishing my ASP.NET MVC project using Visual Studio 2022, I ran into errors.
Similar errors appeared for:
Newtonsoft.Json.xml
System.Web.Helpers.xml
System.Net.Http.Formatting.xml
...
112
votes
4
answers
77k
views
How do you multi-target a .NET Core class library with csproj?
When .NET Core still used the project.json format, you could build a class library targeting multiple frameworks (e.g. net451, netcoreapp1.0).
Now that the official project format is csproj using ...
108
votes
3
answers
46k
views
Visual Studio 2017 and the new .csproj InternalsVisibleTo
Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file?
0
votes
1
answer
1k
views
VScode Error: Unable to get working directory for project Miscellaneous Files - file RunTestsHandler.cs line 124
I am currently working with VSCode on Windows. I have one folder opened in my workspace which contains several projects. Since we build the projects for net8.0 AND net481, I use the setting "...
16
votes
3
answers
15k
views
How to make internals visible to multiple other assemblies in .NET Standard
I have multiple assemblies which include unit tests for a single .NET Standard 2.0 project. To thoroughly test my project I want the internal classes to be visible to both assemblies.
Here is the part ...
5
votes
1
answer
2k
views
Visual Studio $(Variable) for nuget root path?
I use a third-party nuget package that contains a content file that appears in my project which I'd like to copy to my output folder. Said and done.
Unfortunately what the project file then does is ...
58
votes
3
answers
43k
views
How to create an SDK-style .NET Framework project in VS?
Is it possible to create an SDK-style .NET Framework project in Visual Studio (to be more specific I use the latest VS2019)? Or does it still require manual manipulations?
<Project Sdk="...
0
votes
1
answer
268
views
How to set BuildInParallel="false" in a .NET SDK style .csproj?
How can I set BuildInParallel="false" in my .csproj?
In the following example, .csproj has two build targets for net6.0 and net8.0. In default they are run in parallel build processes in ...
18
votes
3
answers
7k
views
What does <ImportWindowsDesktopTargets> do in a try-convert generated *.csproj?
I have used the try-convert tool to convert my projects from .NET Framework to .NET 5.0
When inspecting the converted *.csproj files for projects that are targeting .net50-windows I noticed the ...
0
votes
1
answer
451
views
Visual Studio 2022 - CSPROJ AssemblyAttribute Shows as Missing File
I'm trying to add a custom build time attribute to my assembly following the post here: https://blog.jermdavis.dev/posts/2023/build-metadata-dotnet
I've added the following class file for the ...
217
votes
8
answers
106k
views
In a .csproj file, what is <None Include="..."> for?
How is
<None Include="C:\foo.bar" />
different from
<Content Include="C:\foo.bar" />
?
1
vote
1
answer
49
views
Publish ASP.NET app without certain folders
I have a csproj with some folders with code from different clients.
When i publish my app i get something like this:
Client1Folder
Client2Folder
Client3Folder
Client3Folder2
SomeCommonFilesAndFolders
...
0
votes
0
answers
90
views
NET8.0 WebApi project post build event does not execute as desired
I have Web Api project as back-end and Blazor WebAssembly as front-end. I want copy Blazor publish files to Web Api publish subdirectory wwwroot and then zip all files. I added post build instructions ...
0
votes
1
answer
929
views
Debugging Console-App not working. No C# project is currently loaded. Please create a C# project in order to debug
I’m currently learning C# through a beginner course provided by Microsoft. I followed the instructor's steps precisely, but I keep encountering an error.
Here are the steps I followed:
Created a new ...