提交 9cdaba30 编写于 作者: D Dustin Campbell

Add failing test for issue #29122

上级 0b90e960
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>
</SchemaVersion>
<ProjectGuid>{F8AE35AB-1AC5-4381-BB3E-0645519695F5}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>ClassLibrary1</RootNamespace>
<AssemblyName>ClassLibrary1</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>On</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>..\Dev\</OutputPath>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DefineTrace>true</DefineTrace>
<OutputPath>..\Dev\</OutputPath>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile Include="Class1.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{65D39B82-9F22-4350-9BFF-3988C367809B}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>ClassLibrary2</RootNamespace>
<AssemblyName>ClassLibrary2</AssemblyName>
<FileAlignment>512</FileAlignment>
<MyType>Windows</MyType>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<TargetFrameworkProfile />
<RestorePackages>true</RestorePackages>
</PropertyGroup>
<PropertyGroup>
<OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
<OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
<OptionStrict>On</OptionStrict>
</PropertyGroup>
<PropertyGroup>
<OptionInfer>On</OptionInfer>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<DefineDebug>true</DefineDebug>
<DefineTrace>true</DefineTrace>
<OutputPath>..\Dev\Modules\</OutputPath>
<NoWarn>
</NoWarn>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<DebugType>pdbonly</DebugType>
<DefineDebug>false</DefineDebug>
<DefineTrace>true</DefineTrace>
<Optimize>true</Optimize>
<OutputPath>..\Dev\Modules\</OutputPath>
<NoWarn>
</NoWarn>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Compile Include="Class1.vb" />
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Application.myapp</DependentUpon>
</Compile>
<Compile Include="My Project\Resources.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="My Project\Settings.Designer.vb">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="My Project\Resources.resx">
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
<CustomToolNamespace>My.Resources</CustomToolNamespace>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Include="My Project\Application.myapp">
<Generator>MyApplicationCodeGenerator</Generator>
<LastGenOutput>Application.Designer.vb</LastGenOutput>
</None>
<None Include="My Project\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<CustomToolNamespace>My</CustomToolNamespace>
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Proj1\ClassLibrary1.vbproj">
<Project>{f8ae35ab-1ac5-4381-bb3e-0645519695f5}</Project>
<Name>ClassLibrary1</Name>
<Private>False</Private>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
MinimumVisualStudioVersion = 10.0.40219.1
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClassLibrary1", "Proj1\ClassLibrary1.vbproj", "{F8AE35AB-1AC5-4381-BB3E-0645519695F5}"
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "ClassLibrary2", "Proj2\ClassLibrary2.vbproj", "{65D39B82-9F22-4350-9BFF-3988C367809B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8AE35AB-1AC5-4381-BB3E-0645519695F5}.Debug|Any CPU.ActiveCfg = Debug|x86
{F8AE35AB-1AC5-4381-BB3E-0645519695F5}.Debug|x86.ActiveCfg = Debug|x86
{F8AE35AB-1AC5-4381-BB3E-0645519695F5}.Debug|x86.Build.0 = Debug|x86
{F8AE35AB-1AC5-4381-BB3E-0645519695F5}.Release|Any CPU.ActiveCfg = Release|x86
{F8AE35AB-1AC5-4381-BB3E-0645519695F5}.Release|x86.ActiveCfg = Release|x86
{F8AE35AB-1AC5-4381-BB3E-0645519695F5}.Release|x86.Build.0 = Release|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Debug|Any CPU.ActiveCfg = Debug|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Debug|Any CPU.Build.0 = Debug|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Debug|x86.ActiveCfg = Debug|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Debug|x86.Build.0 = Debug|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Release|Any CPU.ActiveCfg = Release|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Release|Any CPU.Build.0 = Release|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Release|x86.ActiveCfg = Release|x86
{65D39B82-9F22-4350-9BFF-3988C367809B}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {091C5642-C43A-4E23-A3BC-0CC533E3B5C1}
EndGlobalSection
EndGlobal
......@@ -53,4 +53,7 @@
<ItemGroup>
<Compile Remove="Resources\**\*.*" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\Issue29122\" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -86,6 +86,7 @@ public static class SolutionFiles
public static string DuplicatedGuidsBecomeSelfReferential => GetText("SolutionFiles.DuplicatedGuidsBecomeSelfReferential.sln");
public static string DuplicatedGuidsBecomeCircularReferential => GetText("SolutionFiles.DuplicatedGuidsBecomeCircularReferential.sln");
public static string EmptyLineBetweenProjectBlock => GetText("SolutionFiles.EmptyLineBetweenProjectBlock.sln");
public static string Issue29122_Solution => GetText("Issue29122.TestVB2.sln");
public static string InvalidProjectPath => GetText("SolutionFiles.InvalidProjectPath.sln");
public static string MissingEndProject1 => GetText("SolutionFiles.MissingEndProject1.sln");
public static string MissingEndProject2 => GetText("SolutionFiles.MissingEndProject2.sln");
......@@ -159,6 +160,8 @@ public static class VisualBasic
public static string Circular_Target => GetText("ProjectFiles.VisualBasic.Circular_Target.vbproj");
public static string Circular_Top => GetText("ProjectFiles.VisualBasic.Circular_Top.vbproj");
public static string Embed => GetText("ProjectFiles.VisualBasic.Embed.vbproj");
public static string Issue29122_ClassLibrary1 => GetText("Issue29122.Proj1.ClassLibrary1.vbproj");
public static string Issue29122_ClassLibrary2 => GetText("Issue29122.Proj2.ClassLibrary2.vbproj");
public static string InvalidProjectReference => GetText("ProjectFiles.VisualBasic.InvalidProjectReference.vbproj");
public static string NonExistentProjectReference => GetText("ProjectFiles.VisualBasic.NonExistentProjectReference.vbproj");
public static string UnknownProjectExtension => GetText("ProjectFiles.VisualBasic.UnknownProjectExtension.vbproj");
......
......@@ -87,6 +87,13 @@ protected void CreateCSharpFiles()
CreateFiles(GetSimpleCSharpSolutionFiles());
}
protected FileSet GetBaseFiles()
{
return new FileSet(
(@"Directory.Build.props", Resources.Directory_Build_props),
(@"Directory.Build.targets", Resources.Directory_Build_targets));
}
protected FileSet GetSimpleCSharpSolutionFiles()
{
return new FileSet(
......
......@@ -3526,6 +3526,45 @@ public async Task TestOpenProject_CommandLineArgsHaveNoErrors()
}
}
[ConditionalFact(typeof(VisualStudioMSBuildInstalled)), Trait(Traits.Feature, Traits.Features.MSBuildWorkspace)]
[WorkItem(29122, "https://github.com/dotnet/roslyn/issues/29122")]
public async Task TestOpenSolution_ProjectReferencesWithUnconventionalOutputPaths()
{
CreateFiles(GetBaseFiles()
.WithFile(@"TestVB2.sln", Resources.SolutionFiles.Issue29122_Solution)
.WithFile(@"Proj1\ClassLibrary1.vbproj", Resources.ProjectFiles.VisualBasic.Issue29122_ClassLibrary1)
.WithFile(@"Proj1\Class1.vb", Resources.SourceFiles.VisualBasic.VisualBasicClass)
.WithFile(@"Proj1\My Project\Application.Designer.vb", Resources.SourceFiles.VisualBasic.Application_Designer)
.WithFile(@"Proj1\My Project\Application.myapp", Resources.SourceFiles.VisualBasic.Application)
.WithFile(@"Proj1\My Project\AssemblyInfo.vb", Resources.SourceFiles.VisualBasic.AssemblyInfo)
.WithFile(@"Proj1\My Project\Resources.Designer.vb", Resources.SourceFiles.VisualBasic.Resources_Designer)
.WithFile(@"Proj1\My Project\Resources.resx", Resources.SourceFiles.VisualBasic.Resources)
.WithFile(@"Proj1\My Project\Settings.Designer.vb", Resources.SourceFiles.VisualBasic.Settings_Designer)
.WithFile(@"Proj1\My Project\Settings.settings", Resources.SourceFiles.VisualBasic.Settings)
.WithFile(@"Proj2\ClassLibrary2.vbproj", Resources.ProjectFiles.VisualBasic.Issue29122_ClassLibrary2)
.WithFile(@"Proj2\Class1.vb", Resources.SourceFiles.VisualBasic.VisualBasicClass)
.WithFile(@"Proj2\My Project\Application.Designer.vb", Resources.SourceFiles.VisualBasic.Application_Designer)
.WithFile(@"Proj2\My Project\Application.myapp", Resources.SourceFiles.VisualBasic.Application)
.WithFile(@"Proj2\My Project\AssemblyInfo.vb", Resources.SourceFiles.VisualBasic.AssemblyInfo)
.WithFile(@"Proj2\My Project\Resources.Designer.vb", Resources.SourceFiles.VisualBasic.Resources_Designer)
.WithFile(@"Proj2\My Project\Resources.resx", Resources.SourceFiles.VisualBasic.Resources)
.WithFile(@"Proj2\My Project\Settings.Designer.vb", Resources.SourceFiles.VisualBasic.Settings_Designer)
.WithFile(@"Proj2\My Project\Settings.settings", Resources.SourceFiles.VisualBasic.Settings));
var solutionFlePath = GetSolutionFileName(@"TestVB2.sln");
using (var workspace = CreateMSBuildWorkspace())
{
var solution = await workspace.OpenSolutionAsync(solutionFlePath);
// Neither project should contain any unresolved metadata references
foreach (var project in solution.Projects)
{
Assert.DoesNotContain(project.MetadataReferences, mr => mr is UnresolvedMetadataReference);
}
}
}
private class InMemoryAssemblyLoader : IAnalyzerAssemblyLoader
{
public void AddDependencyLocation(string fullPath)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册