Why does Visual Studio only allow one link to a file in a project?

I would like to have the file in several different solution projects, however Visual Studio allows only one link to one solution for the file. Is there any way around this?

What is the problem with having multiple programmatic links to one file in a VS project?

Update:. I added a link, as described in the comments below, it seems that the problem depends on each project. A project cannot have multiple links to the same file. When I try to add a link, I get the following error: "There is already a link to." A project cannot have more than one link to the same file. "

+6
visual-studio-2008
source share
4 answers

I use Visual Studio 2008 Professional, and it allows you to maintain the same file from the same project with any other project, regardless of the number of decision files that you use.

+1
source share

You can create multiple links to one file in the ONE project, but manually and VS will not be displayed in the project tree.

upload the project and add, for example, links:

<Content Include="..\..\_Common\js\JQuery\jquery.js"> <Link>Sites\OrgCatalogSite\Design\js\JQuery\jquery.js</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> <Content Include="..\..\_Common\js\JQuery\jquery.js"> <Link>Sites\TasksManagersSite\Design\js\JQuery\jquery.js</Link> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> 
+1
source share

Not sure what you want to achieve or what file it is, but can you create a new project with this file in it and reference this project from each of the projects that require it? If this is a code file, then it will be within the scope, if its other file with "Always copy", will it be copied to the folder of various bin projects during construction?

0
source share

I would like to add several links to the same .XSD / .WSDL file in the same project.

More details. The server is in Java (WebSphere Application Server / 7.0). Client dll in C #. We use the contract-first approach.

In Visual Studio 2008, I add a service link. But instead of my original WSDL / XSD contracts, it extracts dummy XService.wsdl and XService_schema1.xsd and generates "not so friendly" code (with message wrappers, xFieldSpecified stuff, dummy collections of ArrayOfx ...). So what am I doing? I am changing the Reference.svcmap so that it includes exactly the original WSDL / XSD contracts and inserts them where they belong. This is normal, I get friendly code, and I'm happy.

But what if someone changes the contract with the server? Here I can’t just update the service link. I must copy-paste new contracts into my Service Reference folder at any time when the contract has been changed.

To summarize, I need to add the WSDL / XSD source files as links to all Service Reference folders in order to simplify the process of changing the contract. Just run the new WSDL / XSD, right-click Reference.svcmap> Run Custom Tool.

Isn't that a decent feature?

0
source share

All Articles