Skip to content

Commit

Permalink
Initialization of Service Object as per #71
Browse files Browse the repository at this point in the history
Initialize of Service object based on suggestion from Henil G
  • Loading branch information
shashisadasivan committed Dec 20, 2024
1 parent 33685cd commit d9d2fce
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 14 deletions.
Binary file modified OutputDlls/Microsoft.VisualStudio.Interop.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified OutputDlls/SSD365VSAddIn.dll
Binary file not shown.
Binary file added OutputDlls/envdte.dll
Binary file not shown.
Binary file modified OutputDlls/envdte80.dll
Binary file not shown.
9 changes: 8 additions & 1 deletion SSD365VSAddIn/SSD365VSAddIn/Common/CommonUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,14 @@ internal static VSProjectNode GetCurrentProject()
/// <returns>VSApplicationContext</returns>
internal static Microsoft.Dynamics.Framework.Tools.Labels.VSApplicationContext GetVSApplicationContext()
{
var context = new Microsoft.Dynamics.Framework.Tools.Labels.VSApplicationContext(CommonUtil.DTE.DTE);
if(DTE == null)
{
throw new InvalidOperationException("DTE is not initialized");
}
// Create a service provider from the DTE object
IServiceProvider serviceProvider = new Microsoft.VisualStudio.Shell.ServiceProvider(DTE as Microsoft.VisualStudio.OLE.Interop.IServiceProvider);
// Create the context based ont he service provider
var context = new Microsoft.Dynamics.Framework.Tools.Labels.VSApplicationContext(serviceProvider);
return context;
}

Expand Down
29 changes: 16 additions & 13 deletions SSD365VSAddIn/SSD365VSAddIn/SSD365VSAddIn.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<Reference Include="envdte, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
<HintPath>..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\PublicAssemblies\envdte.dll</HintPath>
</Reference>
<Reference Include="envdte80, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\envdte80.17.10.40170\lib\net472\envdte80.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\PublicAssemblies\envdte80.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Build.Utilities.v4.0" />
<Reference Include="Microsoft.Dynamics.AX.Metadata">
Expand Down Expand Up @@ -67,48 +68,50 @@
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.AutomationObjects.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.AutomationObjects.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.AutomationObjects.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.BuildTasks">
<HintPath>K:\AosService\PackagesLocalDirectory\bin\Microsoft.Dynamics.Framework.Tools.BuildTasks.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.Configuration.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.Configuration.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.Configuration.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.Core.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.Core.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.Core.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.Extensibility.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.Extensibility.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.Extensibility.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.LabelEditor.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.LabelEditor.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.LabelEditor.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.MetaModel.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.MetaModel.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.MetaModel.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.MetaModel.Core.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.MetaModel.Core.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.MetaModel.Core.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.ProjectSupport.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.ProjectSupport.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.ProjectSupport.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.Dynamics.Framework.Tools.ProjectSystem.17.0">
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\evslr1m4.vij\Microsoft.Dynamics.Framework.Tools.ProjectSystem.17.0.dll</HintPath>
<HintPath>..\..\..\..\..\..\..\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE\Extensions\r14op0sw.ult\Microsoft.Dynamics.Framework.Tools.ProjectSystem.17.0.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Microsoft.VisualStudio.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.VisualStudio.Interop.17.10.40170\lib\net472\Microsoft.VisualStudio.Interop.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualStudio.OLE.Interop, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="Microsoft.VisualStudio.Shell.Framework, Version=17.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
<Reference Include="netstandard" />
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
Expand Down Expand Up @@ -241,7 +244,7 @@
<PostBuildEvent>echo "----"
echo "--&gt; Copy to Outputdlls"
echo "Copy all DLLs"
copy $(TargetDir)\*.dll $(ProjectDir)..\..\OutputDlls\
copy $(TargetDir)\*.dll $(SolutionDir)..\OutputDlls\
echo "&lt;-- Copy Complete"</PostBuildEvent>
</PropertyGroup>
</Project>

0 comments on commit d9d2fce

Please sign in to comment.