I am having a problem I am trying to troubleshoot. I developed a website in VS 2013, and am trying to set the website up for continuous integration on a server using teamcity.
I have already tested teamcity on my computer, and have it compiling perfectly using a VS2013 install.
On the server, I have everything working...except for the compilation. In order to compile the website, I installed VS Express on the server. The problem is, a new error is appearing on the server:
System.Net.Http.Formatting and
System.Web.Http
...are both missing.
Are they missing because of some error? Because I am using VSExpress instead of VS2013?
The actual error is:
Security\ApiAuthentication.cs(7, 23): error CS0234: The type or namespace name 'Formatting' does not exist in the namespace 'System.Net.Http' (are you missing an assembly reference?)
Security\ApiAuthentication.cs(12, 18): error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Security\ApiAuthentication.cs(21, 49): error CS0234: The type or namespace name 'Http' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)
Security\ApiAuthentication.cs(32, 48): error CS0246: The type or namespace name 'HttpActionContext' could not be found (are you missing a using directive or an assembly reference?)
I've got VS Community 2013 on my local, in the base install the System.Net.Http namespace exists but System.Net.Http.Formatting does not. This is the same with System.Web vs System.Web.Http.
On installing the Microsoft.AspNet.WebApi.Core NuGet package both appeared as expected and could be referenced.
Have you tried adding a NuGet Restore step to your TeamCity build before compiling? It's strange mind that these are the only errors you are seeing if there's been no NuGet restore in place. Maybe a build order issue / red herring?
Related
UnitTest1.cs(131,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
16:42:40
UnitTest1.cs(131,10): error CS0246: The type or namespace name 'TestMethod' could not be found (are you missing a using directive or an assembly reference?)
16:42:40
UnitTest1.cs(144,10): error CS0246: The type or namespace name 'TestMethodAttribute' could not be found (are you missing a using directive or an assembly reference?)
Why i cannot build the test project in Msbuild Teamcity using the
project solution file?
First of all, you should make sure that you can build your test project successfully locally.
Then, follow these suggestions:
Suggestions
First, Before Teamcity 9.1.5, you should install Microsoft Visual Studio edition on the build agent and make sure that you install the right version. Please see this official document.
Since TeamCity 9.1.5, the Visual Studio Test Runner supports Visual Studio Test Agent installed on the agent machine (Microsoft Visual Studio is no longer required). You can refer to this link.
Second, you should do the restoration of the nuget packages at VCS before build step.
See this.
I make my project based on this tutorial:
https://learn.microsoft.com/en-us/aspnet/core/tutorials/grpc/grpc-start?view=aspnetcore-3.1&tabs=visual-studio
It told me that it is missing directive or an assembly reference.
But I instal the related plugin, and the code generate successfully, I don't know why VS still can't find the code...
Here is the code content, the namespace is exist:
More info my proto properties:
Error Msg:
1>MainWindow.xaml.cs(6,7,6,23): error CS0246: The type or namespace
name 'HeartBeatMessage' could not be found (are you missing a using
directive or an assembly reference?)
1>MainWindow.xaml.cs(16,24,16,40): error CS0246: The type or namespace
name 'HeartBeatService' could not be found (are you missing a using
directive or an assembly reference?)
I found this question because I was running into this problem too. See: https://github.com/grpc/grpc/issues/20402
For now, I have manually moved the generated .cs files into my project and disabled the build step on the .proto (otherwise VS will complain about double definitions).
how i can fix this problem??
help me
Compiler Error Message: CS0246: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)
Line 1: using MySql.Data.MySqlClient;
Apologies if this is not the case but working on the assumption that you're developing in a version of Visual Studio, check the project references.
If MySql.Data exists in the references but has the warning (yellow triangle) indicator next to it then you may need to re-reference the .dll from its location in your filesystem.
Alternatively, you can grab this from the Nuget package manager if it is not available locally.
Despite the full namespace qualification, the library must be correctly referenced for the object namespace to be recognised in the IDE.
Let us know what IDE you're using if not VS.
I have created unit test project in VS12 and installed package 'SeleniumBasicAuthWrapper' from NuGet.
When I add
using SeleniumBasicAuth;
and try to build project I get following error message:
Error 2 The type or namespace name 'SeleniumBasicAuth' could not be
found (are you missing a using directive or an assembly reference?)
I opened and edited an ASP.NET MVC 3 application developed in Visual Studio 2010, in Visual Studio 2012. It was working fine in Debug mode but when I tried to publish it (release mode), it failed and threw following warnings and errors.
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "EntityFramework". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
error CS0234: The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)
error CS0246: The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'DbModelBuilder' could not be found (are you missing a using directive or an assembly reference?)
error CS0246: The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
EntityFramework.dll is present in bin folder and EntityFramework 5.0 is installed. Can this be resolved ?
What am I doing wrong while migrating this project? Microsoft says no modifications are needed when going from VS 2010 to VS 2012 http://msdn.microsoft.com/en-us/library/vstudio/jj161050.aspx#ASP.
If there is a file called packages.config in the project, open it and remove the reference to EntityFramework (something like <package id="EntityFramework" ... />). Also remove the reference to the assembly from the project (select the assembly under 'References' and delete it) and remove the assembly from the bin folder.
Now you can reinstall the package using the package manager (right click the project and select "Manage NuGet Packages").