In my solution (under VS2008) I have few web projects, few class libraries, unit test project.
It seems like during solution conversion to VS 2010 the target framework for UnitTest projects was changed to .NET 4.0
When I try to change it back (I need to check how system works in .NET 3.5 and compare with current behavior) I am receiving the following error:
Attempted re-targeting of the project has been canceled. You cannot change the specified .NET framework version or profile for a test project.
Why I can't change it? How can I do?
Thanks a lot!
Unfortunately, found a negative answer:
http://connect.microsoft.com/VisualStudio/feedback/details/483939/unable-to-change-target-framework-version-on-unit-test-projects
closed as "Won't fix"
http://connect.microsoft.com/VisualStudio/feedback/details/514130/visual-studio-2010-beta-2-silently-upgrades-mstest-test-projects-to-net-4-0
clase as "by design"
:(
P.S. I like one of the suggested workarounds: don't use MS Test :)
Related
We are using Visual Studio 2012 and Team Foundation Server 2010 in our project. Since, we are using Microsoft Fakes, we could have not used the started Test functionality of our Team Build 2010, I have created a build activity which invokes VSTest.Console.exe passing the test assemblies. This approach has been working well for us. However, after a recent check-in we are getting the following error when executing Vstest.console.exe
Error: An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object.
I copied the binary files to my local machine and was able to get the error again. Interestingly, we run a dev build before check-in which runs the same vstest.console.exe with the same parameters and that works correctly. I have got two folders on my machine, for one the call works fine and for other it doesn't. The compiled assemblies look same size and there aren't much differences to suggest.
I tried using Process Monitor but couldn't find anything obvious other than that the process returns with an exit code 1. Does anybody know much about this error? Is there any way I can find out more information from my test run?
Regards,
Hamid
We got to the bottom of the problem. We are using Entity Framework 5.0 and we also have a situation where some of our test assemblies are targeting .Net 4.0 and some are targeting .Net 4.5.
When we are trying to run the tests such that assemblies targeting different versions of .Net framework and using Entity Framework 5.0 are run in the same Test (vstest.console.exe) process, we get this error.
I think this has to do with the way Entity Framework 5.0 ships with two versions (net40 and net45). Once one version of the library is loaded in the process, the other version cannot be loaded and this caused the error.
I had the same error message just now with Visual Studio 2017 using the new MSTest.Framework and MSTest.TestAdapter (to be able to use Live Unit Testing). It turned out I was using multiple versions of those packages in my solution. Consolidating them to the latest version solved the problem.
This is what worked for me:
In Visual Studio, Test -> Test Settings -> Default Processor Architecture -> X64.
Though it might not solve everyone's issue, hope it helps some of you out there.
I have the same error specified in the subject when in the AssemblyInfo of the project is specified the AssemblyAttribute:
[assembly: AssemblyCulture("en")]
If this attribute is present, the run of the unit tests fails.
If I remove this line of code or I remove the en language, the run of the unit tests success.
An exception occurred while invoking executor 'executor://mstestadapter/v2'
I had multiple TestAdapter's and TestFramework's in my BuildAgents Folder, deleting the v1.1.11 versions fixed the issue:
This happened to me recently in VS 2019. Using NuGet to update to the latest versions of MSTest.TestAdapter and MSTest.TestFramework solved the problem for me.
I tried everything on the web to solve this exception. Finally I solved this issue by installing the Update v4 of Visual Studio 2013 (which is that I'm using currently). Hope it helps!
Deleting app.config and packages.config, if exists, and reinstalling Entity framework via nuGet packages works for me.
Thank you for taking some time to check my question,
so I need to build corelDraw 6 add-in using VB.NET
so I take 2 ways (1) just try to use VSTA editor ,but didn't work :( I got this error, try to switch .NET version to 3 or 2 but didn't work too, just show the following message >>>>>>>>>>
CorelDRAW
Unable to attach. Check for one of the following.
The application you are trying to debug uses a version of the Microsoft .NET Framework that is not supported by the debugger.
The debugger has made an incorrect assumption about the Microsoft .NET Framework version your application is going to use.
The Microsoft .NET Framework version specified by you for debugging is incorrect.
Please see the Visual Studio .NET debugger documentation for correctly specifying the Microsoft .NET Framework version your application is going to use for debugging.
any advice ...?
(2) I used my VS 2010 and created a class library project ,then used the code in the VSTA and inserted all related references to corelDraw -> build -> all goes well I got my dll file :( but how to make it work as add-in inside corelDraw 6
any advice ...?
Thank you So much,
Ooh I just solve it :)
I copy the dll file which I did using VS2010 in C:\Users\\Documents\Corel\VSTA\CorelDRAW\Addins
re-open corel and it just worked, thank you all
any idea answer about way (1) will be reate too, thank you
I am using VS2010 and I am making a call to a vendor's web service, which they use WSE i web services. I can not find in "Add references" to add the namespace/dll. It works when i created a project in VS2005.
I Found this blog and it indicated on how to get it recognized.
http://www.junasoftware.com/blog/how-to-use-wse-3-in-visual-studio-2010.aspx
but after trying that it still doesn't work for me. Anyone have any ideas for me?
Thanks,
Marios
I solved this problem by downloading the WSE Runtime from here
The way to fix this is to generate the Webservice in Visual Studio 2005 then copy the code into just a class in VS2010 and use it as a class instead as a Webservice. It's not the best wey for keeping things standard but it works flawlessly!
For me, even after adding the reference to the local copy of Microsoft.Web.Service3.dll, I still had to change the project to be geared for .NET 4.0 and not .NET 4.0 Client.
Microsoft.Web.Service3.dll has a dependency on System.Web, which doesn't exist in the .NET 4.0 Client, but does in .NET 4.0.
This factoid was noted in the Error List, in the Warnings.
Only the fact that the Microsoft.Web namescape could not be found was in the Errors.
-Jesse
I ran into the same problem when used SAP Business object dlls.
I installed WSE from (http://www.microsoft.com/downloads/en/details.aspx?FamilyID=018a09fd-3a74-43c5-8ec1-8d789091255d&displaylang=en) and added reference to my project.
It solved the issue
I have installed VS 2010 and want to migrate all code written in VS 2005 to VS 2010.
Please note that we do not have VS 2008, all code are in C# 2.0 and Asp.net 2.0 only.
Can anyone please tell me now what all points need to be considered while migrating.
Update:
I have set target framework to 2.0 for all of my Libraries and web projects. It complies without any error!
However, when site opens in IE (Set to default.aspx), it gives me error as below:
InternalXmlHelper.vb(9) : error BC30560: 'ExtensionAttribute' is
ambiguous in the namespace 'System.Runtime.CompilerServices'.
<Global.System.Runtime.CompilerServices.ExtensionAttribute()> _
Keep all the target framework settings to .NET 2.0. This way, there should be no compilation problem at all.
The changes that you should see are the solution and project files only.
Start with known good solutions in source control (and label—you shouldn't need to go back, but easy to add an extra safety net).
Open each solution in VS2010, allow the conversion wizard to do the conversion.
Resolve any issues.
Honestly, if you're just upgrading VS 2010 you don't really need to consider much. Just keep backups (any real SCM product will do) and you're good. You don't have to upgrade your applications' runtime targets at all if you don't want to.
If you're building with CAS policy, you might run into issues with using MSBuild 4.0 to build you 2.0 applications. If you don't know what I'm talking about, never mind.
My advice is to make sure everyone's "checked in" to your source code provider, and run the conversion wizard and see how it goes.
Duplicate: Why are C# collection-properties not flagged as obsolete when calling properties on them?
I just migrated a .NET 1.1 project to .NET 2.0 using Visual Studio 2008. I know that there are references to obsolete methods in the project.
But Visual Studio does not show "obsolete"-warnings after building. The build succeeds and shows only 3 warnings from members that are assigned a value that is never used. When I remove these members there are no warnings at all.
I NEED THESE "OBSOLETE"-WARNINGS
The Warning level is 4 (maximum), Warnings are enabled.
Just one sample:
protected internal DataConnector()
{
_connectionString = ConfigurationSettings.AppSettings["ProductConnectionString"];
}
All references that should result in an "obsolete"-warning are to members of classes of the .NET Framework.
Is the code calling the obsolete method(s) itself flagged as obsolete?
Just taking a shot in the dark here, but is the usage of an obsolete member taking place in a project that you're REFERENCING, and when you're building it isn't actually rebuilding that project? If that's a possibility, I would try manually building the project where the usage is taking place, or just rebuilding the entire solution.
Make sure you are doing a full build on the project, not just an incremental build.
Jeff Yates is right, this is a duplicate to Why are C# collection-properties not flagged as obsolete when calling properties on them?
It is a bug in the C# 3.5 compiler reported here:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=417159
I checked it: copied the csc.exe commandline from the output window to a cmd-console. When I change the directory to the .NET 2.0 directory (using C# 2.0 compiler), it shows the warnings. Microsoft knows this bug and fixed it in C# 4.0 but will not fix it in the 3.5 version.