admin管理员组文章数量:1125076
first of all, I have 2 projects, that are technically the same, but one of them only works with Oracle, and the other works with both Oracle and MySql depending on the appsettings.json. now both projects work fine when I run them from visual studio, APIs work correctly and inserting/updating/deleting from both databases are done correctly. building a web service from the only-Oracle project works fine, but when I publish the project and copy the files needed to the web service in the second case, I get an error: "The operation could not be completed. Exception occured.".
if I try to remove the pomelo dll, the files copy fine but the web service won't work. same with copying files without pomelo then copying pomelo after. in those 2 cases, the web service does build and deploy but running any API gives "500 Internal Server Error" so the trick won't fix anything.
anyone has any idea how can this be solved?
the .csproj file I publish:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<OutputType>WinExe</OutputType>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>
<ItemGroup>
<COMReference Include="OracleInProcServer">
<WrapperTool>tlbimp</WrapperTool>
<VersionMinor>0</VersionMinor>
<VersionMajor>5</VersionMajor>
<Guid>f2d4ed20-ffd3-101a-adf2-04021c007002</Guid>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<None Include="compilerconfig.json" />
<None Include="wwwroot\Kiosk.ini" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Infra\Data\DataContext.csproj" />
</ItemGroup>
<ItemGroup>
<Content Update="appsettings.Development.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="M2Mqtt" Version="4.3.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.10">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MySql.EntityFrameworkCore" Version="8.0.5" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.110" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="Ultimate_AG">
<HintPath>..\..\..\..\..\..\..\..\..\OMEGASYS\Oprg\Ultimate_AG.dll</HintPath>
</Reference>
<Reference Include="Ultimate_HOC">
<HintPath>..\..\..\..\..\OMEGASYS\Oprg\Ultimate_HOC.dll</HintPath>
</Reference>
</ItemGroup>
</Project>
本文标签:
版权声明:本文标题:c# - How to build a Web Service (Web Setup Project) with Pomelo.EntityFrameworkCore.MySql.dll without it breaking? - Stack Overf 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736652864a1946182.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论