Since I upgraded to VS2012 and Resharper 7, my previously working MS Tests are not running anymore.
The tests are run in an ASP.NET environment. I use the following Attributes:
[TestMethod]
[HostType("ASP.NET")]
[AspNetDevelopmentServerHost("C:\\Projekte\\****\\Website", "/")]
[UrlToTest("http://localhost:7924/")]
Any idea how to fix this?
As odd as it is, using VS2012, using Resharper 8.0, using NUnit, I was receiving this error because of an entry in my app.config file. I added an EntityFramework connection string and this behavior started. Removing the entire connection strings section shows the test runner starts/works again. Viewing output shows the app.config is not valid - this was causing this specific behavior in the test runner - "Test wasn't run".
I had the testproject set to AnyCPU and the project set explicitly to x86 when this happened. Setting the testproject to x86 solved it for me.
I'm using VS2012 R#8 and nUnit
Try running the Unit Tests using the MSTest Test Explorer. You might find more details in the output window of the root cause.
For me, it was a referenced assembly that was using a more recent version of NUnit than the one that was referenced in the test project. Using the same up-to-date version fixed the problem.
System.IO.FileLoadException: Could not load file or assembly 'nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.
I'd same problem I just..
Changed methods access modifier from private to public.
Removed static keyword from methods.
That's it. It worked for me. But that is for C#.
In my case it was the NUnitTestAdapter nuget that needed to be removed.
Check that any references that you have in the test project are set to Copy Local True.
I had the same problem. Couldn't get the Visual Studio test runner to work, so I tried debugging a test instead. This threw a ConfigurationErrorsException, which didn't have much of a stack trace but contained the phrase "ClientSettingProvider". I searched my solution and found that something had added a appSetting key for "ClientSettingProvider.ServiceUri" to my app.config. I deleted this (along with an empty connectionStrings element) and rebuild everything - fixed the problem!
Double check your app.config and try deleting any empty elements or anything that looks fishy.
Another (silly) problem it might be; I accidentally had the project set to not build. Go to Build/"Configuration Manager", and ensure the project is set to build.
Using VS2010 and ReSharper 9.1 the issue was that the file LocalTestRun.testrunconfig was missing but was referenced in my .vsmdi file.
The test without VS were running properly but I always had the "Test wasn't run" error in ReSharper test UI.
So I simply restored my old LocalTestRun.testrunconfig file and everything run perfectly.
I probably could have updated my .vsmdi file to not reference the missing file... I did not test that.
On VS2012, Test Project don't work on Shared Folders like \XXXXXX\XXX
I solved it copied the Test Project on local devices.
Good Luck
I found that the settings file for the unit test may need checking as to which one is being pointed to by ReSharper. I had the same thing happening and it was down to my unit tests for the RS Harness pointing to the wrong file.
I had the same issue because the test class name had the characters '<' and '>' in it (also '(' and ')' caused this issue).
Removing those symbols fixed the problem.
I could use symbols in identifiers thanks to F#'s Unicode support.
I had the exact same issue and nothing helped.
eventually I saw that I had a mismatch in my namespaces of the unit project and the unit test project.
The namespace of my unit project is unit.project and the test project was named unit.project.tests but the default namespace of the test was the same as the unit, both was unit.project.
Once I've updated the namespaces to be different (one namespace for each project) everything worked!
I had a similar problem with NUnit test, which would not be executed, but R# would only mark them as "Test wasn't run".
Executing them with the native NUnit runner revealed, that the app.config file had an error (actually, 2 ConnectionString sections). Fixing this also made the tests running in R# test runner.
I kept getting "Test wasn't run" in Resharper.. I tried all the recommendations but nothing worked. What solved it for me was running Visual Studio as Administrator. (VS2013 w/ Resharper 8.1)
Just an excerpt from MSDN regarding
Assert.Inconclusive:
The code generated by Visual Studio when creating unit tests includes
an Inconclusive statement as a placeholder.
It happens if something is wrong with the solution, the most often a misconfiguration, like wrong or mismatched namespaces, inconsistent build targets etc, what leads to the fact that UnitTestExplorer is unable to use provided unit tests properly. So the general solution is to check latest changes and fix errors.
I had the same problem in C#: Unit tests run by ReSharper all just stopped with "Test wasn't run". No other information.
It turned out to be due to my custom section in App.Config. Removing that and it worked.
Configuration: Visual Studio C# 12, ReSharper 8.2.3
It could be also that Your solution contains multiple versions of i.e. nUnit installed in different projects. In my case this was the reason of the problems. After unifying the nUnit version in the solution, the problem was gone.
Just to add to this, I had written over my app.config file with a new one that was missing some sections I needed. I added the sections back in, at which point I got this same error in resharper. Thanks to the comments above I compared it to an older version and found that I was missing the section names in the configSections.
Related
I have created a project in Visual Studio 2017 Windows. Now I am trying to work on it from Mac. While tried to build the project I can see reference to Mono.Android is not available. Also System.ComponentModel is unavailable. How I can add the reference for both of it?
I also facing the same issue mono.android is missing, finally it work by adding mono.android.dll. I did something like this in my project, in Deploy.cs file add this line
class Deploy
{
[Android.Runtime.Register("getExternalStoragePublicDirectory", "(Ljava/lang/String;)Ljava/io/File;", "")]
it show missing mono.android.dll library is missing need to add into the project. Problem solved later I comment this line.
From the picture above you can see that the reference is made to a particular file on your Windows computer which on the Mac is obviously not on that path. If you want to make the project work you should find those files on the Mac and reference them. Copying them from Windows somewhere and referencing them should work too.
But as people noted, the point of PCL project is not to contain references like this so whole the architecture of your app is wrong and that's why you see the problems. So you may want to resolve the root of the problem as this probably won't be the last thing that you encounter by doing the things in the wrong way.
When I open a generated solution+project file, I get the following warning for each platform I have in the project file:
path/to/project.vcxproj : warning : Platform '[some_platform, 0]' referenced in the project file 'project' cannot be found.
some_platform is a valid platform in the project, and building, browsing etc all work normally. There is no line number showing where the problem is.
My question is, what does '[some_platform, 0]' really mean?
Coming from Linux, I initially thought the quotes signify that I have [some_platform, 0] literally specified somewhere, which I don't. I don't see ,\s*0 used anywhere in the project file either. How do I decipher that message to be able to find out what it's complaining about?
This is a C++ project if that matters.
Edit: The only places , is even used are inside two messages and an SDK reference. So the [some_platform, 0] is definitely something constructed for the sake of warning, but what does the second part (0) mean?
Resolved: Why VS generates an output like that, I don't know, and who knows what the 0 means. However, it turned out that the platform name is something an SDK would register with VS (or something along those lines) and VS expects it case-sensitive. I had changed ORBIS and Durango to orbis and durango, causing the warning. Fixing the case makes the warning go away (the project was loading and building fine regardless).
I think you might have unmatched solution/project platform and build configurations, resulting in the rare case when visual studio defines or creates new ones: https://msdn.microsoft.com/en-us/library/kkz9kefa.aspx ending in the odd platform names '[some_platform, 0]', '[durango, 0]' and '[orbis, 0]' you have.
Now this is entirely my guess (since I could not find any documents to confirm it). But what that 0 actually means, is the reference to the default build configuration that project should use when you target those individual platforms. For instance, you usually have lines similar to this in the solution (.sln) file:{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
In the case above you would use build configuration 0 as the default build configuration when using msbuild solutionname.sln from the console. But since the entire platform was generated for that project, we of-course don't have a default build configuration either, so... lets generate. There is more details and examples of the default build-configuration in this post: Visual Studio solution file - what does the "Build.0" mean?
Now back to what might actually be your real problem. You mentioned SDK references, have you made sure they are pointing to the correct place and any environment variables is properly configured in visual studio? If not, the problem might be related to the warnings mentioned here:
Platform 'Android' referenced in the project file 'san-angeles' cannot be found. The warning message on that question sure looks similar to the warning you have, only you have those oddly generated platform names.
Hope this will help you solve the problem.
In the Solution Explorer in Visual Studio 2012, I right click on my wp8 project and go Properties, and the Application tab shows:
An error occurred trying to load the page.
Error HRESULT E_FAIL has been returned from a call to a COM component.
or
An error occurred trying to load the page.
The method or operation is not implemented.
Would anyone know how to go about debugging this?
I cannot repro this problem with a fresh project, but haven't been able to nail out where it is failing in my project...
Maybe related to AssemblyInfo.cs? Source file 'Properties\AssemblyInfo.cs' could not be found
BTW it builds and deploys to my device just fine...
Thanks
So after an exhaustive round of brute force elimination, I was able to narrow this down to my use of .java files. Yes it is weird, but it has worked. I have been including .java files in my project and setting their properties to Compile as c#. There were merge reasons for doing so, and I had of course modified the java code slightly to compile, but somehow Visual Studio's property pages spaz out when a .java file is included this way, even though the project compiles just fine. So I wrote a little tool to copy all the .java files to .java.cs and include them that way and everything is fine now!
I found this issue in all of my projects and reasoned it might have had to do with a recent Windows update. I updated VS 2017 to 15.9.15 and that resolved it for me.
I have a solution with 4 projects. In the first one I reference the other three, not with Browse, but with Add reference->Project tab.
I have all three using statements in the beginning.
The program works fine. I tested it and it works. But I'm not able to build it.
I get the error "Missing a using directive or an assembly reference".
None of my projects are on client profile. (I think .Net 2.0 doesn't even have client profile).
Why is VS doing this? How to resolve it?
Clean build was the solution. Duh.
I am trying to create unit test in VS2010 for Revit addin that I developed.
Problem is when I create unit test for a method and then run that test, I get this message:
Test method TestProject1.SimpleTestCommandTest.ExecuteTest threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'RevitAPIUI.dll' or one of its dependencies. The specified module could not be found.
RevitAPIUI.dll is properly added to references of Revit addin project, and also in references of test project.
Any idea what should I do to fix this?
You might want to take a look at this blog points Jeremy Tammik posted recently.
http://thebuildingcoder.typepad.com/blog/2013/07/revit-add-in-unit-testing.html
Make sure that CopyLocal is true in the properties of that reference.
NOTE: This is a rehash of my answer to the same question on the Autodesk forums that I'm posting here for SO users that may not look there. Apologies in advance if this is inappropriate.
The Revit API DLLs have dependencies on the Visual C++ Runtime. You need to ensure the VC++ Runtime is loaded into the process. Simply resolving the VC++ DLLs in an AssemblyResolve event handler produces an error that says that the runtime hasn't been loaded properly. I ran out of time and didn't go any further.
I'm also not convinced that unit testing with Revit types would work very well since most of them are tightly coupled to Revit's native code. That is, I don't think you could just new up certain elements to be used reliably in unit tests.