2022-01-28 标签:NET6,报错,A,relational,store,configured,without,specifying,either,DbConnection,connection,string,use,MysqlContext,options,ConnectionString,版本,asp.net,core6.0
今天在将项目升级到asp.net core6.0后发现报错A relational store has been configured without specifying either the DbConnection or connection string to use.项目使用的数据库是My
2022-01-22 标签:VS,发布,asp.net,core,项目,web,config,包含,production,环境变量,EnvironmentName,PropertyGroup,设置,配置文件,文件,Visual,Studio,2022,NET6.0
今天在用Visual Studio 2022发布NET6.0或者说asp.net core发布时,在web.config包含production或者Development,VS在发布时替换asp.net core中的web.config
2021-05-19 标签:MySQL Workbench,MySQL,Workbench,错误,Target,host,configured,Windows,seems,different,OS,8.0,版本,重新安装,报错,Server,Status,could,acquire
今天升级MySQL Workbench后打开Server Status报错:could not acquire management access for administration Runtime Error: Target host is configured as Windows, but
2021-05-07 标签:net,批量,插入,报错,来自,数据源,String,类型,给定,不能,转换,指定,目标,nvarchar,50,长度,错误
今天在做.net批量插入SqlServer报错:来自数据源的 String 类型的给定值不能转换为指定目标列的类型 nvarchar.报此错误一般是插入的内容太长,目标字段设定的长度太短导致.比如截图的ConfigDesc字段,长度限定为50,实际内容超过50就会报错,解决办法就是把长度设置成合适的
2020-07-19 标签:asp.net,web,api,自定义,返回,json,datetime,格式,配置,设置,GlobalConfiguration,Configuration,Formatters,JsonFormatter,SerializerSettings,DateFormatString,yyyy,MM,dd
上一篇说到,《asp.net web api 设置默认返回json格式》 但是返回的json中的日期格式都是带T等字母的,现在是想要返回自己定义json格式的配置,这要怎么配置呢?还是在配置那里设置,差不多一样的。自定义返回json的datetime格式的代码如下:GlobalConfi
2020-07-17 标签:asp.net,web,api,设置,默认,返回,json,格式,代码,webform,Web,Api,xml,GlobalConfiguration,Configuration,Formatters,XmlFormatter,SupportedMediaTypes,Clear
上一遍文章写到,但是默认是返回xml格式的,能不能设置默认返回json格式呢?答案是当然可以的!代码如下:GlobalConfiguration.Configuration.Formatters.XmlFormatter.SupportedMediaTypes.Clear()
2020-07-15 标签:asp.net api,webform api,asp.net web api,asp.net开发api,asp.net,webform,使用,Web,Api,接口,api,web,config,添加,Application,Start,void,WebApiConfig,Register
公司目前还是使用asp.net webform开发,打算搞个web api,目前很多都是基于mvc的,但也是可以使用asp.net webform进行web api开发的。首先在Global.asax的Application_Start添加路由注册,代码如下:protected void
2020-06-26 标签:netcore,引用,程序,程序包,输出,目录,PropertyGroup,TargetFramework,Configurations,右击,netstandard2.0,Debug,Release,Test,true,项目,节点,代码
.netcore引用程序集或程序包输出到目录,右击.netcore项目,编辑项目文件:代码如下,其中CopyLocalLockFileAssemblies节点便是netstandard2.0Debug;Release;Testtrue
2020-06-07 标签:net,core,读取,json,配置文件,实现,示例,前言,传统,asp,n,et,mvc,项目,相比,目录,文件,结构,功能上,前者
前言:在与传统的asp.net MVC项目相比,.net core项目在项目目录的文件结构上和功能上与前者都有很大的区别。例如:在.net core中使用Startup.cs取代Global.asax文件用于加载应用程序的配置和各种启动项。appsettings.json取代web.config文件
2020-06-07 标签:结巴,分词,The,type,initializer,JiebaNet,Segmenter,JiebaSegmenter,threw,exception,System,Configuration,ConfigurationManager,0.0,断点,报错,asp.net,core
今天在asp.net core项目中使用.net结巴分词报错:The type initializer for 'JiebaNet.Segmenter.JiebaSegmenter' threw an exception.断点发现,InnerException为:"Could not l