locked
Deployment Failure - System.ArgumentException: Illegal characters in path. RRS feed

  • Question

  • User-183828470 posted

    I have created an asp.net MVC3 website I would like to upload via Webmatrix. The website uses a database I set up in webmatrix (SQL Compact Databases). I am using an ado.net data entity model to interface with the database. The website runs properly on my local machine, but when I attempt to deploy it via webmatrix I recieve the following error:

    System.ArgumentException: Illegal characters in path.
       at System.IO.Path.CheckInvalidPathChars(String path)
       at System.IO.Path.IsPathRooted(String path)
       at Microsoft.WebMatrix.Deployment.DeployFilesFilter.ApplyFilterForSqlCeInternal()
       at Microsoft.WebMatrix.Deployment.DeployFilesFilter.ApplyFilterForSqlCe()
       at Microsoft.WebMatrix.Deployment.DeployFilesFilter.ApplyFilters()
       at Microsoft.WebMatrix.Deployment.MsDeployWorker.Execute(Boolean pullback)

     After a little experimentation I have determined that ths problem appears to be linked to my web.config connection string for the databases (With this string removed the deploy error no longer occurs).

    <add name="MyDatabaseEntities" connectionString="metadata=res://*/Models.MyDatabaseModel.csdl|res://*/Models.MyDatabaseModel.ssdl|res://*/Models.MyDatabaseModel.msl;provider=System.Data.SqlServerCe.4.0;provider connection string= &quot; Data Source=|DataDirectory|\MyDatabase.sdf &quot;" providerName="System.Data.EntityClient" />
    

     

    Does anybody know why I am getting this error - what am I missing here?

    Thanks!

     

     

     

    Friday, May 20, 2011 1:27 PM

Answers

  • User1618479829 posted

    Try this

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


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 20, 2011 4:11 PM

All replies

  • User1618479829 posted

    Try this

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


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, May 20, 2011 4:11 PM
  • User-599955823 posted

    Hello I am facing the same problem.

    I don't think it is the metadata problem.

    if I change this

    <add name="MyDataModel1Container" connectionString="metadata=res://*/Models.MyDataModel1.csdl|res://*/Models.MyDataModel1.ssdl|res://*/Models.MyDataModel1.msl;provider=System.Data.SqlServerCe.4.0;provider connection string='Data Source=|DataDirectory|\DatabaseCE1.sdf'" providerName="System.Data.EntityClient" />
      

    to this 

    <add name="MyDataModel1Container" connectionString="metadata=res://*/Models.MyDataModel1.csdl|res://*/Models.MyDataModel1.ssdl|res://*/Models.MyDataModel1.msl;provider=System.Data.SqlServerCe.4.0;provider connection string='Data Source=DatabaseCE1.sdf'" providerName="System.Data.EntityClient" />

    Then, I can publish, but, my app would not be able to find DatabaseCE1.sdf anymore because I removed |DataDirectory|.

     

    I publish this app as sub-app. Meaning, it is under my www.mysite.com/mvc-test/ , not directly under www.mysite.com , which maybe the cause of the problem.

     

    Please help, thank you.

    Thursday, February 23, 2012 3:32 AM