eXpandFramework / eXpand

DevExpress XAF (eXpressApp) extension framework. 𝗹𝗶𝗻𝗸𝗲𝗱𝗶𝗻.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺, 𝘆𝗼𝘂𝘁𝘂𝗯𝗲.𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸.𝗰𝗼𝗺 and 𝘁𝘄𝗶𝘁𝘁𝗲𝗿 @𝗲𝘅𝗽𝗮𝗻𝗱𝗳𝗿𝗮𝗺𝗲𝘄𝗼𝗿𝗸 and or simply 𝗦𝘁𝗮𝗿/𝘄𝗮𝘁𝗰𝗵 this repository and get notified from 𝗚𝗶𝘁𝗛𝘂𝗯
http://expand.expandframework.com
Microsoft Public License
222 stars 115 forks source link

Installation of Expand without GAC? #403

Closed wcraytor closed 5 years ago

wcraytor commented 5 years ago

Is there a way to install the ExpandFramework without touching the GAC?

apobekiaris commented 5 years ago

I guess u use the installe which defaults in GAC. The installer script is available in http://install.expandframework.com, where you can see the SkipGac parameter. So u might use the installer as

Set-ExecutionPolicy Bypass -Scope Process -Force;iex "$(([System.Net.WebClient]::new()).DownloadString('http://install.expandframework.com'));Install-Xpand -Assets @('Assemblies','Nuget','VSIX','Source') -SkipGac  #-Version '19.1.301.0' -InstallationPath 'YOURPATH'"

In addition you can always use the libs assets from the release page or get the modules you want from nuget, so like this they won't go into GAC

wcraytor commented 5 years ago

Thanks, but in running this command:

Set-ExecutionPolicy Bypass -Scope Process -Force;iex "$(([System.Net.WebClient]::new()).DownloadString('http://install.expandframework.com'));Install-Xpand -Assets @('Assemblies','Nuget','VSIX','Source') -SkipGac -Version '19.1.301.0' -InstallationPath 'd:\ExpandFramework\bin\'"

The output resulted in an error after "Download VSIX bootstrapper":

Installing Assemblies, Nuget, VSIX, Source into d:\ExpandFramework\bin\. Additional parameters: Version, Latest, Assets, InstallationPath Downloading Nuget at d:\ExpandFramework\bin\\nuget.exe 19.1.301.0 is a eXpand version Downloading Sources from https://github.com/eXpandFramework/eXpand/releases/download/19.1.301.0/Xpand-Source-19.1.301.0.zip into d:\ExpandFramework\bin\ Downloading Nugets from https://github.com/eXpandFramework/eXpand/releases/download/19.1.301.0/Nupkg-19.1.301.0.zip into d:\ExpandFramework\bin\ Expanding files into d:\ExpandFramework\bin\\Packages Downloading assemblies from https://github.com/eXpandFramework/eXpand/releases/download/19.1.301.0/Xpand-lib-19.1.301.0.zip into d:\ExpandFramework\bin\ Expanding files into d:\ExpandFramework\bin\\Xpand.DLL Moving Demos Write Registry Downloading VSIX from https://github.com/eXpandFramework/eXpand/releases/download/19.1.301.0/Xpand.VSIX-19.1.301.0.vsix into d:\ExpandFramework\bin\ Download VSIX bootstrapper

**iex : Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request." At line:1 char:50

apobekiaris commented 5 years ago

hmm it is not clear why it fails to download the bootstrapper?

did u try the installer twice maybe a network error?

if you already tried twice can you try these commands? do they fail also?

$client=[System.Net.WebClient]::new()
$client.DownloadFile("https://github.com/Microsoft/vsixbootstrapper/releases/download/1.0.37/VSIXBootstrapper.exe", "$env:TEMP\VSIXBootstrapper.exe")
apobekiaris commented 5 years ago

forgot to mention that i also just tried your script in my system and install with no error.

wcraytor commented 5 years ago

Yes, I tried twice and also ran your commands and received this error:
$client=[System.Net.WebClient]::new()

$client.DownloadFile("https://github.com/Microsoft/vsixbootstrapper/releases/download/1.0.37/VSIXBootstrapper.exe", "$env:TEMP\VSIXBootstrapper.exe") Exception calling "DownloadFile" with "2" argument(s): "An exception occurred during a WebClient request." At line:2 char:1

wcraytor commented 5 years ago

Maybe because I already installed your VSIX via another method?

wcraytor commented 5 years ago

In any case, I then pulled up the Sources\Xpand\Xpand.ExpressApp.Modules solution into Visual Studio 2019 and tried to build it. I received over 1000 errors. I take it, I am missing some step. What would be the procedure to rebuild the downloaded projects in Visual Studio 2019?

wcraytor commented 5 years ago

I tried many things, and never got anywhere, I could get specific project o build without error, but then later they would have errors. References. Build order seems messed up, Maybe something with XpandPosh?

apobekiaris commented 5 years ago

no that command only download the VSIXBootStrapper into your $env:Temp which I guess there are no permissions or something so can u verify that this works

$client=[System.Net.WebClient]::new()
$client.DownloadFile("https://github.com/Microsoft/vsixbootstrapper/releases/download/1.0.37/VSIXBootstrapper.exe", "d:\ExpandFramework\bin\\VSIXBootstrapper.exe")
wcraytor commented 5 years ago

yes that work without error

apobekiaris commented 5 years ago

one min i will modify the installer

wcraytor commented 5 years ago

BTW, I am running this inside a Windows Server 2019 virtual machine running Windows 10. And in this case I am running powershell v 6 (pwsh command) -- although I have the same problems with powershell v 5.

apobekiaris commented 5 years ago

I do not see a relation, the problem was that the installer was saving into your temp and failed. Now it saves into your installationpath.

wcraytor commented 5 years ago

So, I should download the new version?

apobekiaris commented 5 years ago

can u sure build the sources but u have to get all of them and run the build.ps1 on the root. You problably need to modify its parameters a bit to fit your system. https://github.com/eXpandFramework/eXpand/blob/master/build.ps1

just run the installer again same script as before

wcraytor commented 5 years ago

OK. Thanks. It worked. So now you say to run build.ps1. I'll try that. ... And then I assume I should be able to pull up Sources\Xpand\Xpand.ExpressApp.Modules solution into Visual Studio 2019 and be able to rebuild that.

apobekiaris commented 5 years ago

the build.ps1 builds everything and puts assemblies in the Xpand.Dll folder on the root, no need to do anything more

apobekiaris commented 5 years ago

this the same script we use in azure

wcraytor commented 5 years ago

And avoids the GAC?

apobekiaris commented 5 years ago

yes

wcraytor commented 5 years ago

I got an error after "Executing nuget actions took 467.72 ms": PS D:\expandframework\bin\sources> .\build.ps1 Getting module XpandPosh Installing module XpandPosh 1.17.1 Importing module XpandPosh Getting module psake Importing module psake psake version 4.7.4 Copyright (c) 2010-2017 James Kovacs & Contributors

Warning: Cannot find build tools version 15.0 without the module VSSetup. You can install this module with the command: Install-Module VSSetup -Scope CurrentUser Warning: Cannot find build tools version 15.0 without the module VSSetup. You can install this module with the command: Install-Module VSSetup -Scope CurrentUser Executing Clean Executing InstallDX 19.1.301.0 Agnostic non-XAF packages DevExpress.Xpo DevExpress.RichEdit.Export DevExpress.CodeParser DevExpress.Images DevExpress.Reporting.Core DevExpress.Document.Processor DevExpress.EasyTest Feeds used: C:\Users\MLS.nuget\packages\ https://api.nuget.org/v3/index.json https://xpandnugetserver.azurewebsites.net/nuget C:\Program Files (x86)\DevExpress 19.1\Components\System\Components\Packages

Attempting to gather dependency information for package 'DevExpress.EasyTest.19.1.3' with respect to project 'D:\expandframework\bin\sources\Xpand.dll\TempDXNupkg', targeting 'Any,Version=v0.0' Gathering dependency information took 1.99 sec Attempting to resolve dependencies for package 'DevExpress.EasyTest.19.1.3' with DependencyBehavior 'Lowest' Resolving dependency information took 0 ms Resolving actions to install package 'DevExpress.EasyTest.19.1.3' Resolved actions to install package 'DevExpress.EasyTest.19.1.3' Retrieving package 'DevExpress.EasyTest 19.1.3' from 'https://xpandnugetserver.azurewebsites.net/nuget'. GET https://xpandnugetserver.azurewebsites.net/nuget/Packages(Id='DevExpress.EasyTest',Version='19.1.3')/Download OK https://xpandnugetserver.azurewebsites.net/nuget/Packages(Id='DevExpress.EasyTest',Version='19.1.3')/Download 81ms Installing DevExpress.EasyTest 19.1.3. Adding package 'DevExpress.EasyTest.19.1.3' to folder 'D:\expandframework\bin\sources\Xpand.dll\TempDXNupkg' Added package 'DevExpress.EasyTest.19.1.3' to folder 'D:\expandframework\bin\sources\Xpand.dll\TempDXNupkg' Successfully installed 'DevExpress.EasyTest 19.1.3' to D:\expandframework\bin\sources\Xpand.dll\TempDXNupkg Executing nuget actions took 467.72 ms InvokeScript : Message : ExitCode:1 Errors: Package 'DevExpress.RichEdit.Export 19.1.3' is not found in the following primary source(s): 'C:\Users\MLS.nuget\packages\,https://api.nuget.org/v3/index.json,https://xpandnugetserver.azurewebsites.net/nuget,C:\Program Files (x86)\DevExpress 19.1\Components\System\Components\Packages'. Please verify all your online package sources are available (OR) package id, version are specified correctly. Script:

$psObj.Nugets|foreach{

                         $package=$_
                         Write-Host "Installing $package $($psObj.Version) in $($psObj.OutputDirectory) from $($psObj.Source)"

                         & "$nuget"  Install "$package" -Source "$($psObj.Source)" -OutputDirectory "$($psObj.OutputDirectory)" -Version "$($psObj.Version)"

Data : {} InnerException : TargetSite : System.Collections.ObjectModel.Collection1[System.Management.Automation.PSObject] <EndProcessingAsync>b__2() StackTrace : at XpandPosh.Cmdlets.InvokeParallel.InvokeParallel.<>c__DisplayClass28_1.<EndProcessingAsync>b__2() in D:\a\1\s\XpandPosh\Cmdlets\src\XpandPosh.Cmdlets\InvokeParallel\Invoke-Parallel.cs:line 74 at System.Reactive.Linq.QueryLanguage.<>c__1891.b__189_1(ValueTuple`2 state) in D:\a\1\s\Rx.NET\Source\src\System.Reactive\Linq\QueryLanguage.Async.cs:line 907 HelpLink : Source : XpandPosh.Cmdlets HResult : -2146233088 At D:\expandframework\bin\sources\support\build\Build.ps1:23 char:5

InvokeScript : MyCommand : Invoke-Parallel BoundParameters : {} UnboundArguments : {} ScriptLineNumber : 49 OffsetInLine : 23 HistoryId : 15 ScriptName : C:\Users\MLS\Documents\PowerShell\Modules\XpandPosh\1.17.1\public\Xpand\Install-DevExpress.ps1 Line : $psObj.Nugets|Invoke-Parallel -ActivityName $ActivityName -VariablesToImport @("psObj","nuget") -script {

PositionMessage : At C:\Users\MLS\Documents\PowerShell\Modules\XpandPosh\1.17.1\public\Xpand\Install-DevExpress.ps1:49 char:23

apobekiaris commented 5 years ago

is this path valid? C:\Program Files (x86)\DevExpress 19.1\Components\System\Components\Packages

apobekiaris commented 5 years ago

also you may also skip all problems that may rise with custom build and just use the assemblies? you can get them from the release page. Why u want to go for a custom build?

wcraytor commented 5 years ago
  1. Yes, but it is "\packages" rather than "\Packages".
  2. I want to be able to trace into the code and understand what it is doing, if needed.
wcraytor commented 5 years ago

I also need to get a good idea as to how much work it is going to be to keep a system based on ExpandFramework maintained over time - going into the future.

wcraytor commented 5 years ago

But, yea, I have DevExpress 19.2 installed . I guess that is the problem.

apobekiaris commented 5 years ago

i suggest u go simple the build is complex and involves paralell processing, so why not just create an azure build and run the pipeline?

this will create all artifacts you see in the release page. As for exploring the build code I suggest you use VSCode and its powershell extension where you can add breakpoints and examine variables.

here the azure pipeline we use

https://github.com/eXpandFramework/eXpand/blob/master/.github/Azure-pipeline.yml

apobekiaris commented 5 years ago

your previous attempt fails to install devexpress the call is here

https://github.com/eXpandFramework/eXpand/blob/master/Support/Build/Build.ps1#L25-L26

apobekiaris commented 5 years ago

I also need to get a good idea as to how much work it is going to be to keep a system based on ExpandFramework maintained over time - going into the future.

if you not very experienced in powershell and automation I do not see why you have to go down that road. We have Nugets we have libs compiled and ready to download, we have an installer. Moreover we have active and fast support with nightly daily builds. Trying a custom build is an overload for a newcomer in any framework.

apobekiaris commented 5 years ago

In addition I want to point you to https://github.com/eXpandFramework/DevExpress.XAF project which contain standalone modules really easy to build.

But again I do not see the reason cause the project is designed in such a way to provide zero cost support https://github.com/eXpandFramework/DevExpress.XAF/tree/master/tools/Xpand.VersionConverter.

The main project integrates the standlone.

wcraytor commented 5 years ago

So, it works now. But I have yet to rebuild the source. That remains an issue.

apobekiaris commented 5 years ago

what exactly it works? I a bit confused on your status.

wcraytor commented 5 years ago

The build works. I can execute the XVideoRental example. I am having problems with other demos though. Projects are not loading, e.g. in the SecurityDemo, load fails on Security.UILevel.Web and SecurityDemo.Web. I noticed that many of your hint paths are off:

False ..\..\..\Xpand.Dll\DevExpress.DataAccess.v19.1.UI.dll
wcraytor commented 5 years ago

It's the v15.0 problem.

wcraytor commented 5 years ago

i.e. there is no 15.0, it jumped to 16.0

You probably need to change your scripts.

wcraytor commented 5 years ago

Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets"

wcraytor commented 5 years ago

In SecurityDemo.Web, I am hitting an exception at line 89 of SecurityDemo.Web.Global: System.InvalidOperationException: 'Cannot modify Dictionary because ThreadSafeDataLayer uses it. Modified or created ClassInfo: 'Xpand.Persistent.BaseImpl.PersistentMetaData.PersistentClassesModuleInfo'. To avoid this exception, follow these recommendations.

  1. Before creating a ThreadSafeDataLayer instance, initialize the XPDictionary with a full list of persistent and non persistent types, which will be used with XPO (use XPDictionary.GetDataStoreSchema and XPDictionary.CollectClassInfos methods for this purpose).
  2. Ensure that you call the XPDictionary.GetDataStoreSchema method before creating a ThreadSafeDataLayer instance, and that do not call this method after ThreadSafeDataLayer instance created.
  3. Ensure that you call the Session.CreateObjectTypeRecords method before using the ThreadSafeDataLayer instance.
  4. Do not modify any metadata in XPDictionary after you create the ThreadSafeDataLayer instance.
  5. Do not implement persistent types with generic parameters. Аn example of the ThreadSafeDataLayer initialization: https://docs.devexpress.com/XPO/DevExpress.Xpo.ThreadSafeDataLayer'
apobekiaris commented 5 years ago

I will check the demos and remove those outdated. The SeucrityDemo for e.g offers no real value in my opinion and does not justify its support cost, the same for the majority of Demos, XVideoRental as an exception as it demonstrates a real world app.

Note we are in a migration period from private servers to AzureDevOps and plans are to remove all those Easytests you find in the tester solutions as they won't scale well. We will keep a few EasyTest only,now more than 100, to test basic scenarios and not to demonstrate things.

The main project does not have docs, however most functionality is described in the model as stated in the getting started. So I suggest to start from an empty xaf solution or your solution and install only the modules you are interested and not explore the outdated demos and Tester solutions.

Things are totally different in the https://github.com/eXpandFramework/DevExpress.XAF project as you probably noticed. Plans are to replace majors parts of the main project with standalone well tested and well document modules providing their safety to the main project as well.

expand commented 5 years ago

eXpand.lab release 19.1.302.3 includes commit Clean-up demos folder #417 #403 that relate to this task. Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.

Thanks a lot for your contribution.

expand commented 5 years ago

Closing issue for age. Feel free to reopen it at any time.

.Thank you for your contribution.