Questions tagged [cs0246]
17 questions
1
vote
1 answer
Error when creating new Unity projects and in all existing projects
I'm getting the following error in all of my unity projects and the new projects I create. I can not find a solution for this. I even tried uninstalling Unity, Unity Hub and Visual studio. Then reinstalling but still same issue. I'm using Latest…

Malith Withanage
- 11
- 1
1
vote
1 answer
My Blazor .NET Core 5.x "@inject IJSRuntime JS" statement is getting a CS0246 error from Visual Studio 2019
I am working with Blazor and .NET Core 5.x and I am trying to get some JavaScript to work, but the dependency injection statement is not working. Here is what I have:
_Host.cshtml:
@page "/"
@namespace MyAwesomeApp.Pages
@inject IJSRuntime…

Brian
- 1,726
- 2
- 24
- 62
1
vote
1 answer
CS0246 error while trying to create xUnit tests
I'm not even trying to test anything there yet, just wanted to create an instance of class Book(that I would like to test in the future) in my testing BookTests.cs file. I've added reference to GradeBook.Tests.csproj as whole source code to…

suszonko
- 15
- 3
1
vote
0 answers
How to quickly clear thousands of CS0234 errors in Visual Studio 2019
This is a shared project that was working for me until today. It still compiles without errors in our CI system and for all of my teammates, but my computer started getting more than 3000 CS0234 errors when I compile this solution.
I tried cleaning…

bikeman868
- 2,236
- 23
- 30
1
vote
1 answer
How to define constraint for generic interface where-clause
C# has no preprocessing and I don't want to define "struct, IComparable, IFormattable, IConvertible" for all interfaces, that need this constraint. What I need is something like:
Named constraint "IMyItemConstraint" for several generic interface…

Torsten Crull
- 123
- 3
- 9
0
votes
0 answers
mrtk2.6.2 Error in VS2019 CS0246, and it cannot recognise MRTK
This Error is only in VS2019.
This Error never happens before. Idk if it was becasue i misclicked something in VS.
In Unity there is no Error message and everything works fine, even playmode.
But when I open a random script that is using methods in…
0
votes
0 answers
How to resolve a namespace as root in C# [CS0234]
Specifics:
When specifying a BindingSource in WinForms the toolchain sets the DataSource to the type you're associating using absolute namespaces (to avoid any using statements). I'm using a data type Project.Namespace1.MyType, but the compiler is…

ElectricErger
- 93
- 7
0
votes
0 answers
How to fix error in radaeePDF xamarin setup (CS0246)?
I was following the setup instructions to add radaee xamarin module into a xamarin proyect. I followed the instructions step by step until step 9 just after adding the AndroidManifest.xml lines and trying to do step 10 where you declare the…

Lorem
- 23
- 5
0
votes
1 answer
The type or namespace name 'SyncListString' could not be found (are you missing a using directive or an assembly reference? in mirror
Hey i am beginer and i am making a multiplayer game using mirror by watching https://www.youtube.com/watch?v=w0Dzb4axdcw&list=PLDI3FQoanpm1X-HQI-SVkPqJEgcRwtu7M&index=3 this video in this video he has maded match maker script and i have maded it…

D.B.G OP
- 1
0
votes
1 answer
CS0246 errors when I attempt to run tests
I'm trying to creat a contract test in VSCode. I have this C# test class:
using xunit;
namespace PactTests.PactTests
{
public class ConsumerTest : IClassFixture
{
private IMockProviderService _mockProviderService;
private…

runnerpaul
- 5,942
- 8
- 49
- 118
0
votes
2 answers
error CS0246: The type or namespace name 'MySql' could not be found
im trying to connect to my mysql database for my project but im getting the following error:
error CS0246: The type or namespace name 'MySql' could not be found
full error:
[Running] mono…

aidan
- 85
- 1
- 2
- 8
0
votes
0 answers
How to fix 'CS0246' error in Entity Framework
I have a web page using Entity Framework that stopped working. I'm rebuilding it in VS2017. I have no errors when compiling, but when accessing the webpage I get:
Compilation Error
Description: An error occurred during the compilation of a…

Shaun
- 1
0
votes
1 answer
How can I recover information or fix the c # error cs0246?
I am getting this error in My project:
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'fooroshEntities' could not be found (are you missing a using directive or an assembly…

Roya Abasnejad
- 1
- 1
0
votes
1 answer
Why I cannot use HttpResponseMessage class?
I'm new to ASP.NET Web API and want to make HttpResponseMessage instance from a utility class I made. Then I made very simple class.
But following compile error occurred.
CS0246: The type or namespace name 'HttpResponseMessage' could not be
found…

Master.D
- 19
- 1
- 5
-2
votes
1 answer
Error CS0246 the type or namespace name 'XXXX' could not be found (are you missing a using directive or an assembly reference?)
"Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'BLLV2' could not be found (are you missing a using directive or an assembly reference?) DMS_WEB…