Error Metadata file dll could not be found CSC when publishing - c#

I have a Visual studio solution with several projects in it, specifically a DotNet5 asp.net app, that has several netstandard 2.0 references on it. it builds and runs fine in the debugger but continuously throws the metadata errors. It keeps specifically referencing its looking for a net5 folder in the netstandard2 project. I cannot find where its getting this from, the problematic one used to be a multitargeted project against framework 4.7, 4.8, and net5.0, but i got annoyed with the multiple dll's and just migrated it to standard2.0 and had no issues till i want to publish it.
I've tried what a few other questions referenced, cleaning, rebuilding, remove and re add references to other projects, deleted the obj and bin folders out of the solution, the removing the sou file, tried VS 2019 (16.9.0 preview 2) preview vs 2019 (16.8.3) release, different computer (pulled back down from a lan git repository) and got the same error.... also tried searching the entire solution for references to net5.0 and didn't find it outside of the expected locations like the csproj for the asp.net project and its respective pubxml. And just for fun, I temporarily retargeted the library project back to net5.0 and it still threw the same error even when the exact file and path listed did exist.
Using enters for the error below for the different columns in the error message, and removed the "sensitive" info. There is no error code provided by Visual Studio. Anyone else got any more ideas on what to try?
Error
Metadata file 'C:\Users\UserName\source\repos\Solution\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found.
Project 1
CSC
0
Edit: adding a couple other sections of the error messages:
1/2/2021 7:38:55 PM
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.<---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Build failed. Check the Output window for more details.
===================
And the end of the output window since full thing is a bit too long. still can't figure out where its getting the net5.0 for the one project reference
/reference:C:\Users\UserName\.nuget\packages\system.xml.xpath.xmldocument\4.0.1\ref\netstandard1.3\System.Xml.XPath.XmlDocument.dll /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Ubiety.Dns.Core.dll /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 3\bin\Release\netstandard2.0\Project 3.dll" /reference:"C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll" /reference:C:\Users\UserName\source\repos\CheckNotes\Project 4\bin\Release\netstandard2.0\Project 4.dll /reference:"C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\5.0.0\ref\net5.0\WindowsBase.dll" /reference:C:\Users\UserName\.nuget\packages\mysql.data\8.0.22\lib\net5.0\Zstandard.Net.dll /debug+ /debug:portable /filealign:512 /optimize+ /out:"obj\Release\net5.0\CheckNotes Web - Core.dll" /refout:"obj\Release\net5.0\ref\CheckNotes Web - Core.dll" /target:exe /warnaserror- /utf8output /deterministic+ /langversion:9.0 /analyzerconfig:"obj\Release\net5.0\CheckNotes Web - Core.GeneratedMSBuildEditorConfig.editorconfig" /analyzerconfig:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\analyzers\build\config\AnalysisLevel_5_Default.editorconfig" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Mvc.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk.Web\analyzers\cs\Microsoft.AspNetCore.Components.Analyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.CSharp.NetAnalyzers.dll" /analyzer:"C:\Program Files\dotnet\sdk\5.0.200-preview.20601.7\Sdks\Microsoft.NET.Sdk\targets\..\analyzers\Microsoft.CodeAnalysis.NetAnalyzers.dll" Controllers\AssemblyController.cs Controllers\CheckNotesController.cs Controllers\ContactsController.cs Controllers\CustomerController.cs Controllers\HomeController.cs Controllers\ImageController.cs Controllers\OperatorPagesController.cs Controllers\PalletsController.cs Controllers\SharedController.cs Controllers\StatisticsController.cs Models\ControllerClass\ctrlrAssembly.cs Models\ControllerClass\CtrlrCheckNotes.cs Models\ControllerClass\ctrlrContacts.cs Models\ControllerClass\CtrlrCustomer.cs Models\ControllerClass\CtrlrOperatorPages.cs Models\ControllerClass\CtrlrPallet.cs Models\ControllerClass\ctrlrStats.cs Models\DataClass\AppSettings.cs Models\ErrorViewModel.cs Models\renderAction.cs Program.cs Startup.cs "obj\Release\net5.0\.NETCoreApp,Version=v5.0.AssemblyAttributes.cs" "obj\Release\net5.0\CheckNotes Web - Core.AssemblyInfo.cs" "obj\Release\net5.0\CheckNotes Web - Core.RazorAssemblyInfo.cs" /warnaserror+:NU1605
CSC(0,0): Error CS0006: Metadata file 'C:\Users\UserName\source\repos\CheckNotes\Project 2\bin\Release\net5.0\ref\Project 2.dll' could not be found
10>Build failed. Check the Output window for more details.
========== Build: 9 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Publish: 0 succeeded, 1 failed, 0 skipped ==========

Got it to publish but I am so confused....something to do with the publish profile. If i delete that and generate a new one, works fine. as soon as i edit it using the GUI, broken....generate it again. So far seems ok to edit it manually but TBD. not sure if the "fix" will survive restarting Visual studio or not.
Edit - Scratch that, found the difference.
Remove the following line in Properties/FolderProfile.pubxml and it's fine.
<TargetFramework>net5.0</TargetFramework>

Related

Nuget error when trying to publish in .Net5

When I publish in .Net5 I get the following Errors
Severity Code Description Project File Line Suppression State
Error Assets file 'C:\Users\cornelis.dejager\source\repos\Marel.MSAWebServiceAPI\Marel.MSAWebServiceAPI\obj\publish\win-x86\project.assets.json' not found. Run a NuGet package restore to generate this file. Marel.MSAWebServiceAPI 0
and
Severity Code Description Project File Line Suppression State
Error Failed to retrieve information about 'Microsoft.WindowsDesktop.App.Runtime.win-x86' from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.windowsdesktop.app.runtime.win-x86/index.json'.
An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel. Marel.MSAWebServiceAPI 0
What caused it:
Not sure to be honest. After I changed code it stopped working. The project has been fine for weeks now and suddenly it changed.
I have tried
Cleaned solution
Build/Re-Build Solution
Restore The Nuget Packages
Update Visual Studio
Rebuild All projects
Delete Bin & Object folders
Update all packages
Restarting Visual Studio + Computer
Created new publishing profile
install dotnet-WindowsDesktop
Reinstall .Net5 Runtimes
Run the command:
Additional Info
It builds and run fine. Only when I publish it seems to give me an error.
I really do not why publishing isn't working. I've looked at several places but have not found a solution to it yet.
It may happen from the wrong package source,
In Visual Studio go to
Options=> Nuget Package Manager=> Package Sources
if you are using a custom source make sure you have entered the address correctly.
NuGet default source address is https://api.nuget.org/v3/index.json

Why does Visual Studio 2019 run tests in dotnet core 1.0 even though my projects target dotnet core 2.2?

I have a solution with 2 projects, one of which is a test project. Both projects target dotnet core 2.2:
<TargetFramework>netcoreapp2.2</TargetFramework>
I am using Visual Studio 2019 (version 16.1.1). When I click "Run all" in test explorer, it outputs this warning in output window:
[5/28/2019 10:25:40 PM Informational] ------ Run test started ------
[5/28/2019 10:25:40 PM Warning] Test run will use DLL(s) built for framework .NETCoreApp,Version=v1.0 and platform X64. Following DLL(s) do not match framework/platform settings.
MyApp.UnitTests.dll is built for Framework 2.2 and Platform AnyCPU.
Go to http://go.microsoft.com/fwlink/?LinkID=236877&clcid=0x409 for more details on managing these settings.
[5/28/2019 10:25:41 PM Informational] ========== Run test finished: 3 run (0:00:01.167997) ==========
The tests do run, and finish successfully. But I am wondering about how to get rid of this warning.
I added a .runsettings file with following settings, but I still see the same warning.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<TargetFrameworkVersion>FrameworkCore10</TargetFrameworkVersion>
</RunConfiguration>
</RunSettings>
Changing FrameworkCore10 to FrameworkCore22 (or netcoreapp2.2) throws a huge exception. Top few lines of the exception:
[5/28/2019 10:41:30 PM Error] System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.TestWindow.Controller.RequestConfiguration.GroupTestContainersConfigByFrameworkAndArchitecture(IEnumerable`1 testContainersConfig, IXPathNavigable runSetting)
at Microsoft.VisualStudio.TestWindow.Controller.TestRunConfiguration.<GetAllCriteriaQueues>d__64.MoveNext()
at Microsoft.VisualStudio.TestWindow.Controller.TestRunRequest.<CreateRequests>d__23.MoveNext()
at Microsoft.VisualStudio.TestWindow.Controller.Request.<RunRequests>d__95.MoveNext()
--- End of inner exception stack trace ---
Note that the same projects work fine in Visual Studio 2017, without the need of any runsettings file whatsoever.
This is not an answer, but posting to help others landing here.
Visual Studio team has acknowledged the issue and is looking into fixing this. It's best to follow it here:
Issue at VS Developer Community: https://developercommunity.visualstudio.com/content/problem/579073/test-discovery-reporting-dlls-do-not-match.html
Related issue on GitHub: https://github.com/MicrosoftDocs/visualstudio-docs/issues/1305
I had the problem after upgrading from a netframework project to netcore.
Using VS Enterprise 16.3.8, cleaning the solution as well as deleting all temporary folders such as bin and obj helped me to get the tests running in the desired netcore version.
Edit:
As a sidenote VS has sometimes problems, when changing the target framework. After changing it deleting the bin / obj could sometimes be your last escape.
It might be 2.2 dot net framework doesn't install in that machine.
Here is Link, you can download the framework.

Build failed. Check the Output window for more details - C# publishing fails but build succeeds

I am trying to publish a web application on Visual Studio 2017. The build succeeds but the publishing fails. When it fails an error dialog comes up which says "Publish has encountered an error. Build Failed. A diagnostic log has been written to the following location: .."
This is what the file with the log contains:
System.AggregateException: One or more errors occurred. ---> System.Exception: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at Microsoft.VisualStudio.Web.Publish.PublishService.VsWebProjectPublish.<>c__DisplayClass41_0.<PublishAsync>b__2()
at System.Threading.Tasks.Task``1.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.VisualStudio.ApplicationCapabilities.Publish.ViewModel.ProfileSelectorViewModel.<RunPublishTaskAsync>d__116.MoveNext()
---> (Inner Exception #0) System.Exception: Build failed. Check the Output window for more details.
I've tried running the application as Admin but it still doesn't work. I also searched for the Microsoft.Net.Compilers reference but it's not in my project.
Make sure Build + Intellisense is selected, not just Build Only.
That way you can see other errors that might be hiding out there.
Try open visual studio as admin.
Please provide the read write permission for iuser. The folder in which you are publishing by right click on folder > Properties > Security tab
This is because of admin rights , Open the solution in administration mode in the visual studio and publish the solution it will work and make sure that published folder has read write access .
If you have opened vs with admin rights and if you publishing folder has all the read/ write permission you probably need to remove the missing reference from .csproj file
unload your project
right click edit .csproj
remove all the included files that are no longer referenced/used by your current project
re-load your project
try to publish again...
This is user11952046's answer (which I saw after making numerous trials with VS) with more details.
I have stumbled across the same error after realizing that my publish profile was using .NET Core 3.0 as target framework instead of 3.1 (all assemblies were targeting 3.1). Not sure that it is related, but I have also moved the db context + migrations from the main assembly (that contains Startup.cs).
My development environment is VS2019.
Double-checked that publish works on Local IIS. That required elevating the VS 2019 (admin).
While being elevated I have published on target Web server (IIS) and it worked as expected.
Closed and restarted without elevation and published again and it worked.
I am not sure what happened, but I guess that publish had a one-time requirement to change some file that needed elevation.
tl;dr - make at least one publish using VS2019 started as Admin and then you can publishes using non-admin mode.
I have upgraded project framework form 4.0 to 4.7.2 had same issue when trying to publish service, resolved by adding following tags in .cproj file of project
Unload Project >> Edit Project file
Update ToolsVersion="15.0" in following line
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
then add following line after above line
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
add above before following line
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
add following line after above
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false"/>
this solution worked for me able to publish wcf project after upgrading framework from 4.0 to 4.7.2
I faced the same "Build Failed" problem.
All I did to fix it was to enable AppDbContext under Entity Framework Migrations and provide connection string
Disabling Resharper fixed the issue for me!!!
Here is how to disable it
How can I disable ReSharper in Visual Studio and enable it again?
Also some blogs claim updating MSBILD tools will fix the issue.
For me just disabling Resharper worked.
Download the latest version of MSBUILD tools from https://www.visualstudio.com/downloads/#build-tools-for-visual-studio-2017, run it, choose Modify and then select “Web development build tools” and “.NET Core build tools”.
I faced a similar problem in which I could run my project in debug mode but I whenever I wanted to publish I faced the Build failed problem.
I think this will help someone facing the same issue
If your project path is long try to move the project to a shorter path.
Here is an example, change project path from C:\Users\xxxx\xxxx\xxxx\project1 to C:\Users\xxxx\project1
This more likely because you do not have full right control for that particular folder you are trying to publish
steps:
1)right click on folder you are trying to publish
2)go to security
3) click on edit and add your current user login like (domain\username)
4)click on the checkbox on full control and save it
5)then try to publish
I had the same issue, when publishing got the error :
System.AggregateException: One or more errors occurred.
---> System.Exception: Build failed. Check the Output window for more details.
--- End of inner exception stack trace ------> (Inner Exception #0)"
Solution : in file explorer the share drive target of the publication was disconnected. After reconnecting the drive the error disappeared and publication went ahead.
I solved same issue removing a folder ("node_modules") from my project. Inside this folder path was too long
Download LastVersion of MSBUILD Tools.
Build your Project and select Build + IntelliSense in Error List and show message Error if exist .
and Download System.Reflection.Emit from Nuget
try again publish your project.
Take a look at FolderProfile.pubxml file located in YourProject\Properties\PublishProfiles and make sure term is configured with correct version.
There are many causes for this problem. I already had the IIS web site configured, as well as the right permissions for the user. Obviously the project built successfully on my local machine. The problem was I added the absolute windows path on 'Site path' section in VS publish profile. Leave this empty!
I faced the same issue while trying to publish to an Azure App Service.
For me, closing Fiddler solved the problem.

Monogame Content Pipeline has stopped working

The other day I started up my monogame project and started it up to do a quick play test. It wouldn't work. I was getting 2 errors.
Error 1 The command "SETX MONOGAME_PLATFORM "PSM" > NUL" exited with code 9009. GameName1
Error 2 Metadata file 'C:\Users\Sean\Desktop\Prog\Learning\3D Learning\GameName1\GameName1\bin\PSM\IgnoreMe.dll' could not be found C:\Users\Sean\Desktop\Prog\Learning\3D Learning\3D Learning\CSC 3D Learning
And here is the output from the build.
1>------ Build started: Project: Learnplscon, Configuration: PSM Any CPU ------
1> MonoGame Platform PSM
1> 'SETX' is not recognized as an internal or external command,
1> operable program or batch file.
1>C:\Program Files (x86)\MSBuild\MonoGame\v3.0\MonoGame.ContentPipeline.targets(22,7): error MSB3073: The command "SETX MONOGAME_PLATFORM "PSM" > NUL" exited with code 9009.
2>------ Build started: Project: learnpls, Configuration: Debug x86 ------
2>CSC : error CS0006: Metadata file 'C:\Users\Sean\Desktop\Prog\Learning\learnpls\Learnplscon\Learnplscon\bin\PSM\IgnoreMe.dll' could not be found
========== Build: 0 succeeded, 2 failed, 0 up-to-date, 0 skipped ==========
But Building from last successful build works.
I did not change anything. And any new project I make gets the same problem.
The problem only happens when I add a reference to my content project.
(Referenced project this way: monogame-managing-content )
I made a new project, ran it, everything worked fine. Created a mono game content project, ran it and everything worked fine. Then I added the reference and got the errors. And when I remove the reference Error 2 goes away but error 1 is still there, but the project will run fine.
I have tried reinstalling xna, and monogame. Also tried to reinstall visual studios. I spent all night trying to find an answer online but came up with nothing.
I am using the most recent version of XNA and Monogame 3.2, and I am using windows 8.1.
In case you're still having this problem, or someone else finds the question (like I did trying to solve this a little while ago): for me, the problem was that my windows/system32 directory wasn't in my 'path' environment variable. That's where the setx.exe program resides, and the XNA content project seems to assume that it can call setx without qualifying the path.
Note: Visual Studio seems to need to be restarted after you've added your /system32 directory to the path.

exclude project from solution when running sonar-runner

I have installed and configured SonarQube 3.7.1 and sonar-runner 2.3.
While trying to run sonar-runner on a c# solution I got the error:
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Error occured while reading Visual Studio files.
ERROR: Caused by: Error while processing the project C:\root\MPS\MPA\Main\Source\MPA.Build\MPA.Build.csproj : assemblyName not defined
My sonar-project.properties looks like
sonar.projectKey=CompanyName:MPA.Android
sonar.projectName=MPA
sonar.projectVersion=1.0
sonar.sources=.
sonar.language=cs
sonar.sourceEncoding=UTF-8
\#sonar.dotnet.key.generation.strategy=safe
sonar.dotnet.visualstudio.solution.file=MPA.sln
sonar.skippedModules=MPA.Build
I would like to exclude the project MPA.Build. But it's not working.
In the MPA.sln file the MPA.Build project is defined as
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MPA.Build", "MPA.Build\MPA.Build.csproj", "{A8B400F6-A5C5-4843-96CA-92B25A2E6483}"
EndProject
Anyone knows how to solve this error?
when running sonar-runner -X the output is:
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:90)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:41) Caused by: org.sonar.api.utils.SonarException: Error occured while reading Visual
Studio files.
at org.sonar.plugins.dotnet.core.VisualStudioProjectBuilder.createVisualStudioSolution(VisualStudioProjectBuilder.java:190)
at org.sonar.plugins.dotnet.core.VisualStudioProjectBuilder.build(VisualStudioProjectBuilder.java:82)
at org.sonar.api.batch.bootstrap.ProjectBuilder.build(ProjectBuilder.java:67)
at org.sonar.batch.scan.ProjectReactorReady.start(ProjectReactorReady.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1015)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1008)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:57)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:45)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:156)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:144)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more Caused by: org.sonar.plugins.dotnet.api.DotNetException: Error while processing
the project C:\root\MPS\MPA\Main\Source\MPA.Build\MPA.Build.csproj :
assemblyName not defined
at org.sonar.plugins.dotnet.api.microsoft.ModelFactory.getProject(ModelFactory.java:364)
at org.sonar.plugins.dotnet.api.microsoft.ModelFactory.getProjects(ModelFactory.java:274)
at org.sonar.plugins.dotnet.api.microsoft.ModelFactory.getSolution(ModelFactory.java:198)
at org.sonar.plugins.dotnet.core.VisualStudioProjectBuilder.createVisualStudioSolution(VisualStudioProjectBuilder.java:185)
... 44 more
"assemblyName not defined" => You just have to fix the MPA.Build.csproj file that is not correct because tag "AssemblyName" is missing. See https://github.com/SonarSource/sonar-examples/blob/master/projects/languages/csharp/Example.Core/Example.Core.csproj for example.
The properties file syntax you have appears to be correct. When you run sonar-runner, you should see lines like this close to the beginning of the run:
INFO - Apply project exclusions
INFO - Exclude project: MPA.Build [SomePrefix:MPA.Build]
If you don't, I would suggest running sonar-runner with the -X argument, which will print debug statements to the console. (You'll likely want to redirect/capture the console to a log file.) This may present some additional information that could help understand why it's not seeing your exclusion.
Also, in the SonarQube web UI, while looking at the project, click the "Components" link in the left-hand navigation bar. This will list the "models" for the solution. Double-check that the name showing in this view matches MBA.Build.
I face the same issu today with sonarqube 5.0.
I tried the "sonar.skippedModules" but this is deprecated now.
Instead, you have to use the following expression provided by the visual studio bootstraper :
sonar.visualstudio.skippedProjectPattern =

Categories