Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/changes/cadl-vs/solution-settings_2022-08-24-18-47.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "cadl-vs",
"comment": "Fix issue with configured cadl-server location not being found when opening a solution.",
"type": "patch"
}
],
"packageName": "cadl-vs"
}
12 changes: 8 additions & 4 deletions packages/cadl-vs/VS2019/Microsoft.Cadl.VS2019.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
<VisualStudioMaxVersionExclusive>17.0</VisualStudioMaxVersionExclusive>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="16.0.206" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VisualStudio.Workspace" Version="16.3.43" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VisualStudio.Workspace.VSIntegration" Version="16.3.43" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.9.1050" PrivateAssets="All" />
<!-- Use 16.0.x here for compatible API -->
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="16.0.208" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VisualStudio.Workspace" Version="16.0.59" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VisualStudio.Workspace.VSIntegration" Version="16.0.59" ExcludeAssets="Runtime" />
<!-- Use 16.latest for build tools -->
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.11.65" PrivateAssets="All" />
<!-- Align with VS 16.0 version here: https://devblogs.microsoft.com/visualstudio/using-newtonsoft-json-in-a-visual-studio-extension/-->
<PackageReference Include="NewtonSoft.JSON" Version="9.0.1" ExcludeAssets="Runtime" />
</ItemGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<Import Project="../Microsoft.Cadl.VS.targets" />
Expand Down
6 changes: 5 additions & 1 deletion packages/cadl-vs/VS2022/Microsoft.Cadl.VS2022.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@
<VisualStudioMaxVersionExclusive>18.0</VisualStudioMaxVersionExclusive>
</PropertyGroup>
<ItemGroup>
<!-- Use 17.0.x or latest 16.x if no 17.0.x for compatible API-->
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.31902.203" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VisualStudio.Workspace" Version="16.3.43" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VisualStudio.Workspace.VSIntegration" Version="16.3.43" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.1.4057" PrivateAssets="All" />
<!-- Use latest 17.x for build tools-->
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.3.2093" PrivateAssets="All" />
<!-- Align with VS 17.0 version here: https://devblogs.microsoft.com/visualstudio/using-newtonsoft-json-in-a-visual-studio-extension/-->
<PackageReference Include="NewtonSoft.JSON" Version="13.0.1" ExcludeAssets="Runtime" />
</ItemGroup>
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
<Import Project="../Microsoft.Cadl.VS.targets" />
Expand Down
25 changes: 9 additions & 16 deletions packages/cadl-vs/src/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,25 @@ internal static class Win32ErrorCodes


[Serializable]
public class CadlUserErrorException : Exception
internal class CadlUserErrorException : Exception
{
public CadlUserErrorException() { }

public CadlUserErrorException(string message)
: base(message)
public CadlUserErrorException(string message, Exception? innerException = null)
: base(message, innerException)
{

}
}


[Serializable]
public class CadlServerNotFoundException : CadlUserErrorException
internal sealed class CadlServerNotFoundException : CadlUserErrorException
{
public CadlServerNotFoundException() { }

public CadlServerNotFoundException(string name)
public CadlServerNotFoundException(string fileName, Exception? innerException = null)
: base(string.Join("\n", new string[]
{
$"Cadl server exectuable was not found: '{name}' is not found. Make sure either:",
" - cadl is installed globally with `npm install -g @cadl-lang/compiler'.",
" - cadl server path is configured with https://github.com/microsoft/cadl/blob/main/packages/cadl-vs/README.md#configure-cadl-visual-studio-extension."
}))
$"Cadl server exectuable was not found: '{fileName}' is not found. Make sure either:",
" - cadl is installed globally with `npm install -g @cadl-lang/compiler'.",
" - cadl server path is configured with https://github.com/microsoft/cadl/blob/main/packages/cadl-vs/README.md#configure-cadl-visual-studio-extension."
}, innerException))
{

}
}
}
Loading