How to add a separate test project to my application in VS2012 - c#

I have a windows 8 app project developed in Visual Studio 2012. Now I would like to write a separate test project and remotely test some functionality without getting into the apps source code. This saparete project should be able to give some input to the main project and also track the output as well. (In this case I think I might have to expose some of those methods in the app to be used externally)
I have this fuzzy idea but Im not sure how exactly to implement it. Any clues about the possibility of it and if yes how can I do it.
Thanks.

Related

Importing winform solution to mono (linux) from VS Code (windows)

I tried to import a winform solution file from VS code (windows) to monodevelop (Linux) but it failed. The error is as follows:
Error while trying to load the project '/home/virtuall_kingg/Camera_GUI/Camera_GUI/Camera_GUI.csproj':
File not found: /home/virtuall_kingg/Camera_GUI/Camera_GUI/Camera_GUI.csproj
I added Camera_GUI.csprojfile also but still the error is same.
Can anybody guide me on how to import solution to mono?
This winform project has become pain in my neck.
Is building the GUI using gtk# in Ubuntu from scratch is the only way?
EDIT: Now you can substitute mono with .NET 5, the common .net framework for all platforms.
You are asking multiple questions here. In Linux you have (limited) support for WinForms through Mono. Depending on how complex is your project, you could port it without modification. If there are p/Invokes, then you won't for sure be able to port it.
Yep, in Linux the "other" big option is Gtk#, which has a long history. If you would want to port the project starting from scratch, it'd be a good option, but it'd involve porting your classes from working with WinForms to Gtk#, which is not impossible, but not trivial either. The feasibility of this would mainly depend on how good that project is architected. Do you have bussiness logic and views separated? If the answer is no, then the process will be tedious, and as hard as lengthy.
MonoDevelop is an IDE for C#, and Visual Studio for Mac is roughly MonoDevelop. It certainly works in Linux... as well as Visual Studio Code. So, there is no need to change anything in that front if you just need to port your code to Linux.
Okay, now, what's the road to follow? I think the best one is to try Mono with WinForms. It'd maybe involve simplify some code in the user interface part, but is certainly feasible. Just remember that you need to install Mono, and if your project is set to target .NET Core, then you need to create another project from scratch and set it to target .NET Framework.
Now, the specific question is that MonoDevelop complains about a missing Camera_GUI.csproj. This means that you've only picked a few files, but not the whole solution. Any IDE (Visual Studio, Visual Studio Code, Rider...), would complain about the same thing. Either remove the project from the solution, or add the project with all its files to the directory in which the solution sits.
So, the answer is: don't change anything if you don't need to retarget your project. Just move to a Linux box or virtual machine, with the whole project and open it in Visual Studio Code Rider, Rider, or MonoDevelop it does not matter. From within the IDE, remove those projects that make no sense in Linux (i.e., windows installer), and then recompile and start the program. Polish those parts of the user interface that need tweaking and that's it.
Should you need more help, please be more specific and provide more info.

Understanding project types in a Visual Studio web application

I'm trying to make some changes to an old ASP.NET Web Application project developed by someone a couple years ago in VS2015. The project seems to comprise of many subprojects. In the following image, the icon of each subproject seems to indicate a specific type of the project. Could someone please explain each of these types by looking at the icon?
Visual Studio displays different icons for some "special" project types, which obtained from its internal GUID in the project file, and assigned when created from the proper templates. In the screenshot, they mean:
A window with a globe: Web application. A project that serves a dynamic ASP.NET web page.
A window with an Erlenmeyer flask: Test project. A project that contains unit tests authored with the MsTest framework.
A box with the C# legend: Everything else. It can be a class library, a normal windows or console program, or any other project that Visual Studio doesn't recognizes, but always writen in the C# language.
A window with the Visual Studio logo: The loaded solution containing all other projects.
However, don't put too much faith in those icons being representative of anything meaningful. They appear when you use the suggested procedures in Visual Studio to create them, but if you deviate enough from the tutorials, they'll all end up showing generic icons. Therefore use descriptive names for them.
Since you have the solution, you could right click on the project, then on the application (first option), see whats under output type: That should give you more info.
One with c# icon is either class library or win form or wpf (check output in prop)
one with flask icon is some kind of unit test project
one with circle/world is a asp.net web app (.net framework)
By the way, if you have other project icons, you could open add new project window in visual studio (by right clicking on the solution, then add, then new project OR from the menu File.New.Project) and go through the list and compare. It may not be efficient, but there aren't many project types anyway.

Visual Studio 2015, C# and creating releases

This is a question for which I need someone to give me some pointers and point me in the right direction. Not a "suggest-a-sulution-code" question:
How do I create a stand-alone release of a C# Windows Froms application that uses a couple of NuGet packages AND an external library (AutoIT)?
The application is a simple forms application which uses Selenium Webdriver for opening and accessing a browser. In addition to this, it uses a library called AutoIt, for handling windows operations.
In my VS project I've installed Selenium Webdriver with NuGet, and added the AutoIt libraries manually as externals.
The resulting .exe file created after build does not work on another computer when I just copy it over. The GUI and functionality works, but the AutoIt library is not included. This is probably logical, and due to my lack of knowledge regarding building windows applications. But how do I do this? How do I build a release which can be used by others, which includes any external libraries used by the application? Do I have to manually get all DLL files relatedt to the project, or is there a way to package things to make it easier?

Visual studio 2013 and oracle - project properties problems

Hi I'm trying to create a new project in C# where I can include the oracle instantclient_12_1
I start by simple creating a project in C# (windows form project) but when I want to include the path to the dll's I'm trying to do it as indicated.
The general steps to install Instant Client are:
Download the appropriate Instant Client packages for your platform. All installations require the Basic or Basic Lite package.
Unzip the packages into a single directory such as "instantclient_12_1".
Set your environment's library loading path (for example LD_LIBRARY_PATH on Linux, or PATH on Windows) to the directory created in Step 2.
Start your application.
But I'm stuck at point 3: the windows should look like the following:
I'm just making a right click on my project and then go to properties in the solution explorer.But I just get the following window:
(I'm just making a right click on my project and then go to properties in the solution explorer.)
What am I doing wrong? (And gosh, yeah I know I hate visual studio but this is an obligation by owr teacher. Linux is this much simpler...)
Thanks for any help, the initial idea is to make an project where I can work with oracle but it tells me I got the wrong version. (Another annoying thing from Windows..)

How to add and compile windows forms in Visual Studio project using a GUI, and not directly from Visual Studio?

I am developing a project in Visual Studio 2008 with a team of 5 people. Each of the 5 people develop Windows forms and a repository in maintained on the server. The problem is that I have to individually compile each form manually after opening Visual Studio and adding the forms in the project.
I want to add and compile the forms using a GUI and not Visual Studio as such. Is this possible?
Basically, the solution lies in programmatically adding Forms to Visual Studio Project I am not sure if such an application could be developed. Any help will be highly appreciated.
Thanks!
The problem is that I have to individually compile each form manually after opening Visual Studio and adding the forms in the project.
You can csc.exe which is a commandline C# compiler. Make a script that pulls the code and compiles it.
I want to add and compile the forms using a GUI and not Visual Studio as such
I don't understand .Do you want to add and compile forms using a GUI app or add GUI?
Basically, the solution lies in programmatically adding Forms to Visual Studio Project I am not sure if such an application could be developed
If you had already a project that is set-up (dependencies) is it fairly easy. You have to add C# code to the source code. It depends on the size of a modification, but it should be done with a couple of lines of script.
You could either develop scripts to execute msBuild tasks from the command line (command line reference) and develop a GUI to start a shell to run those, or you can use the csc.exe from a script/command prompt to do the compilation manually.
The MsBuild option will be useful if you have project files you want to build, the csc option is more low level and will require more work but will not require you to have a project file, just the source code files and dependencies.
This sounds like the wrong way to go though. Are you sure that you don't want to develop an application that can have plugins? then you develop each form to an interface and package it up in its own dll, and have the application load the plugin dlls and extract out the forms which implement the particular interface. That way you build the app once, and can add new forms without having to recompile at all...
You might want to consider using a plug-in/add-in framework such as MEF or MAF. Team members can then be responsible for their own forms which are popped into a plug-in for you to use.
Choosing between MEF and MAF (System.AddIn)
Such a thing allows you to dynamically control how forms/controls are displayed at runtime or depending how you implement the plug-in system, allow you to drag-n-drop your layout at design time.
Much like user controls.

Categories

Resources