gpt4 book ai didi

c# - 如何阻止 VS2015 将 my.csproj 转换为 .sqlproj?

转载 作者:太空狗 更新时间:2023-10-29 19:40:31 28 4
gpt4 key购买 nike

我有一个旧的解决方案,我正在尝试使用其中的当前项目构建一个更新的解决方案。其中一个项目是 SQLUtils,它只包含 .cs 文件,它的目标框架.NET Framework 2.0

在旧的解决方案中,它是一个常规的 C# 类库项目,但是当我将它添加到我的新解决方案中时,它变成了 .sqlproj,并且在构建它时出现错误。

我尝试像编辑旧文件一样编辑新的 .sln,但这没有任何区别。

我看了https://social.msdn.microsoft.com/Forums/sqlserver/en-US/38113dcd-caaa-4704-ad69-d7ce774d2916/sql-server-data-tools-september-edition-migration-issues-vs2010?forum=ssdt

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/0f537da4-9d61-45bf-8778-102eae9d4b83/csproj-to-sqlproj-migration-in-vs2012-with-ssdt?forum=ssdt

但他们并没有完全解决它,你知道 MSDN...

附加信息:解决方案文件:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "BO 25.7.17", "BO 25.7.17", "{5C12D821-9F39-4C47-A888-DD65E5CD6464}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv2.0"
ProjectReferences = "{f977dcec-ed6c-485f-ab12-1fe31b7cbc5c}|Logic.dll;"
Debug.AspNetCompiler.VirtualPath = "/localhost_61694"
Debug.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\TFS\StyleRiver\BO\BO 25.7.17\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_61694\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/localhost_61694"
Release.AspNetCompiler.PhysicalPath = "..\..\..\..\..\..\TFS\StyleRiver\BO\BO 25.7.17\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_61694\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "61694"
SlnRelativePath = "..\..\..\..\..\..\TFS\StyleRiver\BO\BO 25.7.17\"
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Logic", "Logic\Logic.csproj", "{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Debug|x64.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Debug|x64.Build.0 = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Debug|x86.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Release|Any CPU.Build.0 = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Release|x64.ActiveCfg = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Release|x64.Build.0 = Debug|Any CPU
{5C12D821-9F39-4C47-A888-DD65E5CD6464}.Release|x86.ActiveCfg = Debug|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Debug|x64.ActiveCfg = Debug|x64
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Debug|x64.Build.0 = Debug|x64
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Debug|x86.ActiveCfg = Debug|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Release|Any CPU.Build.0 = Release|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Release|x64.ActiveCfg = Release|x64
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Release|x64.Build.0 = Release|x64
{F977DCEC-ED6C-485F-AB12-1FE31B7CBC5C}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = http://gpnt049:8080/tfs/zap%20market%20-%20zap%20travel
SccWebProject0 = true
SccProjectUniqueName0 = BO\u002025.7.17
SccProjectName0 = BO\u002025.7.17
SccAuxPath0 = http://gpnt049:8080/tfs/zap%20market%20-%20zap%20travel
SccLocalPath0 = BO\u002025.7.17
SccProvider0 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccProjectEnlistmentChoice0 = 2
SccProjectUniqueName1 = Logic\\Logic.csproj
SccProjectName1 = Logic
SccAuxPath1 = http://gpnt049:8080/tfs/zap%20market%20-%20zap%20travel
SccLocalPath1 = Logic
SccProvider1 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
EndGlobalSection
EndGlobal

.csproj:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{c252feb5-a946-4202-b1d4-9916a0590387};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProductVersion>8.0.50727</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{80A3D07F-863D-4E34-A5D4-8587A201629E}</ProjectGuid>
<OutputType>Library</OutputType>
<NoStandardLibraries>false</NoStandardLibraries>
<AssemblyName>SQLUtils</AssemblyName>
<RootNamespace>SQLUtils</RootNamespace>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
<FileUpgradeFlags>40</FileUpgradeFlags>
<OldToolsVersion>4.0</OldToolsVersion>
<UpgradeBackupLocation>C:\TFS\StyleRiver\StyleRiver 24.7.17\Backup1\</UpgradeBackupLocation>
<ConnectionString />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
</SccLocalPath>
<SccAuxPath>
</SccAuxPath>
<SccProvider>
</SccProvider>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>4</WarningLevel>
<DeployCode>true</DeployCode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>false</DebugSymbols>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildBinPath)\SqlServer.targets" />
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.XML" />
</ItemGroup>
<ItemGroup>
<Compile Include="Concat.cs" />
<Compile Include="ConcatDistinct.cs" />
<Compile Include="Encryption.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SqlRegEx.cs" />
<Compile Include="ToUrlCompatible.cs" />
</ItemGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<None Include="Test Scripts\Test1.sql" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
</Project>

每次我添加项目时,都会创建一个名为“UpgradeLog.htm”的文件。
这是它的样子: UpgradeLog.htm

最佳答案

引用代码项目中的以下文章

List of Visual Studio Project Type GUIDs

There isn't an easy way to change the type of a project in Visual Studio project once it is created; for example changing a C# Class Library into a Portable Class Library (PCL). Knowing these GUIDs will allow you to edit project files like .csproj and .vbproj to easily change a project type in cases where Visual Studio will not allow using the GUI.

让我们看一下上面显示的代码片段中的项目类型 GUID

解决方案文件:

{E24C65DC-7377-472B-9ABA-BC803B73C61A} = Web Site Project
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} = C# Project

查看解决方案文件时提到了上述项目类型。所有其他 GUID 都是项目本身的唯一项目 ID。

.csproj: 具有以下项目类型 GUID

<ProjectTypeGuids>{c252feb5-a946-4202-b1d4-9916a0590387};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

其中项目类型 GUID

{c252feb5-a946-4202-b1d4-9916a0590387} = Visual Database Tools
{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} = C# Project

再次引用文章,替换OP相关代码

Notes

  1. You will find these properties as a <ProjectTypeGuids> element in the project file, not to be confused with <ProjectGuid> which is a unique identifier for your project.
  2. Some GUIDs are used in combination. For example <ProjectTypeGuids>{c252feb5-a946-4202-b1d4-9916a0590387};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> describes a Visual Database Tools library in C#.

我建议您尝试删除/替换 Visual Database Tools项目类型指南 {c252feb5-a946-4202-b1d4-9916a0590387}.csproj 项目文件开始,然后尝试在较新的 IDE 中打开它

关于c# - 如何阻止 VS2015 将 my.csproj 转换为 .sqlproj?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45983609/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com