I have a Unit test project in Visual Studio C# and I am trying to make it a standalone exe. I have used Visual Studio Installer for it. On installing exe, i get the error that dlls cannot work.
1-Is it ok to make exe for Unit Test Project?
2- How do I package the dlls in setup exe or setup msi?
Related
So currently I have a project in Visual Studio that runs perfectly. When I build the project and create the .exe build in my Debug folder I can run it without any problems. However, when I try to share my .exe build with other co-workers the project doesn't run and crashes. At first the project described that the dependencies weren't able to be located. I then added the dependencies to the folder where the .exe program was located and it still doesn't work.
So what is the best way to create a .exe program that I can hand out to people? And is there a way to test the program in an "outside" environment on my computer? Is there a way to create a .exe program that's not located in my debug folder?
Give them the whole debug folder with the exe. It should work. To have less files and optimization from the compiler use release instead of debug mode. Give them the release folder in this case.
If you want even less files install the nuget package fody costura which will pack all .dll into the exe
If you want to create an installer, check out click once deployment.
I and a collegue of mine are running unit tests for the same project (we are getting the project files via TFS so the files themselves are the same for both of us). Also our installation of visual studio is essentially the same version (with him having set something different than me as standard for theme and keyboard. But that aside we even have the same addons installed).
When I run the unit tests they are run in the debug folder of the unit test project. If he runs them they are run in the testresults folder. We already checked the build configurations and they are the same for both of us (with deploy unchecked for both).
So my question here is how can we get his visual studio to stop running unit tests in the testresults folder and instead run them in his debug folder?
(And on that also it would be interesting why essentially identical installations of visual studio show such a different behaviour)
As an addon to this: For specific reasons the unit tests NEED to be run in the debug folder as it causes troubles if not
I am trying to run a Visual Studio 2012 solution with a normal c# dll project and a Unit test project(referencing the c# project dll) from a windows 8 app/ another c# project.
How do I trigger the run of the unit tests from another visual studio project?
Is there any way to trigger with a powershell script ?
mstest.exe is the command line test runner.
It is documented on MSDN: http://msdn.microsoft.com/en-us/library/jj155804.aspx
I see no reason this will not work from PowerShell.
I am using VS2012 (v110)
I create a simple dll application with only 1 function and a test project to test the dll function. I set up both projects to be debug builds for win32 and tried Clean and Rebuild both projects but I don't see any test to be run on the test Explorer windows.
I also reference Dll project in the test project already.
Why isn't there anything shown in Test Explorer windows?
Actually MSTest doesn't work with simple class library projects.
You will have to create a unit test project and place your tests there.
If you use other testing frameworks like NUnit, then you can use plain class library. You can then use NUnit to run the tests outside VS, or use tools like ReSharper to run those tests inside VS
It seems you have used some test frameworks other that MSTest. If you want to use Test Explorer for some other frameworks you should install its runner too. for instance NUnit needs to install its test adapter as and extension in VS.NET
see here for more.
You should be able to modify an existing class library project to get mstest to recognize it as a test project by modifying the ProjectTypeGuids in the .csproj file as detailed in this answer How to get VS2010 to recognize my mstests generated by SpecFlow? (Look for the answer that lists the specific guids and not the currently accepted answer which says to just create a new project.)
Have had a simular problem. Solved it. I have been adding tests project to my VS 2012 solution and tests were not appearing in Test Explorer. Problem was that test project was located in IIS inetpub\wwwroot folder which didn't have windows user rights to modify it. Adding solution folder Windows user rights to modify it solved issue. Tests are now visible in test explorer and able to be debugged. I assume that vstest.discoveryengine.exe process with is run by windows user was not having access to test project files
I have a Visual Studio 2010 solution that contains 3 projects: a dll project, an executable project, and the Installer project.
I am working on the dll and the executable concurrently. The executable is simply a front end for the library. While developing the two in Visual Studio I simply added a reference to the dll project from within the executable and it works fine.
What I'm having trouble with is the deployment. Ideally the dll would be compiled and installed in a subdirectory of the executable. Using the "Visual Studio Installer - Setup Wizard" project template for my installer doesn't seem to be giving me the options I need.
Am I going about this wrong by developing my backend and frontend in different projects? What steps should I take to deploy the compiled dll along with the executable? I may be going about this all wrong, so please help me understand a better methodology if this seems backwards. For all the programming I learned in college, no one ever went over what I do when I actually want to deploy my software.
Since the DLL project is explicitly referenced from the EXE project, it is automatically copied in the EXE's build folder (i.e. bin\Debug or bin\Release) and is considered part of EXE project's "primary output". As a consequence, you only need to reference the EXE from your setup project.
The installed DLL will be in the same folder as EXE. Why would you want to install the DLL in a different folder on the user's machine if it is not there on the development machine? If you are loading it dynamically and using reflection, then don't reference it from EXE, but do reference it from the setup project, which then gives you the power to set whatever target folder you want.
This is what you need to do.
On your Solution create new Project > Other project Types > Click Setup and Deployment
On The Application Folder > right click > Then Add your front end Application > Build.
Check this
Regards