microsoft / BikeSharing360_BackendServices

BikeSharing360 Demo Apps Backend Services
90 stars 50 forks source link

Problems with deploying VS2017 branch #2

Closed gmwilhelm closed 7 years ago

gmwilhelm commented 7 years ago

Hello,

i'm trying to deploy the VS2017 branch, but i have some problems.

  1. the project BikeSharing.Services.Deploy is missing in the BikeSharing.Services.Deploy.sln, so i had to add it by hand

  2. VS2017 telle me that BikeSharing.Services.Rides is not compatible

  3. when i try to deploy it, i get these error message:

17:48:48 - Deploying DACPACs - Events
17:48:48 - Deploying .\dacpac\bikesharing-services-events.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-eventsName; User ID=*****; Password=******
17:48:48 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:48 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:48 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:48 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:48 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:48 -    nd
17:48:48 -  
17:48:48 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:48 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:48 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:48 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:48 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:48 -  
17:48:48 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:48 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:48 - +                                   ~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:48 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:48 -  
17:48:48 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:48 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:48 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:48 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:48 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:48 -  
17:48:48 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:48 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:48 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:48 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:48 - + ~~~~~~~~~~~~
17:48:48 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:48 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:48 -  
17:48:49 - Deploying DACPACs - Rides
17:48:49 - Deploying .\dacpac\bikesharing-services-rides.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-ridesName; User ID=******; Password=******
17:48:49 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:49 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:49 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:49 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:49 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:49 -    nd
17:48:49 -  
17:48:49 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:49 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:49 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:49 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:49 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:49 -  
17:48:49 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:49 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:49 - +                                   ~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:49 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:49 -  
17:48:49 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:49 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:49 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:49 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:49 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:49 -  
17:48:49 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:49 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:49 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:49 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:49 - + ~~~~~~~~~~~~
17:48:49 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:49 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:49 -  
17:48:50 - Deploying DACPACs - Feedback
17:48:50 - Deploying .\dacpac\bikesharing-services-feedback.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-feedbackName; User ID=******; Password=******
17:48:50 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:50 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:50 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:50 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:50 -    nd
17:48:50 -  
17:48:50 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:50 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:50 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:50 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:50 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:50 - +                                   ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:50 -  
17:48:50 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:50 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:50 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:50 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:50 - + ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:50 -  
17:48:50 - Deploying DACPACs - Events
17:48:50 - Deploying .\dacpac\bikesharing-services-profiles.dacpac to Data Source=tcp:bikesharing360qjivhd6n3fygy.database.windows.net; Initial Catalog=bikesharing-services-profilesName; User ID=******; Password=******
17:48:50 - Add-Type : Mindestens ein Typ in der Assembly kann nicht geladen werden. Rufen Sie die LoaderExceptions-Eigenschaft 
17:48:50 - ab, wenn Sie weitere Informationen ben”tigen.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:22 Zeichen:1
17:48:50 - + Add-Type -Path "$PSScriptRoot\..\lib\Microsoft.SqlServer.Dac.1.0.3\li ...
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [Add-Type], ReflectionTypeLoadException
17:48:50 -     + FullyQualifiedErrorId : System.Reflection.ReflectionTypeLoadException,Microsoft.PowerShell.Commands.AddTypeComma 
17:48:50 -    nd
17:48:50 -  
17:48:50 - New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:50 - "Microsoft.SqlServer.Dac.DacServices" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:28 Zeichen:16
17:48:50 - + $dacServices = New-Object Microsoft.SqlServer.Dac.DacServices $constr
17:48:50 - +                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:39 Zeichen:35
17:48:50 - + Register-ObjectEvent -InputObject $dacServices -EventName "Message" - ...
17:48:50 - +                                   ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined
17:48:50 -  
17:48:50 - Ausnahme beim Aufrufen von "Load" mit 1 Argument(en):  "Der Typeninitialisierer fr 
17:48:50 - "Microsoft.SqlServer.Dac.DacPackage" hat eine Ausnahme verursacht."
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:42 Zeichen:1
17:48:50 - + $dp = [Microsoft.SqlServer.Dac.DacPackage]::Load($dacpacname)
17:48:50 - + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
17:48:50 -     + FullyQualifiedErrorId : TypeInitializationException
17:48:50 -  
17:48:50 - Die Variable "$dacServices" kann nicht abgerufen werden, weil sie nicht festgelegt wurde.
17:48:50 - In C:\Projekte\BikeSharing360_BackendServices\src\BikeSharing.Services.Deploy\bin\Debug\staging\BikeSharing.Services.De
17:48:50 - ploy\Data\DeployDacpac.ps1:43 Zeichen:1
17:48:50 - + $dacServices.Deploy($dp, $dbname, $true, $deployOptions)
17:48:50 - + ~~~~~~~~~~~~
17:48:50 -     + CategoryInfo          : InvalidOperation: (dacServices:String) [], RuntimeException
17:48:50 -     + FullyQualifiedErrorId : VariableIsUndefined

Thanks for help in advance.

eiximenis commented 7 years ago

Hi @gmwilhelm

I updated the sln to contain the BikeSharing.Deploy project. I also updated the csproj files to remove some unwanted entries that make the publish to fail under certain circumstances. Thanks for the advice.

About your error: I've tested a deploy using VS2017 and it worked for me. Deploy of the databases uses Microsoft.SqlServer.Dac.1.0.3. DLL itself is in the repo, but probably you are missing some prerequisite.

I'll try to update the Powershell script to give more info when an error occurs, but meanwhile:

If using a previous version of Microsoft.SqlServer.Dac.dll does not work, you can deploy the databases manually using the database projects provided. To do this, just comment the lines 141 to 149 (both inclusive) from the file Deploy-AzureResourceGroup.ps1, rerun the deploy project and then publish manually the databases projects using Visual Studio.

Sorry for the incovenience, let me know your thoughts.

gmwilhelm commented 7 years ago

Thank you very much, i was now able to deploy everthing.