Hello,

I'm unable to compile after installing the license with latest 4.3 release.

I need to set the windows date time format options to US (see viewtopic.php?f=29&t=6016 ) to avoid an exception in postsharp :

Error   1   Unhandled exception (2.0.8.1271, 32 bit, CLR 4.0, Release): System.FormatException: String was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at †††
††††‡—.†††
††††‡–.†††
††††›š(Object )
   at †††
††††‡—.†††
††††‡–.†††
†††††ˆ(Object , Object )
   at †††
††††‡—.†††
††††‡–.†††
††††œŽ(Object , Object )
   at †††
††††‡—.†††
††††‡–.†††
†††††‰()
   at Xtensive.Core.Weaver.PlugIn.†††
††††•š()
   at Xtensive.Core.Weaver.PlugIn.Initialize()
   at PostSharp.Sdk.Extensibility.Task.^pFnf8wEt(TaskTypeConfiguration _0, XmlElement _1, Project _2)
   at PostSharp.Sdk.Extensibility.Configuration.TaskTypeConfiguration.^N565HL29(XmlElement _0, Project _1)
   at PostSharp.Sdk.Extensibility.TaskCollection.Add(String taskTypeName)
   at PostSharp.Sdk.Extensibility.Tasks.AutoDetectTask.Execute()
   at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
   at PostSharp.Sdk.Extensibility.Project.Execute()
   at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
   at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)

Then I get this message : (I entered a company license)

Your subscription expired 8/25/2010 and is not valid for Part of DataObjects.Net v4.3.0, build 5483 for .NET 4.0, build date: 12.07.2010.

I will try to switch back to RC until this is fixed.


Updated at 16.07.2010 9:10:59

After update to latest release of installer, I get another exception:

Error   55  Unhandled exception (2.0.8.1271, 32 bit, CLR 4.0, Release): System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at PostSharp.Hosting.UpdateCheckUtility.^0vtypUdl()
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^am54hQ2c(String _0, Byte[] _1, IList`1 _2, String _3, LicenseType _4)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^am54hQ2c(String _0, Byte[] _1, IList`1 _2, String _3, LicenseType _4)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^Vzw4D/Nn(LicenseManager _0, String _1, Byte[] _2, Func`1 _3, LicenseType _4, String _5)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^Vzw4D/Nn(TypeDefDeclaration _0)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.RequireLicensedFeatures(TypeDefDeclaration aspectType, LicensedFeatures requiredFeatures, Boolean writeMessage)
   at PostSharp.Sdk.CodeModel.CustomAttributeDeclaration.get_Symbol()
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^+GwnKh4ZYHu3()
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.Execute()
   at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
   at PostSharp.Sdk.Extensibility.Project.Execute()
   at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
   at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)

EDIT: This seems related to the addition of <copyindirectdependencies>true</copyindirectdependencies> in project properties

EDIT 2: This is very strange : I've been able to compile one time, and then it fails again...


Updated at 23.07.2010 8:25:34

I got again this exception.

Error   55  Unhandled exception (2.0.8.1271, 32 bit, CLR 4.0, Release): System.InvalidOperationException: Operation is not valid due to the current state of the object.
   at PostSharp.Hosting.UpdateCheckUtility.^0vtypUdl()
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^am54hQ2c(String _0, Byte[] _1, IList`1 _2, String _3, LicenseType _4)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^am54hQ2c(String _0, Byte[] _1, IList`1 _2, String _3, LicenseType _4)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^Vzw4D/Nn(LicenseManager _0, String _1, Byte[] _2, Func`1 _3, LicenseType _4, String _5)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^Vzw4D/Nn(TypeDefDeclaration _0)
   at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.RequireLicensedFeatures(TypeDefDeclaration aspectType, LicensedFeatures requiredFeatures, Boolean writeMessage)
   at PostSharp.Sdk.CodeModel.CustomAttributeDeclaration.get_Symbol()
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.^+GwnKh4ZYHu3()
   at PostSharp.Sdk.Extensibility.Tasks.MulticastAttributeTask.Execute()
   at PostSharp.Sdk.Extensibility.Project.ExecutePhase(String phase)
   at PostSharp.Sdk.Extensibility.Project.Execute()
   at PostSharp.Hosting.PostSharpObject.ExecuteProjects()
   at PostSharp.Hosting.PostSharpObject.InvokeProject(ProjectInvocation projectInvocation)

Then I closed Postsharp pipe server : Dataobjects.Net license agent was not running. This time the solution builds correctly.

I made then another test : if I close Postsharp piper server AND Dataobjects.Net license agent, and then rebuild, I reproduce the error.

Any idea on this behavior?


Updated at 23.07.2010 8:56:18

Ok I get it : this happens when a project using Postsharp aspects, but not DataObjects.net is compiled first.

Here is a test project. [attachment=0:93mtdys0]TestPostsharpLicenseBug.zip[/attachment:93mtdys0]

Steps to reproduce: * Close any postsharp pipe server and DataObject license manager running * Rebuild test project


Updated at 26.07.2010 13:15:29

Are you sure Alex? I already use the version from 7/20/2010 available at the download section. Postsharp version : 2.0.8.1267 Xtensive.Storage version : 1.0.5605.4108

By the way, could you please put the build number on download page? It's getting hard to know which version is the latest when there are several with the same release number...

This thread was imported from our support forum. The original discussion may contain more detailed answer.

asked Jul 15 '10 at 12:38

olorin's gravatar image

olorin
358848792


One Answer:

We didn't change PostSharp build this time (i.e. it's still the same PostSharp 2.0 RTW). So most likely the issue is related to PostSharp itself - we'll report about it.

Btw, now you can run PostSharp.IntegrityChecker.exe from Lib\PostSharp to check the consistency of the version we ship.


Our own investigation has shown the original error is:

at PostSharp.Sdk.Extensibility.Licensing.CryptoUtilities.VerifyLicenseSignature(License license) at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.^tBTNtSfQ.^3aas(Byte[] _0) at PostSharp.Sdk.Extensibility.Licensing.LicenseManager.LoadUserLicense(String licenseString) at PostSharp.Hosting.Program.ExecuteImpl() 
</StackTrace>
<InnerException>
<Type>
System.Security.Cryptography.CryptographicException
</Type>
<Message>
Ключ не может быть использован в указанном состоянии.  // English: Key cannot be used in the specified state
</Message>
<Source>
mscorlib
</Source>
<Data/>
<StackTrace>
at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer) at System.Security.Cryptography.Utils.get_StaticDssProvHandle() at System.Security.Cryptography.DSACryptoServiceProvider.ImportParameters(DSAParameters parameters) at System.Security.Cryptography.DSA.FromXmlString(String xmlString) at PostSharp.Sdk.Extensibility.Licensing.CryptoUtilities..cctor()

We've been able to find the following:

  • http://blogs.msdn.com/b/alejacma/archiv ... p-net.aspx

  • http://www.google.ru/search?q=System.Se ... fied+state

    If you use these methods during impersonation, you may receive the following error: "Key not valid for use in specified state." This occurs because the DPAPI stores the key data in user profiles. If the profile is not loaded, DPAPI won’t be able to perform the decryption. Therefore, this error is prevented by loading the profile of the user you want to impersonate, before calling either method. Using DPAPI with impersonation can incur significant complication and requires careful design choices. Finally, the following "solution" helped, but we aren't sure about any possible side effects of this:

  • Clean C:\Documents and Settings{UserName}\Application Data\Microsoft\Crypto\RSA.


> Are you sure Alex?

Sorry, I was really wrong. PostSharp was updated to this version in build 5609 (.NET 4) and 5612 (.NET 3.5). So your version really contains older version of PostrSharp.

The most current build was published today in the morning (v4.3.1, build 5680), although I didn't announce this yet. I wanted to test how it is adopted by customers that reported bugs we resolved there. It fully works, but if can wait till tomorrow, I recommend you to do this - I plan to update it.

> agree with that!

Me too. Descriptions aren't update automatically yet, but I'll do this shortly.

answered Jul 16 '10 at 10:38

Alex%20Yakunin's gravatar image

Alex Yakunin
29714412

Good then...

(Jul 16 '10 at 10:38) Alex Yakunin Alex%20Yakunin's gravatar image

Use new postsharp release from postsharp site. I've reported the bug and they fixed it

(Jul 16 '10 at 10:38) xumix xumix's gravatar image

Yep. Btw, the latest build of DO4 available at Downloads section at X-tensive.com already includes this PostSharp build.

(Jul 16 '10 at 10:38) Alex Yakunin Alex%20Yakunin's gravatar image

By the way, could you please put the build number on download page? It's getting hard to know which version is the latest when there are several with the same release number...

agree with that!

(Jul 16 '10 at 10:38) Peter Šulek Peter%20%C5%A0ulek's gravatar image

olorin wrote: This problem seems to be gone with install of latest 4.3 version.

I think It may may have been caused by a version mismatch between postsharp : when the postsharp pipe server is running you may not use the version you think you are using...

(Jul 16 '10 at 10:38) Editor Editor's gravatar image

So the safest way is to wait for the response from PostSharp team.

(Jul 16 '10 at 10:38) Alex Yakunin Alex%20Yakunin's gravatar image

olorin wrote: An indication about this : this version works on build server that is still with an evaluation Dataobjects license, but not on my machine which a company license for which I requested an hardware license.

(Jul 16 '10 at 10:38) Editor Editor's gravatar image
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA