I'm seeing errors using PostSharp Express
(PostSharp30 target) ->
Core.csproj : postsharp error PS0127: The assembly 'ModuleDeclaration Utilities.dll' uses non-licensed features (
Basic Features). Please visit http://www.postsharp.net/purchase to acquire a license of PostSharp.
Core.csproj : postsharp error PS0154: Information regarding the previous message: the installed user license is: "".
Core.csproj : postsharp error PS0060: The processing of module "Core.dll" was not successful.
AFAICT, my installation is good, but there were no values written in to the registry under HKCU/SOFTWARE/SharpCrafters/PostSharp 3/LicenseKey
I've tried everything I can find to fix this to no avail so far. Ideas?
In my specific case, I don't have VisualStudio installed since this is all running on a build server. From PostSharp support:
without Visual Studio, you can access the registration dialog via %ProgramData%\PostSharp\\bin.Release\PostSharp.HQ.v3.0.exe if you have PostSharp 4.3.x or via %ProgramData%\PostSharp\\bin.Release\PostSharp.Settings.UI.exe.
Using this tool, you can register the Express license again.
Related
I've just recently started using a newly installed PC but am having trouble building a solution in Visual Studio 2022 that uses PostSharp (version 6.10.5). It works without problem to build the same solution on my old computer and strangely enough a colleague of mine who also recently installed a new computer has no problem building the solution.
Visual Studio throws a bunch of NU1101- and NU1102-errors such as these:
It also hints to the following information regarding PostSharp which I'm not sure how to fix?
The process "C:\Program Files\dotnet\dotnet.exe" failed with exit code 1.
Restore of compiler dependencies failed. To disable compiler dependencies restore use PostSharpDependencyRestoreDisabled=True MSBuild property.
Unable to start PostSharp due to previous error encountered while creating fallback package directory.
We're including PostSharp via a private Nuget package where we're referencing PostSharp like this after input in this thread: How to have PostSharp included in build process for ASP.NET WebApi project when installed using our own Nuget package?.
<PackageReference Include="PostSharp" Version="6.10.5" PrivateAssets="none" />
If I exclude everything related to PostSharp, the solution builds just fine but not with PostSharp included. Any help here would be very much appreciated.
/Martin
If NuGet errors are in the build output and immediately before the error stating that PostSharp's dependency restore had failed (not apparent from screenshots), PostSharp is attempting to gather its references for the first build on the machine.
PostSharp does this by running NuGet restore under current settings for packages it depends on (e.g. System.Runtime.CompilerServices.Unsafe).
Since NuGet sources that are enabled for the build seem to include only "Offline packages", it is not able to find required packages as these are not present on your machine.
The solution is to run the build once with NuGet.Org package source enabled. PostSharp should then be able to download its dependencies and all subsequent builds should run without problems (unless you upgrade to a new minor version of PostSharp). The presence of NuGet.org package source is probably the difference between machines that causes this problem.
As mentioned in my comment to the answer above the solution to my problem was to:
Remove our own nuget.config file (even if it contained a reference to the nuget.org package source)
Add a reference to the nuget.org package source (https://api.nuget.org/v3/index.json) in Visual Studio under Tools --> Nuget Package Manager --> Package Manager Settings --> Package Sources
Build the solution again
Add our own nuget.config file to the solution again
I'm trying to use the Publishing tool from Visual Studio 2017. However, I guess Microsoft is now pushing out "servicing updates" for .NET core. It's complaining about a RuntimeIdentifier property being set during build or publish but not during restore. I didn't change anything. The Deployment Mode is set to Self Contained, so it should just include all dependencies and publish it to the server, right?
Severity Code Description Project File Line Suppression State
Error NETSDK1061: The project was restored using Microsoft.NETCore.App version 2.1.3, but with current settings, version 2.1.3-servicing-26724-03 would be used instead. To resolve this issue, make sure the same settings are used for restore and for subsequent operations such as build or publish. Typically this issue can occur if the RuntimeIdentifier property is set during build or publish but not during restore.
This is a bug in VS2017 "15.8.2". Please see the answer to [VS2017 15.8.2 publishing error (.NET Core 2.1)
We are facing issues while analyzing .NET projects using SonarQube 5.1.1.
Please note that FxCop rules are enabled at Quality profile level.
We are using MSBuild SonarQube Runner to analyze the projects. But we are facing error which says sonar.cs.fxcop.assembly must be set.
We have faced similar issue with sonar-runner-2.4 but at that time this parameter can be passed with sonar-project.properties file.
But as sonar-runner does not support .NET projects, we are using MSBuild SonarQube Runner now.
Could you kindly confirm how we can avoid these issues with MSBuild SonarQube Runner and execute FxCop rules on the .NET projects?
C# plugin version is 4.1.
Please let me know if any further information is needed from our end.
We have postponed our Production Sonar upgrade due to this issue as Project teams are NOT OK with disabling FxCop rules at Quality Profile level.
Kindly help us in fixing this.
Thanks,
Sri Priyanka
I thinks you should read http://www.sonarqube.org/easy-analysis-of-visual-studio-solutions-with-the-sonarqube-scanner-for-msbuild/ and http://docs.sonarqube.org/display/PLUG/C%23+Plugin .
Pay attention to the fact that you should run the commands from a "Developer Command Prompt for Visual Studio 2013 or higher" (http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Scanner+for+MSBuild). Neither DOS Command Prompt nor Windows PowerShell work because they don't set the proper variables.
The FxCop native support doesn't mean that it comes with MSBuild SonarQube Runner, but you have to install Visual Studio >= 2013.
Moreover, I found that not only sonar-project.properties has been deprecated, but you have to remove it to avoid strange behaviors.
I recently decided to try out visual studio online to automate my build. The build result should be some binaries and a wix created installer. Locally this works, however on visual studio online this results to errors:
light.exe: Error executing ICE action 'ICE01'. The most common cause of this kind of ICE failure is an incorrectly registered scripting engine. See http://wix.sourceforge.net/faq.html#Error217 for details and how to solve this problem. The following string format was not expected by the external UI message logger: "The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.".
[..]
light.exe: An unexpected Win32 exception with error code 0x643 occurred: Action - 'ICE09' Fatal error during installation
The only solution I know to solve this is to give the build server administrator rights. In this case this is not possible.
Does anyone know if it is possible to use Wix on Visual Studio Online? If yes, what do I need to change?
The other only alternative I know of is to disable ICE validations during build:
<PropertyGroup>
<SuppressValidation>true</SuppressValidation>
</PropertyGroup>
I’ve installed PostSharp on my machine, added PostSharp.dll to my dependencies folder and built my aspect attribute, which is works correctly.
Now I am going to check-in my changes.
What would happen on build machine or my colleague's computers, when they would get the latest code but wouldn't have installed PostSharp.
Will the attributes just ignored?
Or some errors during build or run-time would happen?
If PostSharp is installed on other development machines, you have also to install it on build servers.
See also http://doc.sharpcrafters.com/postsharp-2.1/Content.aspx/PostSharp-2.1.chm/html/522bb950-5fdf-4601-b75e-7c60c8b3ae08.htm.
I think it errors out if you try and build it on a build server without it installed, even with the dll added.
As of 2.1, the build server must have PostSharp installed as well as any developers who need to build the projects. If you don't then the build will fail and they will probably not behappy with you. PostSharp is part of the build process which is why it's needed on the build server.
You cannot have PostSharp ignored. If the other devs are able to reference PostSharp.dll to satisfy the types and it actually built then they would have invalid output because it doesn't have the aspects applied in the final assemblies.
I recommend installing PostSharp into the source repository (http://doc.sharpcrafters.com/postsharp-2.1/Content.aspx/PostSharp-2.1.chm/html/41129237-a5d4-4acf-aef4-c46759ccfb4b.htm) to make it easier on everyone.
I can confirm that a project with aspect attributes can be compiled without any errors on machine without PostSharp installed.I assume that PostSharp DLLs are added as dependencies.
Of course, there will be no post-build processing and all attributes will be ignored, but not related to PostSharp functionality will work as expected.
Clarification 12 Jan 2013:
Other developers and build server were able to ignore PostSharp when I used Setup Program for installation (as described in
http://doc.sharpcrafters.com/postsharp-2.1/Default.aspx##PostSharp-2.1.chm/html/f7b57aa1-369a-406a-8863-8b6865265a21.htm
) on my machine only.
However when using NuGet installation in packages subfolder of installation (currently recommended by PostSharp author ) all developers are forced to install Starter or trial professional edition
You can disable PostSharp for some configurations.
Project > Setting > PostSharp
Choose Yes for Disable PostSharp for this configuration
I responded to similar question here :
Disable Postsharp in debug builds