My project is hosted on github. Everything gets compiled fine on my local machine, but AppVeyor reports some weird errors like:
Properties\AssemblyInfo.cs(9,12): error CS0246: The type or namespace
name 'AssemblyTitle' could not be found (are you missing a using
directive or an assembly reference?)
It looks like some base references are not recognized. Is PCL supported on AppVeyor? I could not find any info.
What can I do to fix errors?
Related
I'm going to run the ASP.net website on Visual Studio 2019
It used the ASP.NET MVC framework With NHibernate.
The solution has 5 projects including Domain, UI, Media, Resources, ...
When building the solution, gets these errors.
CS0234 The type or namespace name 'MediaServices' does not exist in the namespace 'ESK.Business' (are you missing an assembly reference?) Pazar.Domain E:\project\esk\src\Domain\ESK.Domain\Subscribers\MoveMediaCommand.cs
CS0234 The type or namespace name 'Resources' does not exist in the namespace 'ESK' (are you missing an assembly reference?) ESK.Domain E:\project\esk\src\Domain\ESK.Domain\BackgroundTasks\BetterTask\Commands\TaskNotifyGalleryOnCreateEmailCommand.cs
The first error is concerned soap service but I can't resolve it.
The second error is concerned the Resources project that has the App_GlobalResources package.
Please help me to fix these errors. I think it's ABC in programming.
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.
I set up an ubuntu 16.04 machine with Jenkins, nodejs, and .net core 2.0, and then tried to have it build my .net core 2.0 web application. It failed with the following message(s):
16:32:26
/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5):
warning MSB3245: Could not resolve this reference. Could not locate
the assembly "Microsoft.AspNetCore.Authorization". Check to make sure
the assembly exists on disk. If this reference is required by your
code, you may get compilation errors.
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:26
/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5):
warning MSB3245: Could not resolve this reference. Could not locate
the assembly "Microsoft.AspNetCore.Mvc.Abstractions". Check to make
sure the assembly exists on disk. If this reference is required by
your code, you may get compilation errors.
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:26
/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5):
warning MSB3245: Could not resolve this reference. Could not locate
the assembly "Microsoft.IdentityModel.Tokens". Check to make sure the
assembly exists on disk. If this reference is required by your code,
you may get compilation errors. [/var/lib/jenkins/workspace/MySolution
Main App/MySolution.Common/MySolution.Common.csproj] 16:32:26
/usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5):
warning MSB3245: Could not resolve this reference. Could not locate
the assembly "System.IdentityModel.Tokens.Jwt". Check to make sure the
assembly exists on disk. If this reference is required by your code,
you may get compilation errors. [/var/lib/jenkins/workspace/MySolution
Main App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/ForbiddenResult.cs(5,28): error CS0234: The type
or namespace name 'Mvc' does not exist in the namespace
'Microsoft.AspNetCore' (are you missing an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/GroupMemberAttribute.cs(3,28): error CS0234: The
type or namespace name 'Mvc' does not exist in the namespace
'Microsoft.AspNetCore' (are you missing an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Services/Impl/TokenManagementService.cs(10,14): error CS0234: The type
or namespace name 'IdentityModel' does not exist in the namespace
'System' (are you missing an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Services/Impl/TokenManagementService.cs(12,17): error CS0234: The type
or namespace name 'IdentityModel' does not exist in the namespace
'Microsoft' (are you missing an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/ForbiddenResult.cs(9,33): error CS0246: The type
or namespace name 'IActionResult' could not be found (are you missing
a using directive or an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/ForbiddenResult.cs(18,40): error CS0246: The type
or namespace name 'ActionContext' could not be found (are you missing
a using directive or an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/GroupMemberAttribute.cs(8,51): error CS0246: The
type or namespace name 'IActionFilter' could not be found (are you
missing a using directive or an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/GroupMemberAttribute.cs(33,33): error CS0246: The
type or namespace name 'ActionExecutingContext' could not be found
(are you missing a using directive or an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/GroupMemberAttribute.cs(53,32): error CS0246: The
type or namespace name 'ActionExecutedContext' could not be found (are
you missing a using directive or an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj] 16:32:27
Security/Decorators/GroupMemberAttribute.cs(58,24): error CS0246: The
type or namespace name 'ActionExecutingContext' could not be found
(are you missing a using directive or an assembly reference?)
[/var/lib/jenkins/workspace/MySolution Main
App/MySolution.Common/MySolution.Common.csproj]
On my dev machine, I looked around and couldn't find those assemblies, but I'm definitely referencing them, so I'm guessing they're stashed in a common location somewhere.
What do I need to do to get all the referenced assemblies to be found by Jenkins and successfully build my project? All the documentation I've seen online seems to reference .net core 1.0 or 1.1 and it seems a lot of this stuff is different now.
My build steps are very simple (there's one). A script to do:
dotnet clean
dotnet restore
dotnet build
SO IT TURNS OUT that this is a bug (perhaps of ReSharper) where if you reference a library in your solution in a project for the first time, and automagically update the reference, the reference isn't added completely correctly; IOW, the MySolution.Common project did not explicitly add the dependent assemblies to the project file, even though they were part of the solution and available.
On my development machine, that didn't matter so much; Visual Studio was able to find the dependencies just fine. On my build server, however, this was a critical piece of information that was missing.
HOW TO CORRECT
If we take a look at the first error:
16:32:26 /usr/share/dotnet/sdk/2.0.0/Microsoft.Common.CurrentVersion.targets(1987,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Microsoft.AspNetCore.Authorization". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [/var/lib/jenkins/workspace/MySolution Main App/MySolution.Common/MySolution.Common.csproj]
...we can see that the problem occurred when building the MySolution.Common project, and the missing assembly was Microsoft.AspNetCore.Authorization.
There are two ways to make this work. One is to manually edit the .csproj file. If you add the line in the PackageReference ItemGroup like so:
<PackageReference Include="Microsoft.AspNetCore.Authorization" Version="2.0.1" />
... the problem (for that missing reference) will go away. This is what I originally did, and it worked, but then I found out that I could do this without messing with that file by simply going to my Package Management Console and doing something like this:
cd MySolution.Common
dotnet add reference Microsoft.AspNetCore.Authorization
...this would add it to the project file properly, along with the proper version and everything, so I think this is a better method.
I hope this saves someone the hours it cost me.
I am trying to host the asp.net core application and for that I tried Nowin as it is given in Documentation, But even Nowin creates the another process names MyProject.exe.
I want to install IIS in In proccess of app pool instead of creating the different process(Kestrel). Second thing is I use default project template of aspnet core and commented use Kestrel and added Nowin as given in samples. It still creates the new process. The reason I need it to be in same process because Performance monitoring tool I use (NewRelic) does not yet support Kestrel. If I create new project in mvc 5, Empty template and then add aspnewcore nuget packages, It comes till controller, But when It goes to razor it gives error(It works perfect with return Json). Can you help me to know whether it is issue or not? If it is not issue, How can I achieve it? Which type of project I should create?
Error in old website project with aspnet core nuget.
One or more compilation failures occurred:
4nut20vs.g5q(10,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(11,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(12,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(15,36): error CS0234: The type or namespace name 'ViewFeatures' does not exist in the namespace 'Microsoft.AspNetCore.Mvc' (are you missing an assembly reference?)
4nut20vs.g5q(16,11): error CS0246: The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?)
4nut20vs.g5q(18,86): error CS1980: Cannot define a class or member that utilizes 'dynamic' because the compiler required type 'System.Runtime.CompilerServices.DynamicAttribute' cannot be found. Are you missing a reference?
4nut20vs.g5q(18,86): error CS0518: Predefined type 'System.Boolean' is not defined or imported
4nut20vs.g5q(18,45): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
4nut20vs.g5q(43,16): error CS0012: The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'..........
It's not possible to host ASP.NET Core in process with IIS. See https://learn.microsoft.com/en-us/aspnet/core/publishing/iis for more details.
The reason I need it to be in same process because Performance monitoring tool I use (NewRelic) does not yet support Kestrel.
Sounds like the NewRelic support you're using is for System.Web based applications. Does it support profiling a managed exe?
I am trying to build iConf.NET demo for video conferencing SDK.
The projects have references to assemblies named:
iConfClient.NET.dll
iConfServer.NET.dll
The references are ok.
In code there are following lines:
using iConfServer.NET.HelperClasses;
..etc, which are causing the errors of type
The type or namespace name 'iConfServer' could not be found (are you missing a using directive or an assembly reference?)
C:\Users\Администратор\Desktop\iConfNetSDKDemos\PictureInPictureVideoPhone\MainForm.cs
Any help will be appreciated