I have the file Pathes.cs(in the screenshot);
The file is not in any project. The other projects does not see it. My task is to do that file visible for all projects.
I tryed to use using Homework, to use Homework.Pathes.pathToDataDirectory in my projects.
But nothing helps.
You have a few options:
Create a Class Library project, put the file in there and reference that project in all other projects that need that class. Right-click on Dependencies in the Solution Explorer, go to Projects and select the shared class library project. This is the preferred option.
Link the file to the projects that need the file. Right-click on the project, click Add > Existing Item and navigate to the file. Instead of clicking the Add button, click on the arrow next to it and select Add As Link.
Copy-paste the file into the projects. This is a total maintenance nightmare, so don't go there.
Related
I am new to ASP.NET and I was asked to create a portal program which will be just a part of the existing ASP.NET portal project. Meaning, it will be just like 2 web pages and will be going to be added to the existing project. The thing is I have to do it in a separate ASP.NET Project file. I have the source code of the existing main project but I am not allowed to modify this unless the pages that I will develop are completed. How can I do it? I know I just have to create a new project but what is the next step after that? How can I import the one that I made to the main project? They mention that I just have to export it as DLL but I have no idea how to do that. Please help me.
Open your new project in Visual Studio.
Open the old project in Visual Studio.
Right click the name of your new project on Solution Explorer, select Open Folder in File Explorer
Copy the 2 new pages you created
Go to the Visual Studio Instance of your old project. Click the name of the solution and CTRL + V or Right Click > Paste. (If there is a folder let's say Pages where ASPX files are located, click and paste there instead).
Your new files might not be included in the project and if its happens, click the 'Show all Files' option on the Solution Explorer.
Right click on the 2 new ASPX files and select 'Include In Project'.
I am not sure if I understood you right. If you just have to export the dll from the project that you created, right click on your solution, open the bin folder, you will see a file named yourprojectname.dll. Copy this to your target projects bin folder using the steps mentioned above.
If I understood it right, you are being asked to created a classlibrary or something and not an aspx page. Again, I might be wrong, but others can help you if you are lucid about your requirement.
I'm using Visual Studio 2013 and I have a solution that contains multiple projects.
I would like to extract one project from a solution to create a new, separate solution, that would only contain this one project.
Does anyone know how to do this?
If by "Extract", you mean "Duplicate" your project and start a new solution with this project, here is what you can do:
Create a new solution in Visual Studio
Copy your Project folder in the root of the new solution
Right click on the solution => Add existing Project and select
the project file (*.csproj in this case)
Copy the project folder into separate folder, open the .csproj file, press CTRL + S, it will open the save dialog and you will save the .sln file. That is it.
Right click on any project, then Exclude from Project. The excluded files will be in the project folder. Move those files to another folder, in the way you want it. Then you can create and add those files in new project by Add existing item
I'm a little bit stuck. I've just checked out an open source project from google code for something and it's a nice little C# code base.
However there's no solution file or anything. I'm not really sure how to compile it from here on as I've always worked within a solution.
I can't seem to find a solution online and was just wondering if someone could tell me how to compile a number of .cs files together to run, or how to create a solution from them.
Create a new project. You will need to decide whether it should be a class library, console application, etc. depending on what the open source project is supposed to be.
Right-click on the project and select Add -> New Item.
From the file dialog, select all of the .cs files you wish to compile.
If the project is not a class library, then right-click on the project and select Properties. Go to the Application tab and specify which class contains the startup object.
Build the project and see if it works.
Contact the project maintainers and ask them to include a proper project file. Offer to send your .csproj file if it works.
It's also possible to compile manually on the command-line with the C# compiler, but this would be more difficult.
Create an empty solution and add those files to an empty project [Need to figure out project type though].
If you project have .csproj file then create empty solution and add this project to the solution using .csproj file.
If you have'nt .csproj file then you have to figure out the the type of the project and then add these file to the project to make the solution.
I have two projects. One where I can see the properties folder within the project and the other I can't. I have right-clicked on the solution and selected properties, but I see no way to add the folder.
I have tried (within Windows), going to the folder of my project and adding the folder that way, but I still need a way to associate the project properties with that folder I have added.
I've seen this thread. It says the folder is created by default when you create a project and if I delete them, I'll have to recreate it. I've never seen the folder on any of my projects, except one and I didn't delete it from the others, so not sure.
I attached a picture of what I am referring to in my project that actually has it if that would help. Thanks.
You need not just add folder in windows explorer, but also include it in Project (with 'Show all files' option, find this folder under project and 'Include in project' from rigth click menu).
OR, just create it from within VS (right click on Project -> Add -> New folder, and name it 'Properties')
I have created a project of Online Book Shop like Flipkart but now I lost my .sln file of this project, it has a database connection so how can I create a new .sln file and run my project??
I tried to make blank .sln file and want to add all files of my project but failed to do that so anyone has a solution share.....
Go to file-> New Project in Visual Studio. Then go to "Other Project Types"-> "Visual Studio Solutions". You should see "Blank Solution". Just create a blank solution. Once you have that right click on the solution and go to "Add"->"Existing Project" and select your projects.
Solutions contains projects. So you have to add projects to a blank solution.
So, first create a new blank solution. Then right click on the solution icon and select Add existing project. Then browse to the project folder and select the .*proj file.
Finally check if any external reference is missing, and add it to the project references.
At this point you should be able to build the solution.