I have a shared project between two solutions. Working in the first solution (server) I have added new files to the Entities project, and now I am trying to reload the Entities project in the second solution (client), but it is not working - new files do not appear.
Related
Project name is testProject. I want to create a new folder named "TestProject" and move the project into it, because I want to add testProject.uTest and testProject.iTest for unit and integration tests. So everything related is located in the same folder.
The solution is in VSTS. Already one folder exists with the same name because of the project. Namespaces will all change.
How do I go about this the best way?
I got everything to work.
First I opened the solution and deleted the project in there. Then I created the new folder in the solution explorer. I then copied all the project related files into the new folder in windows explorer. I opened up the solution and added this existing project and add all files to source contrl. Next I had to re-add nuget packages and fix some references in other projects. Next I pushed the changes and then I deleted the old project files in source control explorer.
Took 10mins and everything works fine!
A few simple steps that worked for me:
Create a folder and add some text/number at the end:
Example: Infrastructure1
Create/Add the Project to your solution without the text/number at the end.
Example: Infrastructure
Rename the folder (Infrastructure1) to match your Project name(Infrastructure).
That's it, and you will get rid of the message that Project can't be named with the same name as the folder.
I am working on a solution that contains 30 cs projects. I am focusing on only 1 project so I preferred to open only this specific project.
Once opening this specific project, it loads the entire solution wiht all the others 29 projects.
Is there a way to open only this specific csproj?
The following structure can be used to get the desired behaviour:
Create a new Visual Studio solution
Delete the created default project
Add an existing project to the solution
Set the project as startup project (for re-build etc...)
You are now ready to go
You can do this in minutes and it's quite simple. Each sln file contains a number of projects that are written in this form :
Project(...) = "name.of.the.project", "{unique identifier of the project}"
and below that are the configurations for that project.
So you can write a javascript file to copy your original sln into each project folder found in that sln. After that iterate through each project folder and for each sln remove other projects. The javascript file can be runned using a .bat or cmd.
In this way you can assure that each project of your solution has inside his folder a new solution that contains that project.
We have a solution at work which has hundreds of projects.
So what we have done is have a Main.sln which contains everything. Then were have broken up the rest of the projects into different smaller solutions where they are grouped by relevance.
ie. All the database projects are in one solution, UI projects in another etc.
I have a solution in Visual Studio 2013 that hosts different projects of different types (three Windows WPFs, one WebAPI and a Windows Service)
something like this:
I want to add shared resources like string tables (global messages, common errors, etc) in the resource.resx file that is accessible to all. Ideally this file is placed in the "Common" folder and this common folder has been placed in the root of solution folder.
How can i do this?
I've tried with below steps:
Adding a "New Solution Folder" to the solution and "Add"->"New Item..." but there is no new "Resource File".
Create a new "Common" folder in windows explorer, drag and drop it from windows explorer to solution explorer. but by this method i was just able to add it to projects not folders(and even in projects, VS "copies" that folder to project folder and changing files in that project only affects copied folder and not the common one)
You can put all your resources in a shared project.
Create a new project, call it, for example ParkingResources.
For any project that requires these resources, add a reference to the new project.
In your consumer projects, you should now be able to access the shared resources.
I'm working with Visual Studio. There I have a solution with several web-projects (.net MVC 4). All of these web-projects use the same javascript-libs. Currently I copied the library into each project, but this can't be the final solution. What is the best approach to share those library (assets in general) between all of the projects? Just link them? Or is it possible to create a project and reference it in all projects?
Update
"Link" the javascript files from another project is not a possible solution as I would have to link thousands of files (one of the libraries I am using is ExtJs) what makes it impossible to build a project without freezing visual studio...
Possible solution
Currently I have a (Web) MVC Project called "Web" and a (Class Library) Project called "ClientScript" which contains all the JavaScript files which are shared between several Web Projects. As linking all the needed JavaScript files is not a possible solution (because it's a matter of thousands of files what causes visual studio to freeze) I copy all the needed JavaScript files to the individual Projects using the Build Events in each Web Project (Project -> Properties -> Build Events -> Post-build).
My Post-build command line in the Web Project looks like this:
start xcopy "$(SolutionDir)ClientScript\Frontend\*" "$(SolutionDir)Web\Scripts" /r /s /i /y /D /E
Every time you build your Web Project all the changed Javascript files get copied from the ClientScript Project to your Web Project.
While developing the Javascripts I run a small "filewatcher" tool which automatically copies a file from the ClientScript Project to every Web Project when it changes. This way I don't have to build the Web Project every time when I make a change to one of the Javascripts.
Anyone that stumbles across this question here in the future should know that there are now Shared Projects in Visual Studio to solve this problem. Universal Windows projects use them by default and you can create your own by downloading and installing the VS extension here: https://visualstudiogallery.msdn.microsoft.com/315c13a7-2787-4f57-bdf7-adae6ed54450
Note: At this time they can be picky about what type of project you try to add the shared reference. I created a JavaScript shared project to share js files between a Windows store js app and an MVC web app and it would not let me do that saying they had to be of the same language. (It supports C#, C++, or JavaScript).
Place the JS files in a single folder, likely above all others, and add them to the project but use the "Link" option. It's part of the drop down on the "OK" button in the "Add existing item..." dialog.
When you run every new ASP.NET MVC 4 project it's take a new port then other app have take.
I simply suggest you a simple thing.
run a project which contain all the pacakages. open them webmatrix and run them as localhost:80.
You need to set the port in settings section of your site in webmatrix. Now it will rechable at localhost now you can reference all the libraries from this packages.
Slightly older thread, but I have another way of doing a similar thing using Web Essentials, that handles the issue of not publishing correctly.
I have a shared folder outside of the projects that require the shared file, normally a 'common' project with other things in as well, but can be just a simple folder as suggested by Michael Perrenoud.
However instead of 'Add as Link' I have been creating a new bundle in the project that requires the shared js/css file, with the same name as the shared file, and then referencing that file in the shared folder using a relative reference location rather than the root based one it starts with.
To add a file from a shared folder in the root of the solution to the scripts folder use the following code in a new bundle file (*.bundle), changing the folder/file names as required.
<?xml version="1.0" encoding="utf-8"?>
<bundle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://vswebessentials.com/schemas/v1/bundle.xsd">
<settings>
<minify>false</minify>
<runOnBuild>true</runOnBuild>
</settings>
<files>
<file>../../MySharedFolder/my-js-file.js</file>
</files>
</bundle>
Then every time you build it recreates the bundle with the latest version, this version is then also published as expected :)
You can even create a minified version if desired by changing 'minify' to true. Or better yet you can add them loads as a bundle too if you want, you have that flexibilty.
This is an older thread but due to complex business requirements these days applications are divided in to different modules or sub projects.Thus, brings us the need to share common resources like JavaScript files, themes and CSS style sheet files.
I personally feel that common files should be put in separate Asp .Net MVC 5 project which has following structure :ASP.NET MVC5 folder structure
Now the best part is you can separately manage the dependencies using Bower,NPM or Nuget package manager.
After you have organised all the files in this project host this project to your own CDN or may be on cloud. You can use Using CDN in Bundle Approach to get script or link references.
That will help you sharing common resources across all the projects.There us a short coming though if you have many developers on the team and if someone added incompatible version lib can affect all the apps.
Suppose I have two MS LightSwitch projects. I really like my table layout in one project and want to copy it to the other project. How is this done? What files have the table and key definitions?
The easiest way would be to publish the application, then use a copy of the published database as an attached data source in the new project.
The defintions that you ask about are stored in an lsml file (a LightSwitch-specific XML file), ApplicationDefinition.lsml for LS 2011, & Common.lsml for LS 2012. But be VERY careful if you try to edit this file in any project, it only takes ONE mistake for the whole application to no longer load.
[WARNING: NEVER DO THE FOLLOWING! IT MESSES UP YOUR PROJECT IN VISUAL STUDIO]
What I did in LS 2013 was to create tables with the same name in the new project, so they are already "known" to your project settings. Then I went to [project folder]\[project name]\[project name]\[project name].server\DataSources\ApplicationData of the project I wanted the tables from. I copied the respective files (including script files, if you did data validation, which I also created in the new project with dummy entries) and then overwrote the files with the same name in the respective ApplicationData folder of the new project, which I had created.
When I loaded the project again, Lightswitch showed the new tables in my old project.