How to setup build system without visual stduio for .NET MVC web application?
Actually i have installed the following items on build server,
Latest .NET framework
Microsoft Visual Studio shell (isolated)
MSBuild tools
Visual Studio C++ build tools & Web Deployment build tools
Latest WiX Toolset
while running build getting the following errors,
Errors:
error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
error CS0246: The type or namespace name 'HttpConfiguration' could not be found (are you missing a using directive or an assembly
reference?)
error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
error CS0246: The type or namespace name 'ApiController' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'ActionFilterAttribute' could not be found (are you missing a using directive or an assembly
reference?)
error CS0641: Attribute 'AttributeUsage' is only valid on classes derived from System.Attribute
error CS0246: The type or namespace name 'HttpActionExecutedContext' could not be found (are you missing a
using directive or an assembly reference?)
rror CS0246: The type or namespace name 'HttpPost' could not be found (are you missing a using directive or an assembly reference?)
Did i miss anything to be installed on the Build System prior to start build?
Guide me to over come these errors.
Update:
I resolved the above errors by installing MVC4 framework. But i am still having other below issue for VP8 & WebM projects.
error MSB4019: The imported project "C:\Microsoft.Cpp.Default.props"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
Related
I am getting the below errors in my code in the Hooks file and Step definition file while working on the .net 4.6 framework(Visual Studio 2019). Please let me know if I missed any of the specflow packages. If I # using TechTalk.SpecFlow; it gets highlighted in red. Please let me know if I am missing assembly reference. Do I need to install any other specflow package?
Errors:
Error CS0246 The type or namespace name 'GivenAttribute' could not be found (are you missing a using directive or an assembly reference?).Error CS0246 The type or namespace name 'BeforeScenario' could not be found (are you missing a using directive or an assembly reference?) Error CS0246 The type or namespace name 'BindingAttribute' could not be found (are you missing a using directive or an assembly reference?).Error CS0246 The type or namespace name 'Binding' could not be found (are you missing a using directive or an assembly reference?).Error CS0103 The name 'ScenarioStepContext' does not exist in the current context
Also attaching the packages list:
SpecFlow version is 3.9.8, SpecFlow.MsTest version is 3.9.8, SpecFlow.Tools.MsBuild.Generation version is 3.9.8 and targetFramework is net46
Do I need to install any other specflow package?
I'm trying to build a ms test project in a nuget app.
My project structure is this:
MyPackage
--> MyPackage
--> MyPackageTest
If I open VS and right click and build MyPackageTest it works. If I go to cmd and type this I fails:
msbuild .\MyPackageTest\MyPackageTest.csproj /T:build "/p:Configuration=Release"
I get errors like this:
"C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj" (build target) (1) ->
(CoreCompile target) ->
MyTests.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(13,4): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(13,4): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(13,4): error CS0246: The type or namespace name 'TestClassAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(13,4): error CS0246: The type or namespace name 'TestClass' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(17,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(17,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(38,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(38,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(59,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(59,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(75,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(75,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(91,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyOtherTests.cs(91,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(16,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(16,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(36,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(36,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(50,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(50,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(65,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(65,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(81,6): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
MyTests.cs(81,6): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?) [C:\Users\me\MyPackage\MyPackageTest\MyPackageTest.csproj]
EDIT: to add, msbuild also throws this error: Could not locate the assembly "Microsoft.VisualStudio.QualityTools.UnitTestFramework"
I can build this project in VS but not with msbuild
First of all, if you use CMD to call MSBuild, please make sure that you set the right path for the path of the Environment Variables. Just like C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin(VS2017 Community version and the MSBuild.exe exists in this path).
Besides, l assume you have a local project called MyPackageTest which created by the local VS and then you migrate it to the build server without VS.
Actually, the issue could be caused by the missing packages which lost during migration to build server. Meanwhile,MSBuild with command line will not restore the missing packages since you have migrated it into the Build Server. However, when you use VS IDE, the build process will restore the missing packages automatically during the build process.(Tools-->Options-->Nuget Package Manager-->General-->Packages Restore).
Suggestion
So please run the msbuild -t:restore first to restore the required packages.(Go to the project path first and do this).
Then type this below:
msbuild .\MyPackageTest\MyPackageTest.csproj /T:build "/p:Configuration=Release"
In addition, you would better use Build Tool for VS2019 or Build Tool for VS2017 and please make sure that the build tool version is the same as the VS version which creates the project.
Second, when you use Build Tool, also make certain that you have installed the Testing tools core features in the individual components of vs installer.
Hope it could help you.
Try running msbuild in a new cmd window everytime as a temporary workaround.
This works everytime for me and is what I currently do. I think running msbuild(with or without vsdevcmd) changes some environmental variables/settings which affects the subsequent msbuild runs.
I faced the same problem a while ago which greatly affected my productivity. I think it started after upgrading to VS2019. My solution didn't involve any nuget packages, but msbuild would fail randomly with these errors.
I have been trying to deploy my web application to azure for two days now. I had finished programming the application and its working properly locally, when i pushed to application to github, and I'm using my student starter plan to deploy it. The application starts deploying then it fails with errors. The errors are below
/usr/share/dotnet/sdk/3.0.100/Microsoft.Common.CurrentVersion.targets(2106,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.Extensions.Identity.Stores". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolRole.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolUser.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyRole.cs(1,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyUser.cs(2,17): error CS0234: The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolRole.cs(5,31): error CS0246: The type or namespace name 'IdentityRole<>' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Administration/SchoolUser.cs(7,31): error CS0246: The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyRole.cs(5,32): error CS0246: The type or namespace name 'IdentityRole<>' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
Tenancy/TenancyUser.cs(7,32): error CS0246: The type or namespace name 'IdentityUser' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/SchoolManager.Models/SchoolManager.Models.csproj]
1 Warning(s)
8 Error(s)
I had even changed the host now to Azure DevOps but it still show me the same thing. This has pushed me to rewrite the application from start. It runs locally okay but when i publish it, it fails.
I too faced the same issue. While publishing VS build was failing with - Unable to find dependent project references, but with release version I was able to build the solution.
The fix which worked for me was -
Update VS version to Version 16.7.3.
With this version project build passed successfully and I was able to deploy the packages...in earlier version I think there was a problem with dependency resolver.
So, I MUST use C# for a uni course, just like I MUST use MSSQL Server, the big problem is that I'm running Ubuntu. I followed this guide, I mean it's from microsoft right? Can't get any of System.Windows.Form working, neither SqlDataAdapter and many more(like 99.65% of the libraries).
Anyone encountered this issue before? Or you just created a VM and waited a week for Visual to install?
This is what I get when I run dotnet run
Program.cs(4,22): error CS0234: The type or namespace name 'Forms' does not exist in the namespace 'System.Windows' (are you missing an assembly reference?) [/home/potra/Desktop/School/School/DBMS/Test/Test.csproj]
Program.cs(8,28): error CS0246: The type or namespace name 'Form' could not be found (are you missing a using directive or an assembly reference?) [/home/potra/Desktop/School/School/DBMS/Test/Test.csproj]
Program.cs(10,17): error CS0246: The type or namespace name 'DataGridView' could not be found (are you missing a using directive or an assembly reference?) [/home/potra/Desktop/School/School/DBMS/Test/Test.csproj]
Program.cs(11,17): error CS0246: The type or namespace name 'DataGridView' could not be found (are you missing a using directive or an assembly reference?) [/home/potra/Desktop/School/School/DBMS/Test/Test.csproj]
Program.cs(12,17): error CS0246: The type or namespace name 'SqlDataAdapter' could not be found (are you missing a using directive or an assembly reference?) [/home/potra/Desktop/School/School/DBMS/Test/Test.csproj]
The build failed. Please fix the build errors and run again.
The latest .NET Core, 2.1 Preview 2, does not include System.Windows.Forms.
If you'd like to use a native Ubuntu runtime, Mono supports WinForms and SqlClient.
For more information, the .NET documentation explains how .NET is implemented.
After I installed the SDK on our new Windows 7 build machine, I got errors from our unit test project:
DsHelperTest.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
SKMTest.cs(3,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
UserTest.cs(2,17): error CS0234: The type or namespace name 'VisualStudio' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)
DsHelperTest.cs(30,11): error CS0246: The type or namespace name 'TestContext' could not be found (are you missing a using directive or an assembly reference?)
DsHelperTest.cs(42,10): error CS0246: The type or namespace name 'TestContext' could not be found (are you missing a using directive or an assembly reference?)
DsHelperTest.cs(60,40): error CS0118: 'TestSystemSoftware.DsHelperTest.TestContext' is a 'property' but is used like a 'type'
SKMTest.cs(23,17): error CS0246: The type or namespace name 'TestContext' could not be found (are you missing a using directive or an assembly reference?)
any idea? needs to install another library package? we don't plan to have visual studio 2008 installed on that build machine.
thanks,
The Unit testing assemblies are not included in the Windows SDK. They are specific to Visual Studio. In order to run your tests you should setup a Controller with a Test Agent on the machine.
The Microsoft.VisualStudio namespace is part of the Visual Studio SDK, not the Windows SDK.
http://msdn.microsoft.com/en-us/library/microsoft.visualstudio(v=VS.100).aspx