csproj

Relationship between the dotnet cli and the new vs2017 msbuild

只谈情不闲聊 提交于 2019-12-17 22:05:01
问题 With the move from project.json to the new csproj format introduced with VS2017, I'm struggling to understand the difference between the dotnet cli and the new msbuild and when to use one over the other. 1) To build a new csproj netstandard library from the command line, should I be calling the dotnet cli (for example dotnet restore dotnet build ) or use msbuild (for example msbuild ExampleNetstandard.sln ). 2) Also, my understanding is that there are two versions of msbuild , one built on

How do you multi-target a .NET Core class library with csproj?

╄→尐↘猪︶ㄣ 提交于 2019-12-17 03:31:13
问题 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 MSBuild, how do you specify multiple frameworks to target? I am trying to look for this from the project settings in VS2017, but I am able to only target a single framework from the .NET Core frameworks (it doesn't even list the other full .NET Framework versions which I do have installed): 回答1: You

How do you multi-target a .NET Core class library with csproj?

本秂侑毒 提交于 2019-12-17 03:31:05
问题 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 MSBuild, how do you specify multiple frameworks to target? I am trying to look for this from the project settings in VS2017, but I am able to only target a single framework from the .NET Core frameworks (it doesn't even list the other full .NET Framework versions which I do have installed): 回答1: You

replace web.config in asp.net core vs 2017 on publish

和自甴很熟 提交于 2019-12-14 04:17:54
问题 i'm trying to replace the web.config with the production version. I have the production version in ~\production\web.config (tilda as the root of my project folder). I found this in the migration document <ItemGroup> <Content Include="Views\**\*" PackagePath="%(Identity)" /> <None Include="notes.txt" CopyToOutputDirectory="Always" /> <!-- CopyToOutputDirectory = { Always, PreserveNewest, Never } --> <None Include="publishnotes.txt" CopyToPublishDirectory="Always" /> <!-- CopyToPublishDirectory

C# VS 2013 Error 02019: Invalid target type for /target: must specify 'exe', 'winexe', 'library', 'module', 'appcontainerexe' or 'winmdobj' CSC

社会主义新天地 提交于 2019-12-14 02:51:17
问题 I work on a website that uses various class libraries that are occasionally updated. One of the libraries is a sqlproj file and I believe it was made with VS2010. It is a dependency for other libraries and I'm not able to build/rebuild my solution because I keep getting this error, thus the DLLs will not generate. When I first open the project in VS2013, I get a migration report that opens in my browser. But the migration states that it's successful. When I try building the project, I get the

How to get actual project output using microsoft.build.evaluation.project in c#

馋奶兔 提交于 2019-12-13 17:32:54
问题 I need to know the actual output file name full path in a project. I use microsoft.build.evaluation.project to open a project with the correct properties, and i tried using the properties TargetPath, TargetDir, TargetFileName, but i can't find a consistent property to give me the output file name with the path. In some projects it works, and in some it doesn't. I work both on csproj files and vcxproj files. 回答1: Output path is related to project folder. You can get its value from project file

Duplicate files in csproj file Visual Studio

时光怂恿深爱的人放手 提交于 2019-12-13 14:08:42
问题 Somehow I am seeing duplicate files in my solution. I dig into it and found that somehow, there are two entries for some files in .csproj file. That's why two files are shown that is actually one file. I have to find for all the files in .csproj file. Is there any easy way to remove those entries from csproj ? And also can anyone let me know the cause of this? 回答1: As per this question and this other one on StackOverflow, this might happen when TFS (or other version control systems) edit a

XML in the csproj file

元气小坏坏 提交于 2019-12-13 12:58:37
问题 Can anyone point me to a schema or a list of properties valid inside the C# csproj file? I've looked, but don't appear to be able to find any documentation on it. 回答1: You mean something like this documentation? A reference can be found here 回答2: This was already answered here... Csproj are actually MSBuild files and I think the reference can be found here: MSBuild Project File Schema Reference The schema used by VS (VS 2008) is located here: C:\Program Files\Microsoft Visual Studio 9.0\Xml

How can I retrieve major/minor/build/revision number on build events

南笙酒味 提交于 2019-12-13 04:58:21
问题 Hy there! I'm using this piece of code, to copy some files on post-build-event: <PropertyGroup> <DemoPath1>..\demoPath1</DemoPath1> </PropertyGroup> <Target Name="AfterBuild"> <Exec Command="robocopy $(ProjectDir)$(DemoPath1) $(ProjectDir)demoPath2/$(Revision) * /XD .svn _svn /XF *.cs /S" IgnoreExitCode="true" /> </Target> As you can see, I would like to use $(Revision) - obviously, this is not going to work ... Can anybody help me out? @mods: I dunno exactly which tag to use ... on the one

Why does the verbiage for the “Copy to Output Directory” selection change between locations?

扶醉桌前 提交于 2019-12-12 10:38:21
问题 There is an inconsistency in the configuration value verbiage between Solution Explorer in VS.NET and the projected value within the .csproj file. In Solution Explorer a .config or dependency file will have multiple options in the Copy To Output Directory property that affect its build and deploy characteristics. In the Copy To Output Directory dropdown I have selected the option for a .config file: Copy if newer . However in the .csproj file it is set as PreserveNewest as seen below: