csproj

In Visual Studio (2008) is there a way to have a custom dependent file on another custom file?

∥☆過路亽.° 提交于 2019-11-27 08:06:14
Instead of a *.cs code behind or beside I'd like to have a *.js file. I'm developing a MVC application an have no need for a code beside because I have controllers, but in certain cases it'd be nice to have a JavaScript code beside or some way to associate the file to the page it's being used on. I suppose I could just name them similarly, but I'm wanting to show the association if possible so there's no question about what the file is for. Typically what I'm talking about is within Visual Studio now under your Global.asax file you will have a plus sign to the left: + Global.asax Once you

Including content files in .csproj that are outside the project cone

微笑、不失礼 提交于 2019-11-27 03:00:26
I have a C# project say MyProject.csproj located at "C:\Projects\MyProject\". I also have files that I want copied into the output directory of this project. But, the files are at the location "C:\MyContentFiles\", i.e. they are NOT within the project cone. This directory has sub-directories as well. The contents of the directory is not managed. Hence I have to include all what is under it. When I include them as 'Content' in the project, they are copied, but the directory structure is lost. I did something like this:- <Content Include="..\..\MyContentFiles\**"> <CopyToOutputDirectory

Modify .csproj files programmatically

风格不统一 提交于 2019-11-27 01:59:11
问题 I have source code of Entlib 5.0 and I need sign all assemblies using my own key (snk file). The easiest way would be to open the EnterpriseLibrary.2010 solution file in Visual Studio 2010 and for each project, select Properties->Signing then select Sign the Assembly and finally select your key file. But I don't want to manually do that then I could write a script to manually edit the project files and insert the following at the end of the current list of PropertyGroups : <PropertyGroup>

Reading the list of References from csproj files

泪湿孤枕 提交于 2019-11-27 01:47:32
问题 Does anyone know of a way to programmatically read the list of References in a VS2008 csproj file? MSBuild does not appear to support this functionality. I'm trying to read the nodes by loading the csproj file into an XmlDocument but, the XPath search does not return any nodes. I'm using the following code: System.Xml.XmlDocument projDefinition = new System.Xml.XmlDocument(); projDefinition.Load(fullProjectPath); System.Xml.XPath.XPathNavigator navigator = projDefinition.CreateNavigator();

Visual Studio project type guids

落爺英雄遲暮 提交于 2019-11-26 22:56:17
问题 I downloaded a Visual Studio project but I can't open it in my copy of Visual Studio 2010. Useless error message: The project type is not supported by this installation. What software do I need to open the project type? It doesn't say. I actually went and read the .csproj file, it tells me it's project type <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> Am I meant to recognise what software I need from this random string?

XPath and *.csproj

非 Y 不嫁゛ 提交于 2019-11-26 21:16:44
问题 I am for sure missing some important detail here. I just cannot make .NET's XPath work with Visual Studio project files. Let's load an xml document: var doc = new XmlDocument(); doc.Load("blah/blah.csproj"); Now execute my query: var nodes = doc.SelectNodes("//ItemGroup"); Console.WriteLine(nodes.Count); // whoops, zero Of course, there are nodes named ItemGroup in the file. Moreover, this query works: var nodes = doc.SelectNodes("//*/@Include"); Console.WriteLine(nodes.Count); // found some

MvcBuildViews true with Entity Framework in ASP.NET MVC 2

不打扰是莪最后的温柔 提交于 2019-11-26 20:19:54
问题 In VS 2010, changing <MvcBuildViews>true</MvcBuildViews> in a MVC2 project's .csproj file causes an error if you are using Entity Framework. Could not load type 'System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider'. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config 129 I want to build views while I'm debugging, and I also want my project to compile! 回答1: You can resolve this MVC compile issue by adding the following element to your web.config file: <add assembly="System

Easy way to add multiple existing .csproj to a Visual Studio Solution?

我们两清 提交于 2019-11-26 19:11:52
问题 I've checked out a branch of C# code from source control. It contains maybe 50 projects in various folders. There's no existing .sln file to be found. I intended to create a blank solution to add existing solutions. The UI only lets me do this one project at a time. Is there something I'm missing? I'd like to specify a list of *.csproj files and somehow come up with a .sln file that contains all the projects. 回答1: Here is a PowerShell version of Bertrand's script which assumes a Src and Test

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

心不动则不痛 提交于 2019-11-26 18:30:57
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): Aboo You need to manually edit the project file and add s to the default TargetFramework and basically change it

In Visual Studio (2008) is there a way to have a custom dependent file on another custom file?

﹥>﹥吖頭↗ 提交于 2019-11-26 17:44:22
问题 Instead of a *.cs code behind or beside I'd like to have a *.js file. I'm developing a MVC application an have no need for a code beside because I have controllers, but in certain cases it'd be nice to have a JavaScript code beside or some way to associate the file to the page it's being used on. I suppose I could just name them similarly, but I'm wanting to show the association if possible so there's no question about what the file is for. Typically what I'm talking about is within Visual