csproj

“Bogus” Web project requires missing web component message for razor

浪尽此生 提交于 2019-12-05 17:40:00
Using Visual Studio 2010, MVC 3 (release version) I'm getting this error when opening a specific project which was a traditional web forms project to which I've added MVC: "The Web project '' requires missing web components to run with Visual Studio. Would you like to download and install the using the Web Platform Installer now? ASP.NET Web pages with Razor syntax." I have MVC installed and fully running. Other pure MVC and another mixed Web Forms/MVC project open without any issue. Clicking "Yes" appears to go through downloading and installing, but the error remains. Clicking "No" opens the

What is the purpose of msbuild's GenerateRuntimeConfigurationFiles?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 14:48:15
I upgraded a netcore1.1 project to the new VS2017/csproj. In my test projects only, it added: <PropertyGroup> <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> </PropertyGroup> I did some digging to discover that it generates these files in the bin directory: ProjectName.Tests.runtimeconfig.json ProjectName.Tests.runtimeconfig.dev.json What is this setting and these files, and why do I need them? Why were they only generated for my test projects? These are specific to .NET Core projects and specify Which runtime and version to use. Typically Microsoft.NETCore.App .

Best way to parse VisualStudio .csproj file using python

假如想象 提交于 2019-12-05 13:04:11
What is the best way to parse Visual Studio .csproj file using python, for further modification? It is some .csproj file: ... <ItemGroup> <Reference Include="SomeAssembly, Version=1.1.1.1"/> ... </ItemGroup> ... I want to insert this: <HintPath>path/to/SomeAassembly.dll</HintPath> into the <Reference/> node. VS project files are XML. Python comes with a number of XML parsing libraries: http://docs.python.org/library/markup.html Either of xml.parsers.expat or xml.minidom could accomplish what you describe. For processing small XML documents like VS project files, choosing among them is a matter

MSBuild Post-Build

倾然丶 夕夏残阳落幕 提交于 2019-12-05 10:03:45
I've got an MSBuild script that is just about doing everything that I need it to do apart from my post-build step (see a previous question that I asked: MSBuild conditional Exec? ). What I'm looking to do is build many csproj files and optionally perform post-build steps if and only if the project was built. I don't want to perform my post-build step all the time or else the timestamp on my final output will be modified unnecessarily (and it makes the build process very time consuming for no reason). In my MSBuild script I've got something like the following for each of my csproj files:

How can .csproj know about its solution?

微笑、不失礼 提交于 2019-12-05 09:56:31
In .csproj files you can use variables like $(SolutionDir). It's possible to find libraries that way. How it's possible you can build .csproj by msbuild (not giving it solution path)? I can't see any sense in such behaviour, but it's working anyway. Individual project files do not have awareness of what solution they are part of. Variables $(SolutionDir), $(SolutionPath), $(SolutionExt), etc, only defined when you build your .sln file, they are not defined when you build project directly. To illustrate this, place this in your project file: <Target Name="BeforeBuild"> <Message Text=

csproj: how to get all resources?

别说谁变了你拦得住时间么 提交于 2019-12-05 09:26:16
问题 How to get all recources,wich copies to created binary? I think that it is all elements like this (has CopyToOutputDirectory tag): <ItemGroup> <None Include="Configs\Config.config"> <CopyToOutputDirectory>Always</CopyToOutputDirectory> </None> </ItemGroup> and like this: <ItemGroup> <Resource Include="Resources\Icons\icon4.png" /> </ItemGroup> <ItemGroup> <Resource Include="Resources\Icons\icon5.png" /> </ItemGroup> <ItemGroup> <Resource Include="Resources\Icons\icon6.png" /> </ItemGroup>

Your project does not reference “.NETFramework,Version=v4.6.2” framework. Add a reference to “.NETFramework,Version=v4.6.2” in the “TargetFrameworks”

风格不统一 提交于 2019-12-05 08:24:19
问题 I can't run my unit tests. I have the next error: Your project does not reference ".NETFramework,Version=v4.6.2" framework. Add a reference to ".NETFramework,Version=v4.6.2" in the "TargetFrameworks" property of your project file and then re-run NuGet restore. In app.config : <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/> </startup> In Project > Properties > Application > TargetFramework (.NET Framework 4.6.2) How can I fix it? 回答1: Please make the next steps

Harvesting a .csproj with heat.exe in Visual Studio 2008 and WiX(v3)

删除回忆录丶 提交于 2019-12-05 04:16:52
I found that Wix v3 uses a tool (heat.exe) to "harvest" information into WiX fragments. Either I am looking in the wrong location, or this is thinly documented. What is the best way to auto-generate a WiX fragment (likely using heat.exe) for a complex folder structure that contains media files: Of varying types (ico/png/xaml/etc) That may change regularly (names/locations/adds/removes) That are classified as "Content" and included in a .csproj such that they can be built into an installer via WiX and would withstand upgrades and patches with decorum? Background Information I found heat.exe,

Why can't I use embedded resources (resx) when targeting .netstandard 1.3?

删除回忆录丶 提交于 2019-12-05 04:16:37
(Question subtitle: Are resources not supported in .netstandard 1.3 or is my project file just messed up?) I just created an example portable class library in Visual Studio 2015 Update 3 and added a sample resource file. Initially, the file project.json looks like this: { "supports": { "net46.app": {}, "uwp.10.0.app": {}, "dnxcore50.app": {} }, "dependencies": { "Microsoft.NETCore": "5.0.0", "Microsoft.NETCore.Portable.Compatibility": "1.0.0" }, "frameworks": { "dotnet": { "imports": "portable-net452+win81" } } } Fine: No compile errors! After that, I used the project properties to target

Can I use both wildcard and Link element inside the Compile element?

点点圈 提交于 2019-12-05 02:58:27
In the .csrpoj file, If I have <Compile Include="c:\path\File1.cs"> <Link>Dir1\File1.cs</Link> </Compile> Then Visual Studio shows that file as a shortcut under Dir1 folder in the Solution Explorer. If I have <Compile Include="c:\path\*.cs"></Compile> Then all .cs files show up as shortcuts in Solution Explorer at top level: Is there a way to include all files in some folder and make then show up under a sub-folder? Omitting the filename in Link element does not work: <Compile Include="c:\path\*.cs"> <Link>Dir1\</Link> </Compile> The files still show up at top level. How do I include all files