Recently added Visual Studio 2022 to M1 Macbook, so I tried to add new console app and NUnit class library project in this sample project
This TDDSample.UnitTest project's target framework is ".NET 6.0.6".
Everything is building successfully, but when I try to run this unit test project, it's showing the following error:
Testhost process exited with error:
Error: an assembly specified in the application dependencies manifest (TDDSample.UnitTest.deps.json) was not found:
package: 'NUnit', version: '3.13.3'
path: 'lib/netstandard2.0/nunit.framework.dll'
Please check the diagnostic logs for more information.
Testhost process exited with error:
Error: An assembly specified in the application dependencies manifest (TDDSample.UnitTest.deps.json) was not found:
package: 'NUnit', version: '3.13.3'
path: 'lib/netstandard2.0/nunit.framework.dll'.
Please check the diagnostic logs for more information.
After deleting the unit test project and recreating the unit test project, issue able to fix, seems like some project cache problem
Related
When I try to build in vs22, it gives me an error that it cannot find some DLLs that have been added. But on VS19 the build works without problems.
I tried to change the build settings but no luck.
Error :
Severity Code Description Project File Line Suppression State Error CS0006 Metadata file 'C:\xxxx\xxx\xxx\xxx.CMS.Service\bin\Debug\xx.CMS.Service.dll' could not be found xx.CMS.Frontend C:\xxx\xxx\xxx\xx.CMS.Frontend\CSC 1 Active
Introduction
The project was newly created and there was no change in the project.
The build of the application when running the application in JetBrains Rider IDE was executed.
Successful Build
The build completed successfully
0>------- Finished building project: TEST. Succeeded: True. Errors: 0. Warnings: 0
Build completed in 00:00:34.171
Build succeeded at 04:11:43
Failed Deployment
The deployment was not completed successfully.
Deploying file MainPage.xbf...
Deploying file WinMetadata\Windows.winmd...
Deploying file resources.pri...
Deploying file TEST.exe...
installedLocation != null
I was facing the same issue when I changed IDE from VS to Rider. The problem was that I had a project with the same name in VS and it had been previously built, but I could not have found the deployed application. So I looked up for this VS project, built it, and then I deleted the application with the VS solution together. After this, I could run my Rider project with the same name without any errors.
I've used dotnet cli (2.0.0) to create 2 projects:
dotnet new webapi (name: webapiProject)
dotnet new xunit (name: testProject)
after that, on testProject project:
dotnet add reference webapiProject
test project is an integration test and it uses webapiProjects Startup.
when i do dotnet run on xunit one, all works fine. tests run, references work, all good.
But, when i load testProject.csproj in VS2017 (15.3.3), i get nuget NU1105 error:
Severity Code Description Project File Line Suppression State
Error NU1105 Unable to find project information for 'webapiProject'. The project file may be invalid or missing targets required for restore.
I am actually rather new to dotnet cli and i am not even sure i should be loading *.csproj in VS2017 but i did so because when i opened only my test class then i didn't have intellisense for it.
So, any advice would be highly appreciated about both:
the error
correct workflow
I have created a Service Fabric application and added an MSTest project in the solution to test methods in the services.
For that, I have added a service project reference to HelloWorldAPI.dll in the MSTest project.
After this, I created an automated build definition in Visual Studio Team Services (was VSO), and I'm trying to execute Visual Studio Test cases through this build. However, I am getting the below error:
> Starting task: Test Assemblies **\*test*.dll;-:**\obj\**
******************************************************************************
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.104.1\tasks\VSTest\1.0.50\VSTest.ps1
Working folder: C:\a\1
Executing C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe "C:\a\1\s\POC\ServiceFabric\HelloWorld\UnitTestProject1\bin\Debug\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll" "C:\a\1\s\POC\ServiceFabric\HelloWorld\UnitTestProject1\bin\Debug\UnitTestProject1.dll" /logger:trx
Microsoft (R) Test Execution Command Line Tool Version 14.0.25420.1
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
Failed GetHelloWorldString
Error Message:
Unable to create instance of class HelloWorld.Test.ProductContollerTest. Error: System.BadImageFormatException: Could not load file or assembly 'HelloWorldAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format..
Stack Trace:
at HelloWorld.Test.ProductContollerTest..ctor()
- ***Error Message:***
*
**
> Unable to create instance of class
> HelloWorld.Test.ProductContollerTest. Error:
> System.BadImageFormatException: Could not load file or assembly
> 'HelloWorldAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
> or one of its dependencies. An attempt was made to load a program with
> an incorrect format..
**
*
Please find the attached below configuration details in Team Services:
VSTest Configuration Details
Stack Trace:
at HelloWorld.Test.ProductContollerTest..ctor()
Failed GetAllProductListTest
Test Run Failed.
Results File: C:\a\1\TestResults\buildguest_TASKAGENT5-0026 2016-08-22 08_48_07.trx
Total tests: 2. Passed: 0. Failed: 2. Skipped: 0.
Test execution time: 0.4165 Seconds
System.Exception: VSTest Test Run failed with exit code: 1
Publishing Test Results...
Test results remaining: 2
Published Test Run : https://jci.visualstudio.com/Project%20-%20Microservices/_TestManagement/Runs#runId=3191&_a=runCharts
Is it possible to load dependent (project) assembly in the VSTest execution step?
I am too late to answer this. But today I was facing the same issue and so I thought to share my solution here. It may help someone.
Note - I am using Visual Studio 2017.
For me it was happening because of inconsistent processor architectures (32 bit / 64 bit) used across assemblies/projects.
To fix this, I set the architectures of all projects to 64 bit (x64). You can do this by right clicking your solution in Solution Explorer, then Properties > Configuration Properties and click on the Configuration Manager button.
Next I set the Default Processor Architecture of tests to x64 . You can do this by clicking on the Test menu > Test Settings > Default Processor Architecture > x64.
Make sure you are executing the library produced at the correct path - \bin\x64\Release\mytests.dll
I have to automate the way we build and deploy our SSIS projects.
We use VS2013, SQLSERVER2014 and TFS2015. I'm already aware of two solutions:
1) MSBuild: I followed this blog https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/ and it works fine for VS2010 but unfortunately not for VS2013.
The error I'm getting is:
Project "SSISTest\SSISTest\SSIS.MSBuild.proj" on node 1 (SSISBuild target(s)).
SSISBuild:**************Building SSIS project: ..\SSISTest\SSISTest.dtproj for onfiguration: Development**************
------
Loading project file '..\SSISTest\SSISTest.dtproj'
Setting output directory to '..\SSISTest\bin\Development'
Setting project ProtectionLevel to 'DontSaveSensitive'
Loading package '..\SSISTest\Package.dtsx'
error : Error while loading package '..\SSISTest\Package.dtsx': The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.\r
error :
error : The package failed to load due to error 0xC0011008 "Error loading from XML. No further detailed error information can be specified for this problem because no Events object was passed where detailed error information can be stored.". This occurs when CPackage::LoadFromXML fails.\r
error : \r
error : at Microsoft.SqlServer.Dts.Runtime.Package.LoadFromXML(String packageXml, IDTSEvents events)\r
error : at Microsoft.SqlServer.IntegrationServices.Build.DeploymentFileCompilerTask.LoadPackage(String path)\r
error : at Microsoft.SqlServer.IntegrationServices.Build.DeploymentFileCompilerTask.Execute()
Done Building Project "SSISTest\SSISTest\SSIS.MSBuild.proj" (SSISBuild target(s)) -- FAILED.
2) devenv: works fine but our projects are all protected with a password, and everytime you try to build it prompts the dialog to insert the password.
Is there any other way I can automate this in VS2013?
I'll answer myself. After adding the proper dll references (expecially the Microsoft.SqlServer.ManageDTS one) for VS2013 to the http://sqlsrvintegrationsrv.codeplex.com/SourceControl/latest project, generating the .dll allowing MSBuild to build SSIS project as suggested by https://speaksql.wordpress.com/2013/06/07/a-journey-to-db-deployment-automaton-ssis-build-using-msbuild/, worked just fine. I'm now able to automatically build SSIS projects with MSBuild and deploy them to a SQL Server 2014 instance.