csproj

Visual studio doesn't support specific csproj file

核能气质少年 提交于 2019-12-03 08:08:36
问题 I am getting this error when I try to open the solution file of my project. The solution is 2012 file (checked using notepad). If I click on Ok, The solution opens up except for one csproject which does not load. I get a migration report in UpgradeLog.htm file, with the following error for the project which failed to load. Could not figure out much from it. Error: The application which this project type is based on was not found. Please try this link for further information: http://go

Upgrading to .NET Core 2.0: PackageTargetFallback and AssetTargetFallback cannot be used together

笑着哭i 提交于 2019-12-03 08:04:08
问题 When upgrading a project that is compiling and running fine on .NET Core 1.0 or 1.1, updating the target framework to .NET Core 2.0 ( netcoreapp2.0 ) causes the build to fail with the following error: error NU1003: PackageTargetFallback and AssetTargetFallback cannot be used together. Remove PackageTargetFallback(deprecated) references from the project environment. What is the reason for this error and how can it be resolved to make the project build again? 回答1: In .NET Core 1.0 and 1.1, it

Why are my .csproj files getting messed up after a git rebase?

橙三吉。 提交于 2019-12-03 05:59:16
问题 In a .NET C# project which uses GIT for source control, I keep getting malformed csproj files after rebasing to get the most recently commited code. This is my process: commit my code build and run tests rebase to "get latest" curse the heavens, as the csproj file is screwed up... AGAIN Here's the output on the rebase: D:\GitHub\AwesomeProject>git rebase master First, rewinding head to replay your work on top of it... Applying: added getstatus call Using index info to reconstruct a base tree.

Visual Studio 2017 and the new .csproj InternalsVisibleTo

若如初见. 提交于 2019-12-03 05:32:14
问题 Where do I put InternalsVisibleTo from AssemblyInfo in the new Visual Studio 2017 .csproj project file? 回答1: To clarify Hans Passant's comment above, you simply have to add InternalsVisibleTo to any cs file in your project. For example, I created an AssemblyInfo.cs file in the root of the project and then added the following content (only): using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=<ADD_KEY_HERE>")] 回答2: Just in case anyone would

In a .csproj file, what is <None Include=“…”> for?

有些话、适合烂在心里 提交于 2019-12-03 04:50:25
问题 How is <None Include="C:\foo.bar" /> different from <Content Include="C:\foo.bar" /> ? 回答1: The MSDN article on the build action property explains the differences. None - The file is not included in the project output group and is not compiled in the build process. An example is a text file that contains documentation, such as a Readme file. Content - The file is not compiled, but is included in the Content output group. For example, this setting is the default value for an .htm or other kind

How to convert a non-core csproj to VS2017 format [duplicate]

谁说胖子不能爱 提交于 2019-12-03 04:38:50
This question already has answers here : How to upgrade csproj files with VS2017 (3 answers) I have two projects in VS2015 One .NET Core (project.json, xproj) One regular .NET csproj When I open project 1 with VS2017, it nicely migrates to the new csproj format. Project 2 works in VS2017, but I like to convert/migrate/update this csproj to the new project file format to benefit from the new csproj features (multi target, no large file list, readable csproj, NuSpec info in csproj etc) How could I do that? I cannot find an option in VS2017 for that. Using: VS2017 RTM There isn't an option built

Can files be nested in VS2017 Solution Explorer for .NET Core (non-ASP.NET Core) projects?

 ̄綄美尐妖づ 提交于 2019-12-03 04:25:35
问题 In "old school" MSBuild projects - as still used by Windows Forms in VS2017 for example - files could be "nested" via a DependentUpon item in the csproj file. I used this to group unit tests together in Noda Time, e.g. <Compile Include="LocalDateTest.PeriodArithmetic.cs"> <DependentUpon>LocalDateTest.cs</DependentUpon> </Compile> That led to easily-navigable tests: I knowingly "lost" this feature when moving to project.json for .NET Core, but had hoped it would return when converting to

MSBuild project file: Copy item to specific location in output directory

江枫思渺然 提交于 2019-12-03 02:45:37
In the process of cleaning up the folder/file structure on a project I inherited, I'm running into a problem with organizing the required external libraries. I want to keep them in their own .\dll\ folder, but they're not being copied to the build directory properly. They should be in the root build directory, but they're being moved to a subfolder instead. My .csproj file contains the following xml: <Project> <ItemGroup> <None Include="dlls\libraryA.dll"> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </None> </ItemGroup> </Project> Then, on build, the libraryA.dll file is

Partial .csproj Files

狂风中的少年 提交于 2019-12-03 02:00:24
Is it possible to split the information in a .csproj across more than one file? A bit like a project version of the partial class feature. You can not have more than one master csproj. But because the underneath wiring of the csproj is done using msbuild you can simply have multiple partial csproj that import each other. The solution file would see the most derived csproj. project1.csproj <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> .... </Project> project2.csproj <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer

Targeting both .NET 3.5 and Silverlight

十年热恋 提交于 2019-12-02 23:32:11
Let's imagine I already have a project building .NET 3.5 assembly. Now I want to build this assembly for Silverlight, and moreover, maintain its Silverlight version with minimal efforts further. What is not acceptable: Creating separate project for Silverlight build What is acceptable: Adding custom directives allowing me to target either Silverlight or .NET dependently on e.g. MSBuild properties. Adding special build configurations for Silverlight Adding #ifdef Silverlight / #endif sections to the source code. Generally any other modification of .csproj / .cs. So basically, I'd like to