I've installed Specflow+ and I'm using
<specFlow>
<unitTestProvider name="SpecRun" />
<plugins>
<add name="SpecRun" />
</plugins>
</specFlow>
But Resharper Unit Test Explorer doesn't show the tests. Any solutions?
The SpecFlow+ Runner has no support for the Resharper Unit Test Explorer. We currently support only the Visual Studio Test Explorer.
It is on our backlog to investigate how to bring the SpecFlow+ Runner into the Resharper Unit Test Explorer.
Full Disclosure: I am one of the developers of SpecFlow & SpecFlow+
Related
Right after installing .NET Core SDK 2.0, all tests a solution that targets the previous version of .NET Core fail to be discovered by Resharper.
Also, when I add them manually to the session and attempt to run them, I get an "Inconclusive: Test not run":
Also, there's these exceptions along with the previous message:
If I uninstall .NET Core SDK 2.0, everything works as expected. No issues at all. Tried both x86 and x64 versions, same results.
All projects in the solution target .NET Core 1.1.
Running tests from Test Explorer still works just fine.
Any ideas on how to solve this? Could it be a Resharper bug?
It seems we need to wait for a Resharper update (I've encountered exactly the same error).
Meanwhile, you can run your tests from the Visual Studio runner - it seems to be working fine.
EDIT:
You can also try installing the early version of the Resharper 2017.2 (https://www.jetbrains.com/resharper/eap/) if you feel adventurous ;) I've just checked and it works fine (as of EAP 2017.2 12) with nUnit, xUnit and MSTest tests.
I had this come up with Resharper 2018.1 using Visual Studio 2017 Preview (15.7.27617.1) and by chance I took out the underscore from one of my test classes and happened to rerun the tests and they worked!
So if anyone's still having this problem, try getting rid of underscores in your test class names if you have any.
When running unit tests using ReSharper and Jasmine as the unit testing framework I get "no tests were found in file" in my visual studio cordova project. But when I run my visual studio library project it works fine with the unit tests. It seems like in the cordova project ReSharper cannot detect the tests. Has anyone else ran into this issue? What was your resolution?
Andrew, I was able to get the jasmine tests running in ReSharper. I had to create a separate test project in Visual Studio. ReSharper was able to then recognize the jasmine code. I also had to add ///<reference src="javascript source" > for each source file that was required in my spec files.
I'm getting this error, vb / .net4, although the website is working fine, at the bottom of the page:
YAF Compiled in DEBUG MODE.
Recompile in RELEASE MODE to remove this information:
I opened up Visual Studio 2010 right-clicked my solution, looked under the "build" tab, but I cannot find anything about release mode. Could somebody please tell me where I can find this and build my site in release mode? Thanks!
I'm experiencing the same issue with VS 2010 and VS 2011 beta. I suspect a third party tool or plugin may be the culprit and am in the process of looking into this.
For now, just change the compilation switch in the Web.Config to false:
<system.web>
<compilation debug="false">
</system.web>
UPDATE 1:
I have fixed my VS 2010 issue by uninstalling Telerik JustTrace. I was still experiencing the same issue with VS 2011 beta (on a separate VM to VS 2010) though. So, I tried using a Web Application Project instead of a Website Project and the problem went away.
UPDATE 2:
This is normal for website projects as each page is compiled dynamically:
Why can't you build a website in release mode?
Make sure you have the "Standard" toolbar visible and you should see something like this:
Change the "Debug" to "Release" and rebuild your solution.
I have it right in my toolbar.
But you can also change it by using the menu Build => Configuration Manager. Select Release from the Configuration drop down next to your project.
I'm trying to find a definite explanation of what effect compiling in release mode has on a .Net 3.5 web application versus debug="false". So far it looks like setting debug="false" has the same effect and compiling in release mode has been depreciated but I can't find any firm evidence this is the case.
This question looked promising but seems to be answering what's the difference between debug and release builds rather than release mode and debug="true":
What's the difference between compilation debug="false" and Release mode?
However it does link to this article:
http://odetocode.com/blogs/scott/archive/2005/11/15/debug-and-release-builds-in-asp-net-2-0.aspx
"This new compilation model makes the Configuration Manager for a web site obsolete. The only option appearing in a Visual Studio 2005 web site “project” is a Debug configuration. Don’t fret – it means nothing. The web.config file now rules the school."
Now that is the closest I've had to an answer and it does seem to imply that release mode has been depreciated in favor of debug="false" but I can't find any confirmation of this on MSDN or any other source.
Any help would be greatly appreciated.
Update
Sorry; to clarify this is a "Web Application Project" I am referring to.
To rephrase my question slightly, if I have the following setting in web.config:
<compilation defaultLanguage="c#" debug="false">
What effect (if any) does release and debug mode compile have?
TL;DR = The more important thing is compilation debug="true|false". However, compiling in Debug has a minor effect on performance too.
The difference between Debug and Release (aside from defining the DEBUG constant or not) is the "Optimize code" flag, which is disabled in Debug and enabled in Release. (If you look at the project settings, Build tab.)
The "Optimize code" flag tells the language compiler to do some optimizations (like removing unused variables, and leaving out some debugging symbols) when producing the DLL. This is a relatively minor performance improvement (maybe a larger impact in C++ vs C#/VB) and a slight reduction in DLL memory usage, compared to when the flag is not set.
The compilation debug="true" flag tells the JIT compiler that this code should be hooked up for debugging. This reduces performance in several dimensions (load time, run time, memory, and resource loading) but enables debugging of running code.
If you want more detailed stack traces in production, then you can probably run a Debug build with compilation debug="false" with little performance difference. But I would test the performance for both to make sure you're not losing too much.
Credit belongs to this answer which links to this blog entry, and I later found this one, which contains all this info.
You have to be careful of your word choice. There are "Web Application" and "Web Site" projects.
There is no "Release" configuration for "Web Site" projects. Web sites only use the debug setting in the compilation section of web.config. If you open a "Web Site", notice the only listed configuration in the "Configuration Manager" is "Debug". You can control compilation from the project's "MSBuild Options" property page or through the "Publish Web Site" dialog.
The configurations "Release" and "Debug" work as expected for "Web Application" projects.
The idea behind 'Release' mode & 'Debug' mode is that, in debug mode, the compilation contains debug symbols which is useful for debugging but not for production, as it slows down the process.
However, 'Release' mode removes these debug symbols therefore the process runs fine without any issue.
Now, Microsoft has implemented the above model in web application projects while website project is slightly different. Hope this helps.
Here is the difference. If you have this in your web.config file:
<system.web>
<compilation debug="true" .../>
And you select Release from the dropdown in Visual Studio (note they are conflicting), would everything be compiled in debug mode or release mode?
Visual Studio knows nothing about compiling a web application. Build a web application and check the bin folder and you will notice it is empty. That is because ASP.NET compiles it. ASP.NET will use the compilation debug flag from the config file to figure out how to compile the .cs files, build forms and user controls etc. It will also use this flag to decide if it should perform bundling and minification.
This article sums it up pretty nicely:
In conclusion, you control debug and release builds using the debug attribute of the compilation section in web.config – unless you are precompiling the website with the Publish command or the Web Site Deployment tool. The WSD will let you select Debug or Release builds, precompiles the site, and modifies web.config appropriately.
I'm building an ASP.Net MVC project in TeamCity.
Can I somehow call the Publish target and get the output copied to a folder under IIS? or do I need to write an msbuild script for this?
I've written a pretty long blog post on this very topic that may interest you:
http://www.diaryofaninja.com/blog/2010/05/09/automated-site-deployments-with-teamcity-deployment-projects-amp-svn
basically:
install web deployment projects
add web deployment project to your solution
setup the solution configuration manager to have a "Deployment" build configuration
get team city to use this build switch when running the build
have a beer and wonder in glory at your automagical awesomenesss
Have you tried a Web Deployment Project (WDP)? I have multiple Web Application Projects (WAP) with associated WDPs that work great with TeamCity for deployment scenarios.
I use the sln2008 runner to build my solution (containing both the WAP and the WDP). I've modified the WDP project file (an MSBuild script) to copy the output to a network share:
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Deploy' ">
<!-- copy WDP output to \\build02\wwwroot\Belden.Web.Intranet\ -->
<ItemGroup>
<MySourceFiles Include="$(OutputPath)**\*.*" />
</ItemGroup>
<Copy SourceFiles="#(MySourceFiles)" DestinationFiles="#(MySourceFiles->'\\build02\wwwroot\Belden.Web.Intranet\$(ProjectDir)%(RecursiveDir)%(Filename)%(Extension)')" />
</Target>
I haven't tried this with MVC/WDP, but I imagine it would work the same ...
I believe you can: Publish sln. Have a look at the targets. Hopefully it will lead you in the right direction.
I also had a look at this a while ago but could but had no luck with publishing targets, maybe because my IIS resided on a different server.
Here is how I did it anyway, hope it helps TeamCity deletes files on build have a look at the accepted answer.