Reference c# class through multiple solutions [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have 2 separation solutions. One is done using MVC (Solutions 1) and the other is done using Web Forms (Solution 2). I have a class in one of the solutions (MVC one) that I like to use in the Web Forms solution. How would I reference the class in Solution 1 through Solution 2?

It depends on where the class is located. Ideally you would move your class out into its own project so that you can add the project to the other solution. You could also add an existing item from your MVC solution but this can lead to all kinds of dependency problems and shouldn't be done.

Related

How Can I Share Document Files with Multiple Web Projects? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I have three ASP.NET MVC Projects. before I use one single Directory to manage documents/files, and all projects can access from that source, but now I have to store files in particular projects (under App_Data) and have to access from other projects.
My question is, how can I manage this?
Linking files in Visual Studio could perhaps be a solution to your problem.
https://jeremybytes.blogspot.com/2019/07/linking-files-in-visual-studio.html
I used it myself the other day where I needed a single .csv file available in multiple projects.

Generating forms that use an MVC Web API [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am developing an interface that customizes and generates forms for customers to use on their own site. When a user logs in to the interface, he can create a form, add or remove fields from existing forms, and the system will generate the file.
I want to know what's the best approach for doing this. Making these forms independent and just use HTML/Javascript? or have them part of the overall MVC solution inside a Views folder so it can have server side code?
Probabily the best way is not to store the entire form, but having some metadata that describe the forms, then generate the gui dynamically. There are many ways to doing this, it basically depends on your skill, and your specifics, personally im developing something similar right now and i chose Angular2.
Here an example:
https://angular.io/docs/ts/latest/cookbook/dynamic-form.html

A project with an output type of class library cannot be started [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am given a source control which comprises class libraries only.
How should I run the project?
You can't debug a class library directly. If you think about it, where would it start running, i.e. what method? You need to have an executable (console application, winforms, wpf, etc.) project to run, which would typically reference your class library.
If you have one of those in your solution, right-click on it in the solution explorer and select "Set as Startup Project". Then try again.

Solution with several project namespaces [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
i am now developing a c# solution with 5 projects.
When i created the project under the solution, each project has its own namespace. My question is should i unify the namespaces using the solution namespace to avoid any scope problems later ?
Besides, i have a project for the Win Forms and using folders under it (to organize the forms). Each folder has several form.
When i want to use the form, i found that i have to mention the folder also.
What should i do then ?
Namespace is not related to the project structure but it is good habit follow the project structure. This make orientation in code much better. There is no need to unify namespace from scope reason. It should mirror your logical project layout. eg. your namespace can start with company (or product) name and than follow with component and then follow with your structure:
MyProduct.DataLayer
MyProduct.UI
MyProduct.Tools
MyProduct

Calling Classes from another project in the same solution c# [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have two projects (1-Business: where I put the Linq Classes 2-View: wpf app, where i will show data) in the same solution (ProjectOne)
the problem is that I can't call the first project in the second one even when i add references (right click on the View project -->Property-->References Path-->Select the path of the Business Project Folder )
In fact i found the solution,
first of all change the output Type of the first project from "Window Application" to "Class Library" and build it, then go to th the references of the second project and add the First one as a reference to it
You need to add a 'using' statement to the top of the class.
using ProjectOne.1-Business;
namespace ...
{
public class ...
always a good practice is cleaning the solution and then rebuilding it

Categories