I'm trying to build a project in Mono (v4.4.1) that makes use of the System.Diagnostics.Tracing dll but I continually run into build errors:
/usr/lib/mono/4.5/Microsoft.CSharp.targets (CoreCompile target) ->
Context/TplFrameworkListenerBase.cs(12,54): error CS0246: The type or namespace name `EventListener' could not be found. Are you missing an assembly reference?
Context/TplFrameworkListenerBase.cs(52,40): error CS0115: `FastTrack.Context.TplFrameworkListenerBase.OnEventSourceCreated(System.Diagnostics.Tracing.EventSource)' is marked as an override but no suitable method found to override
Context/TplFrameworkListenerBase.cs(114,55): error CS0246: The type or namespace name `EventWrittenEventArgs' could not be found. Are you missing an assembly reference?
Context/TplFrameworkListenerBase.cs(142,31): error CS0246: The type or namespace name `EventWrittenEventArgs' could not be found. Are you missing an assembly reference?
Context/TplFrameworkListenerBase.cs(147,69): error CS0246: The type or namespace name `EventWrittenEventArgs' could not be found. Are you missing an assembly reference?
I've tried also adding the nuget package as well as manually adding a reference to System.Diagnostics.Tracing.dll and including the dll in the repo. When I manually add the reference it says I have two of the same references included in the project and won't build. Is there a way to get this working or are these properties just not implemented in the newest version of mono?
Related
I'm trying to build a project using Microsoft.NETCore.UniversalWindowsPlatform version 6.2.10 and I get numerous build errors such as:
error CS0246: The type or namespace 'System' could not be found (are you missing a using directive or an assembly reference?)
error CS0400: The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?)
error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib'.
error CS0518: Predefined type 'System.Object' is not defined or imported
error CS0518: Predefined type 'System.Boolean' is not defined or imported
error CS0246: The type or namespace name 'AssemblyTitleAttribute' could not be found (are you missing a using directive or an assembly reference?)
Other developers on my team are able to build the project successfully using the exact same code.
If I downgrade the NuGet package Microsoft.NETCore.UniversalWindowsPlatform to version 6.2.9 without making any other changes, it builds fine.
I tested this by creating a brand new Blank App (Universal Windows) project in Visual Studio 2019, which uses version 6.2.9 of the NuGet package by default. I didn't make any changes to the template created by Visual Studio. This builds fine. Then I upgraded the NuGet package to version 6.2.10 without making any other changes. It fails with build errors similar to the errors above.
How do I resolve these errors?
I was eventually able to resolve this by clearing the NuGet cache, then removing and re-adding the NuGet package. Both steps were necessary to resolve the errors.
To clear the NuGet cache, click Tools → NuGet Package Manager → Package Manager Settings → NuGet Package Manager → General → Clear All NuGet Cache(s).
I am using asp.net core web application with Visual Studio 2015. I have added a reference project and implemented the method which is working fine.
Here is the screen shots
Now I have removed the dependency from project.json and deleted the project.lock.json file. I have completely removed the reference.
When I completely remove the reference I am still able to use UserViewModel and Go to definition opens the file in metadata. But I cannot use the JwtTokenViewModel.
The error details
error CS0246: The type or namespace name 'JwtTokenViewModel' could not be found (are you missing a using directive or an assembly reference?)
I did some research and found that we get cs0246 error is due to reference problem. I have followed the solution of some link but not a solution
Why am I getting error CS0246: The type or namespace name could not be found?
How can I resolve this issue. Please anyone let me know.
I just pushed a test project for travis to build, but it fails. Error:
ConsoleHelpersTests.cs(2,17): error CS0234: The type or namespace name
VisualStudio' does not exist in the namespaceMicrosoft'. Are you
missing an assembly reference?
my .travis.yml file:
language: csharp
solution: TravisDotNet.sln
Am I missing something?
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").
I'm running MonoDevelop with MonoTouch and am trying to target a device (i.e. Debug|iPhone) when building the code. However when I do that the compiler throws a bunch of errors referring to missing assemblies.
If I build to target a simulator these errors don't show up, I know I have the assemblies included and even the IDE 'sees' the assemblies and autocompletes namespaces in these assemblies as I type them out.
Any ideas what could be causing it? I've already tried fresh rebuilds...
I updated from a trial version of MonoTouch if that makes any difference.
Here are some of the errors (they're all this sort of error):
/Users/ahmedhakeem/Documents/Projects/iOS/MyCode/Engine/Util/UI/MenuObj.cs(31,31): Error CS0234: The type or namespace name `Audio' does not exist in the namespace `Microsoft.Xna.Framework'. Are you missing an assembly reference? (CS0234) (Engine-MonoTouch)
/Users/ahmedhakeem/Documents/Projects/iOS/MyCode/Engine/Util/UI/MenuObj.cs(31,31): Error CS0234: The type or namespace name `Media' does not exist in the namespace `Microsoft.Xna.Framework'. Are you missing an assembly reference? (CS0234) (Engine-MonoTouch)
/Users/ahmedhakeem/Documents/Projects/iOS/MyCode/Engine/JabJect.cs(40,40): Error CS0246: The type or namespace name `ContentManager' could not be found. Are you missing a using directive or an assembly reference? (CS0246) (Engine-MonoTouch)
/Users/ahmedhakeem/Documents/Projects/iOS/MyCode/Engine/Media/Sprite.cs(31,31): Error CS0234: The type or namespace name `Audio' does not exist in the namespace `Microsoft.Xna.Framework'. Are you missing an assembly reference? (CS0234) (Engine-MonoTouch)
/Users/ahmedhakeem/Documents/Projects/iOS/MyCode/Engine/Scene/GameScene.cs(42,42): Error CS0246: The type or namespace name `ContentManager' could not be found. Are you missing a using directive or an assembly reference? (CS0246) (Engine-MonoTouch)
If you're using MT 4.x then there were some races when the assemblies were compiled into native code. However the errors from your description looks to be from compiling managed code (and that's not done in parallel so there should not be any race condition affecting that part of the build).
That would make it (sometimes) skip an assembly at link time, leading to (hard to reproduce) build errors. This will be fixed in the next release of MonoTouch.
This never happens on the simulator since there's no AOT (compile to native) occurring in that case (i.e. the JIT is used).