首页 文章

异常详细信息:System.ArgumentException:路径中的非法字符 . ASP.NET MVC

提问于
浏览
0

Hi, I have a problem using ASP MVC with C#. When I create an aspx page with a strongly typed inherit I received the following error:

'/'应用程序中的服务器错误 .

路径中的非法字符 . 描述:执行当前Web请求期间发生未处理的异常 . 请查看堆栈跟踪以获取有关错误及其源自代码的位置的更多信息 .

异常详细信息:System.ArgumentException:路径中的非法字符 .

来源错误:

第60行:///

第61行:///连接字符串

第62行:public ObjectContext(string connectionString)

第63行:: base(connectionString,“Entity”)

第64行:{

I cannot solve this problem, in any webpage I create I received the same problem. I checked my web.config information on the internet but its ok, I re created the ado entity connection but the same happens.

This is my connection string on web.config:

add name = "Entity" connectionString =“metadata = res:///Models.model.csdl | res:///Models.model.ssdl | res://*/Models.Model.msl; provider = System.Data.SqlClient ; provider connection string = "Data Source=SOURCE\SQL;Initial Catalog=db;Persist Security Info=True;User ID=user;Password=password;MultipleActiveResultSets=True" " providerName=" System.Data.EntityClient“/>

thank you so much!.

1 回答

  • 1

    我可以看到你的连接字符串看起来错了 . 应该 ....metadata=res://*/Models.model.csdl|res://*/Models.model.ssdl....

    只是你知道元数据代表了这个:

    metadata=res://{assembly}/{namespace}.{filename}.csdl|res://{assembly}/{namespace}.{filename}.ssdl|res://{assembly}/{namespace}.{filename}.msl;
    

    您可以放置程序集名称或通配符 * ,它在您的csdl和ssdl上看起来就像您一样

相关问题